// Switch to game play after countdown finished public void CountdownFinished() { GameController gc = GameObjectFinder.FindGameController(); gc.LoadedFromFile = LoadedFromFile; if (PhotonNetwork.isMasterClient) { PhotonNetwork.LoadLevel("scenes/gameplay"); } }
// Update number of kills and handle game state if game ends public void Killed() { NumKilled++; GameController gc = GameObjectFinder.FindGameController(); if (GameController.CheckIfGameEnds()) { UpdateProfile(true); gc.DisplayGameOverMessage(); } }
private void OnDeath() { if (IsDead) { return; } IsDead = true; NumDeath++; GameController gc = GameObjectFinder.FindGameController(); // Update the profile is game ends (handle being killed by lava) if (GameController.CheckIfGameEnds()) { UpdateProfile(false); gc.DisplayGameOverMessage(); } // Disable UI and focus camera on another player alive if (photonView.isMine) { DisableAndObserveOtherPlayer(); } }