private void OnTriggerStay2D(Collider2D collision) { if (collision.tag == "player") { Player_Movement pm = collision.gameObject.GetComponent <Player_Movement>(); if (collision.name == "PlayerOne" && delay_tmp >= delay && !pm.Dashing() && !playerone_falling) { playerone_falling = true; AkSoundEngine.PostEvent("play_falling", Camera.main.gameObject); Stop_Players(); } else if (collision.name == "PlayerTwo" && delay_tmp_two >= delay && !pm.Dashing() && !playertwo_falling) { playertwo_falling = true; AkSoundEngine.PostEvent("play_falling", Camera.main.gameObject); Stop_Players(); } } }
private void OnTriggerEnter2D(Collider2D collision) { if (collision.tag == "player") { if (collision.name == "PlayerOne" && !player_one.Dashing()) { player_one.gameObject.GetComponent <God_Mode>().Hit_verification("PlayerOne", player_one.transform.position, "Laser Static"); } else if (collision.name == "PlayerTwo" && !player_two.Dashing()) { player_two.gameObject.GetComponent <God_Mode>().Hit_verification("PlayerTwo", player_two.transform.position, "Laser Static"); } } }