void Update() { if (Input.GetKeyDown("space")) { currentGameState = GamesState.inTheGame; } }
public void SetScreen(GamesState GameState) { CurrentState = GameState; if (CurrentState == GamesState.Gameplay) { StartGame(); } }
private void DoReset() { positionsSelected = new List <int>(); timer = 0; countDeadPlayers = 0; currentGameState = GamesState.RUNNING; InitializeAgents(); }
public void StartWatcher() { lock (_gameStateLock) { if (GamesState != GamesState.Running) { _timer = new Timer(UpdateAtBats, null, _updateInterval, _updateInterval); GamesState = GamesState.Running; BroadcastGamesStateChange(GamesState.Running); } } }
public void PauseWatcher() { lock (_gameStateLock) { if (GamesState == GamesState.Running) { if (_timer != null) _timer.Dispose(); GamesState = GamesState.Paused; BroadcastGamesStateChange(GamesState.Paused); } } }
public void PauseWatcher() { lock (_gameStateLock) { if (GamesState == GamesState.Running) { if (_timer != null) { _timer.Dispose(); } GamesState = GamesState.Paused; BroadcastGamesStateChange(GamesState.Paused); } } }
private void BroadcastGamesStateChange(GamesState state) { switch (state) { case GamesState.Paused: Clients.All.gamesPaused(); break; case GamesState.Running: Clients.All.gamesRunning(); break; default: break; } }
void ChangeGameState(GamesState newGamesState) { switch (newGamesState) { case GamesState.nemu: //la esene debera mostrar el menu principal break; case GamesState.inTheGame: //debe configurarse para mostrar el juego break; case GamesState.gameOver: //la esena debe mostar la pantalla de fin de partida break; default: break; } }
void Start() { currentGameState = GamesState.nemu; }
private void ResetEnviroment() { currentGameState = GamesState.RESETTING; timer = 0; }