Beispiel #1
0
    public void InitializeLayout()
    {
        if (this._displayedInventory == null)
        {
            return;
        }

        this.Clear(ClearMode.Full);

        for (int i = 0; i < this._displayedInventory._Capacity; i++)
        {
            InventoryItemSlotView itemSlotView = i < this._itemSlotViews.Count ? this._itemSlotViews[i] : null;

            if (itemSlotView == null)
            {
                itemSlotView            = Object.Instantiate(this._itemSlotViewPrefab, this._itemSlotViewsContainer);
                itemSlotView.ParentView = this;

                this._itemSlotViews.Add(itemSlotView);
                this._itemSlotViews[i] = itemSlotView;

                this._displayedInventory.AddItemDisplay(itemSlotView, i);
            }

            itemSlotView.Open();
        }
    }
Beispiel #2
0
    private void OnEnable()
    {
#pragma warning disable 0219
        this.sInventoryItemSlotView = this.target as InventoryItemSlotView;
#pragma warning restore 0219
    }
Beispiel #3
0
 public void AddItemDisplay(InventoryItemSlotView inventoryItemDisplayController, int index)
 {
     inventoryItemDisplayController.Clear(InventoryView.ClearMode.Partial);
     this._itemSlots[index].InventoryItemDisplayController__ = inventoryItemDisplayController;
 }
    public void Display(InventoryItemSharedData inventoryItemSharedData, InventoryItemSlotView inventoryItemSlotView)
    {
        this._descriptionTextField.text = inventoryItemSharedData._Description;

        this.rectTransform.anchoredPosition = inventoryItemSlotView._RectTransform.anchoredPosition + this._offset;
    }