示例#1
0
    private void Update()
    {
        if (juice > 0f && !juiced && !chillBro)
        {
            if (Input.GetButtonDown("Attack"))
            {
                hand.Attack();
            }
        }

        if (juice < juiceMax)
        {
            if (juice <= 0f)
            {
                if (!juiced)
                {
                    juiced = true;

                    juice = 0f;

                    animator.SetBool("Dead", true);

                    hand.Die();
                }
            }
            else
            {
                if (Time.time > currentJuiceTime)
                {
                    juice += juiceRegen * Time.deltaTime;
                }
            }
        }
        else if (juice > juiceMax)
        {
            juice = juiceMax;
        }
    }