示例#1
0
 private void Awake()
 {
     this._inventory = this.transform.root.GetComponent <CInventory>();
     if (this._inventory == null)
     {
         Debug.LogError($"ViewItemOption Could not find its root inventory.");
     }
 }
示例#2
0
        public void CreateInventoryViewItens(CInventory inventory)
        {
            this._inventory = inventory;

            this._inventoryViewItemList.Clear();
            // create new child game objects
            for (int i = 0; i < this._inventory.Size; i++)
            {
                this._inventoryViewItemList.Add(Instantiate(this._prefabInventoryViewItem.gameObject, this._itemsGridParent).GetComponent <CInventoryViewItem>());
            }
            this.UpdateInventoryView();
        }