private void OnCollisionEnter2D(Collision2D collision) { SteakMove steak = collision.collider.GetComponent <SteakMove>(); EnemyFollowPlayer steak2 = collision.gameObject.GetComponent <EnemyFollowPlayer>(); if (steak != null || steak2 != null) { Hurt(); } if (collision.gameObject.tag == "Ground") { isJumping = false; } }
private void OnCollisionEnter2D(Collision2D collision) { SteakMove steak = collision.collider.GetComponent <SteakMove>(); EnemyFollowPlayer pumpkin = collision.gameObject.GetComponent <EnemyFollowPlayer>(); MushroomBehavior mushroom = collision.gameObject.GetComponent <MushroomBehavior>(); if (steak != null || pumpkin != null || mushroom != null) { Hurt(); } if (collision.gameObject.tag == "Ground") { isJumping = false; } }