예제 #1
0
    private void OnCollisionEnter2D(Collision2D collision)
    {
        string tag = collision.gameObject.tag;

        if (tag == "Ground")
        {
            isGrounded = true;
            numJumps   = maxJumps;
        }
        if (tag == "Live Wire")
        {
            PlayerHealthScript health = GetComponent <PlayerHealthScript>();
            health.Damage(health.maxHP);
        }
    }