Pls Does anyone help me?
Assets/Script/Inventory.cs(13,27): error CS0117: Inventory' does not contain a definition for
Add’
Script :
using System.Collections;
using UnityEngine;
using System.Collections.Generic;
public class Inventory : MonoBehaviour {
public List<Item> inventory = new List<Item>();
private Item_Database database;
// Use this for initialization
void Start () {
database = GameObject.FindGameObjectsWithTag("Item Database");GetComponent<Item_Database>();
inventory.Add(database.items[0]);
Inventory.Add(database.items[1]);
}
// Update is called once per frame
void Update () {
}
void OnGUI () {
for(int i = 0;i < inventory.Count; i++){
GUI.Label(new Rect(10,10,200,50),inventory*.ItemName);*
-
}*
- }*
}