I am having issues with my “Loot System”, can someone show me the mistakes I made? I am using the BergZerg Arcade tutorials. Here is script so far. Any help would be appreciated. Thanks!
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 IList _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<_lootItems>();
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, butonHeight); cnt.ToString());
}
private void Populate() {
for(int cnt = 0; cnt < 25; cnt++)
_lootItems.Add(new Item());
}