void OnTriggerEnter2D(Collider2D other) { if (other.gameObject.tag == "Player") { PlayerPrefs.SetString("lastLoadedScene", SceneManager.GetActiveScene().name); DeathScript.DestroyPlayer(); onExit.Invoke(); } }
void OnTriggerEnter2D(Collider2D other) { if (other.gameObject.tag == "Player") { PlayerPrefs.SetString("lastLoadedScene", SceneManager.GetActiveScene().name); DeathScript.DestroyPlayer(); GetComponent <Animator>().SetTrigger("Jump"); Camera.main.GetComponent <CameraFollowScript>().follow = gameObject; } }
public void checkWin() { if (!DeathScript.player) { return; } if (enemyNB > 0) { return; } MenuManagerScript.mm.setMissionCompleteMenu(true); DeathScript.playSound(winSound); DeathScript.DestroyPlayer(); enemyNB = -1; }