コード例 #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>();
 }
コード例 #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>();
 }