예제 #1
0
    public void Damage()
    {
        playerStateScript.SetIsHit(true);
        soundPlayer.PlayClip(hitSound, 0.6f);
        movingScript.enabled   = false;       // disables movement, dashing, throwing
        throwingScript.enabled = false;
        animator.SetTrigger("is_hit");        // sets animator trigger so that suffocation animation is played

        //throw the pearl in the direction of enemy dash
        throwingScript.ThrowPearl(playerStateScript.GetAimingAngle(), dropPearlForce);

        //become able to move again
        Invoke("RestartState", 1.5f);

        //player flashes red
        //playerHit.GetComponent<Animation>().Play("Player_RedFlash");
    }