Hi! Plz help, I have an Error: Assets/myGUI.cs(11,22): error CS0246: The type or namespace name `Item’ could not be found. Are you missing a using directive or an assembly reference?
Here the script:
using UnityEngine;
using System.Collections;
using System.Collections.Generic;
public class myGUI : MonoBehaviour {
public float lootWindowHeight = 90;
public float buttonWidth = 40;
public float buttonHeight = 40;
private List<Item> _lootItems;
private float _offset = 10;
private const int LOOT_WINDOW_ID = 0;
private Rect _lootWindowRect = new Rect(0,0,0,0);
// Use this for initialization
void Start () {
_lootItems = new List<Item>();
Populate();
}
// Update is called once per frame
void Update () {
}
void OnGUI() {
_lootWindowRect = GUI.Window(LOOT_WINDOW_ID, new Rect(_offset, Screen.height - (_offset + lootWindowHeight), Screen.width - (_offset * 2), lootWindowHeight), LootWindow, "Loot Window");
}
private void LootWindow(int id) {
for(int cnt = 0; cnt < _lootItems.Count; cnt++) {
GUI.Button(new Rect(buttonWidth * cnt, 0, buttonWidth, buttonHeight), cnt.ToString());
}
}
private void Populate() {
for(int cnt = 0; cnt < 25; cnt++)
_lootItems.Add(new Item());
}
}