Example #1
0
    // Update is called once per frame
    void Update()
    {
        if (!recycleTrash)
        {
            DealWithTrash(objectChecker.CheckItem());
        }
        else
        {
            AvoidTrash(objectChecker.CheckItem());
            TrashAnimation();
        }

        MachineAnimation();
    }
    void Update()
    {
        CheckIfDead();

        if (!dead)
        {
            horizontal = Input.GetAxis("Horizontal");
            vertical   = Input.GetAxis("Vertical");
            Movement   = new Vector3(horizontal, 0f, vertical);

            if (Input.GetButtonDown("Action"))
            {
                if (!holdingItem)
                {
                    GrabItem(objectChecker.CheckItem());
                }
                else
                {
                    ThrowItem();
                }
            }

            MovementAnimation();
            HoldingAnimation();
        }
    }