Example #1
0
    void OnCollisionEnter(Collision collision)
    {
        if (collision.collider.tag == "Ground")
        {
            ps.isGrounded = true;
            playerAnimator.SetBool("isJumping", false);
        }

        if (collision.collider.tag == "Enemy")
        {
            playerAnimator.SetTrigger("isHurt");
            ps.getHit(10.0f);
            gui.ChangeLife(ps.getHp());
        }
    }