Exemplo n.º 1
0
 public virtual void OnSlotChange()
 {
     Debug.Log("OnSlotChanged");
     if (!SlotData.Occupant())
     {
         ItemReference = null;
         return;
     }
     GameManager.ItemDictionary.TryGetValue(SlotData.OccupantItemData.ItemId, out var itemObject);
     if (itemObject == null)
     {
         return;
     }
     ItemReference = itemObject.GetComponent <Item>();
 }
Exemplo n.º 2
0
 public Slot(Transform slotTransform, ItemSlotData slotData, int slotIndex)
 {
     SlotTransform = slotTransform;
     SlotData      = slotData;
     SlotIndex     = slotIndex;
     if (!SlotData.Occupant())
     {
         return;
     }
     GameManager.ItemDictionary.TryGetValue(SlotData.OccupantItemData.ItemId, out var itemObject);
     if (itemObject == null)
     {
         return;
     }
     ItemReference = itemObject.GetComponent <Item>();
 }