It says that an expression denotes a type where variable, value, or method group was expected on line 26. Does it mean the x in my array?
using UnityEngine;
using System.Collections.Generic;
public class Inventory : MonoBehaviour {
//holds weapons
public WeaponAndArmor[] weapons;
//holds health items
public int[] healthItem = new int[0];
//inventory
List<WeaponAndArmor> mainInventory = new List<WeaponAndArmor>();
void Start(){
mainInventory.Add (weapons[0]);
//Make this print out in a chatbox system for only you to see
Debug.Log (mainInventory [0].name);
}
void OnGUI(){
for (int x = 0; x < mainInventory.Count; x++) {
//problem is on the line below here
if(GUI.Button(Rect(Screen.width/2, Screen.height/2 + (20* x), 100, 20)));
}
}
//All of the different types of items you can have set in classes
// | | | | | | | | | |
// v v v v v v v v v v
[System.Serializable]
public class WeaponAndArmor{
public string name;
public string description;
public Texture2D icon;
public bool equiped;
public float speed;
public int damage;
public enum itemType {
head,
chest,
hands,
legs,
feet,
weapon,
healthItem,
other
}
//make functions and other that tells what the above variables do if used
}
}