void checkPlayer() { playerCounter = 0; GameObject[] players = GameObject.FindGameObjectsWithTag("Player"); foreach (GameObject player in players) { playerCounter++; } if (SceneManager.GetActiveScene().name != "_Menu" && SceneManager.GetActiveScene().name != "ballMotion") { if (playerCounter == 0) { if (mode.getMode() == "Normal") { stateManger.LoadState("LoseNormal"); } else if (mode.getMode() == "Ninja") { stateManger.LoadState("LoseInsane"); } else { stateManger.LoadState("LoseScene"); } } } }
void checkPlayer() { playerCounter = 0; GameObject[] players = GameObject.FindGameObjectsWithTag("Player"); foreach (GameObject player in players) { playerCounter++; } if (SceneManager.GetActiveScene().name != "_Menu") { if (playerCounter == 0) { stateManger.LoadState("LoseScene"); } } }
void OnTriggerEnter2D(Collider2D trigger) { if (isOpen) { if (trigger.gameObject.tag == "Player") { if (mode.getMode() == "Normal") { stateManger.LoadState("WinNormal"); } else if (mode.getMode() == "Ninja") { stateManger.LoadState("WinInsane"); } else { stateManger.LoadState("WinScene"); } } } }