public void CheckGameDynamic() { if (!_battleDynamic) { _soundManager.CrossfaidSound(Enumerators.SoundType.BATTLEGROUND, null, true); } _battleDynamic = true; }
public void BackButtonOnClickHandler() { Action[] actions = new Action[2]; actions[0] = () => { _uiManager.HidePopup <YourTurnPopup>(); _gameplayManager.EndGame(Enumerators.EndGameType.CANCEL); GameClient.Get <IMatchManager>().FinishMatch(Enumerators.AppState.MAIN_MENU); _soundManager.StopPlaying(Enumerators.SoundType.TUTORIAL); _soundManager.CrossfaidSound(Enumerators.SoundType.BACKGROUND, null, true); }; actions[1] = () => { }; _uiManager.DrawPopup <ConfirmationPopup>(actions); _soundManager.PlaySound(Enumerators.SoundType.CLICK, Constants.SfxSoundVolume, false, false, true); }
public void EndGame(Enumerators.EndGameType endGameType, float timer = 4f) { if (IsGameEnded) { return; } IsGameEnded = true; _soundManager.PlaySound(Enumerators.SoundType.BACKGROUND, 128, Constants.BackgroundSoundVolume, null, true); if (endGameType != Enumerators.EndGameType.CANCEL) { _timerManager.AddTimer( x => { if (endGameType == Enumerators.EndGameType.WIN) { _uiManager.DrawPopup <YouWonPopup>(); } else if (endGameType == Enumerators.EndGameType.LOSE) { _uiManager.DrawPopup <YouLosePopup>(); } }, null, timer); } _soundManager.CrossfaidSound(Enumerators.SoundType.BACKGROUND, null, true); StopGameplay(); CurrentTurnPlayer = null; CurrentPlayer = null; OpponentPlayer = null; GameEnded?.Invoke(endGameType); }