コード例 #1
0
 public void UpdateItemCount(Item item)
 {
     if (item is IUseable && MyUseables.Count > 0)
     {
         if (MyUseables.Peek().GetType() == item.GetType())
         {
             MyUseables = InventoryScript.MyInstance.GetUseables(item as IUseable);
             count      = MyUseables.Count;
             UIManager.MyInstance.UpdateStackSize(this);
         }
     }
 }
コード例 #2
0
 public void OnClick()
 {
     if (Hand.MyInstance.MyMoveable == null)
     {
         if (MyUseable != null)
         {
             MyUseable.Use();
         }
         else if (MyUseables != null && MyUseables.Count > 0)
         {
             MyUseables.Peek().Use();
         }
     }
 }
コード例 #3
0
    public void SetUseable(IUseable useable)
    {
        if (useable is Item)
        {
            MyUseables = InventoryScript.MyInstance.GetUseables(useable);
            if (InventoryScript.MyInstance.FromSlot != null)
            {
                InventoryScript.MyInstance.FromSlot.MyIcon.color = Color.white;
                InventoryScript.MyInstance.FromSlot = null;
            }
        }
        else
        {
            MyUseables.Clear();
            this.MyUseable = useable;
        }

        count = MyUseables.Count;
        UpdateVisual(useable as IMoveable);
    }