private void Awake() { this._inventory = this.transform.root.GetComponent <CInventory>(); if (this._inventory == null) { Debug.LogError($"ViewItemOption Could not find its root inventory."); } }
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(); }