コード例 #1
0
    public void IteractWithSlot()
    {
        Cursor_scr Cursor = GameObject.Find("Cursor").GetComponent <Cursor_scr>();

        if (CanCraft)
        {
            GameObject Inventory = GameObject.Find("InventoryManager");
            if (!Cursor.HandContainerFull)
            {
                //Debug.Log(CraftItem);
                Cursor.CursorContainerActivation(CraftItem, CraftItemCount);


                if (InventoryComponent == null)
                {
                    InventoryComponent = Inventory.GetComponent <Inventory_scr>();
                }
                InventoryComponent.TakeItem(CraftItemComponent);
            }
            else if (Cursor.HandContainer == CraftItemComponent.id)
            {
                Cursor.CursorContainerActivation(CraftItemCount);
                InventoryComponent.TakeItem(CraftItemComponent);
            }
            InventoryComponent.CraftSlotsCheker();
        }
        else
        {
            GameObject.Find("NewDropPanel").GetComponent <LeftUpShowPanel_scr>().CheckRecepy(CraftItem);
            Debug.Log("Для сотворения чего-то  не хватает");
        }
    }
コード例 #2
0
 public void IteractWithSlot()
 {
     if (InventoryComponent.Backpack.activeSelf)
     {
         if (CursorComponent.HandContainerFull)
         {
             InventoryComponent.PutItem(SlotNumber);
         }
         else
         {
             InventoryComponent.TakeItem(SlotNumber);
         }
     }
     else
     {
         InventoryComponent.ActivateSlot(SlotNumber);
     }
 }