Example #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("Для сотворения чего-то  не хватает");
        }
    }
Example #2
0
    void Start()
    {
        //Cursor = GameObject.Find("Cursor");
        Inventory     = GameObject.Find("InventoryManager").GetComponent <Inventory_scr>();
        InventoryFull = Inventory.isFull;
        //ChangeInHand(CurrInvSlot);
        PlayerSprite = this.gameObject.GetComponent <SpriteRenderer>();

        audioController = this.gameObject.GetComponent <AudioManager>();
    }
Example #3
0
 void Start()
 {
     Inventory = GameObject.Find("InventoryManager").GetComponent <Inventory_scr>();
 }
Example #4
0
 void Start()
 {
     InventoryComponent = Inventory.GetComponent <Inventory_scr>();
     //Inventory = GameObject.Find("Inventory");
 }