Пример #1
0
    private void Update()
    {
        if (pickedItem != null)
        {
            Debug.Log(pickedItem.name);
        }
        timePassed += Time.deltaTime;

        if (isPicked == false && playerInput.AButton() && timePassed >= keyDelay)
        {
            ItemPick();
        }

        if (isPicked == true && playerInput.AButton() && timePassed >= keyDelay)
        {
            ItemDrop();
            isPicked = false;
        }

        if (isPicked == true && playerInput.BButton() && timePassed >= keyDelay)
        {
            ItemThrow();
        }

        if (isPicked == true && playerInput.XButton() && timePassed >= keyDelay)
        {
            if (pickedItem != null)
            {
                if (pickedItem.tag == "Placable Item")
                {
                    ItemPlace();
                }
                else if (pickedItem.name == "Fire_axe(Clone)")
                {
                    UseAxe();
                }
                else if (pickedItem.name == "Crowbar")
                {
                    UseCrowbar();
                }
            }
        }

        Weight();
    }