hey guys
This is the scripts
using UnityEngine;
using System.Collections;
using System.Collections.Generic;
public class Inventory : MonoBehaviour {
public List<Item> inventory = new List<Item>();
private ItemDatabase database;
// Use this for initialization
void Start () {
database = GameObject.FindGameObjectWithTag("Item Database").GetComponent<Database>();
inventory.Add(database.items[0]);
inventory.Add(database.items[1]);
}
void OnGUI()
{
for(int i = 0; i <inventory.Count; i++)
{
GUI.Label(new Rect(10,i * 20,200,50), inventory[i].itemName);
}
}
}
and play game
unity give me this error: Item Database is not defined why? wat is the problem ?
I use this tutorials