예제 #1
0
    /// <summary>
    /// Start functions for blocking and punching
    /// </summary>
    public void StartPunch()
    {
        if (dead || GameObject.Find("Manager").GetComponent <Manager>().gameOver)
        {
            transform.LookAt(new Vector3(5, transform.position.y, 5));
            return;
        }
        if (animationTime > 0 || recoverTime > 0)
        {
            return;
        }
        punching = true;

        //Reset the timers
        animationTime = animationReset;
        recoverTime   = recoverReset;

        GetComponent <Rigidbody>().velocity = transform.forward * punchForce;
        animator.SetInteger("State", 1);

        PAM.PlayDash();
    }