private void OnGameOver(InGameVariables winningPlayer) { StartCoroutine(Wait(PhotonNetwork.Time + 5.0, delegate { GameController.Instance.Reset(); })); }
public void OnGameOver(InGameVariables winningPlayer) { GameRunning = false; if (Event_OnGameOver != null) { Event_OnGameOver(winningPlayer); } }
private void OnGameOver(InGameVariables winningPlayer) { if (winningPlayer == PlayerController.LocalPlayer.OwnStats) { Splash_GameOverWin(); } else { Splash_GameOverLost(); } }
private void RpcUpdateScore(int ShellOwnerID) { InGameVariables shooter = PlayerControllers[ShellOwnerID]; OwnStats.Deaths++; shooter.Score++; _myGUI.UpdateScore(); if (shooter.Score == GameController.Instance.KillsRequired) { GameController.Instance.OnGameOver(shooter); } else { Die(PlayerControllers[ShellOwnerID].PlayerName); } }
public Transform GetSpawn(InGameVariables playerVariable) { Transform closest = null; int length = _SpawnPoints.childCount; int longestDistanceOfPlayerClosestToSpawn = int.MinValue; for (int i = 0; i < length; i++) { Transform currentSpawn = _SpawnPoints.GetChild(i); int closestPlayer = int.MaxValue; foreach (var player in PlayerController.PlayerControllers) { if (player == playerVariable) { continue; } Transform playerPosition = player.Controller.Position(); if (playerPosition != null) { int distance = (int)Vector3.Distance(playerPosition.position, currentSpawn.position); if (distance < closestPlayer) { closestPlayer = distance; } } } if (closestPlayer > longestDistanceOfPlayerClosestToSpawn) { longestDistanceOfPlayerClosestToSpawn = closestPlayer; closest = currentSpawn; } } return(closest); }
private void OnGameOver(InGameVariables winningPlayer) { InGameVariables self = PlayerController.LocalPlayer.OwnStats; UpdateUserStats(self == winningPlayer, self.Score, self.Deaths); }