public IEnumerator RunMissionComplete(string eventId, Mission m) { EventMonitor.StartEvent(eventId); m.Complete(); var earned = m.OverallResult.EarnedLoot; switch (m.OverallResult.ResultType) { case MissionResultType.Failure: case MissionResultType.Quit: break; case MissionResultType.Timeout: break; case MissionResultType.Complete: earned += m.PrizePurse; PlayerData.myWallet += earned; PlayerData.Push(); break; } ProgressPanel.ToggleMenu(); yield return(new WaitForSeconds(1f)); yield return(ProgressPanel.WalletInfo.UpdateWalletAndDisplayAsync(eventId, PlayerData.myWallet)); ProgressPanel.UpdateStages(PlayerData); ProgressPanel.MissionView.UpdateMissionButtons(PlayerData); // clean up global game variables Round = 1; EventMonitor.EndEvent(eventId); yield return(null); StopCoroutine("Game"); }
public IEnumerator RunStageClicked(string eventId, GameStage stage) { EventMonitor.StartEvent(eventId); OnHideStages.Invoke(stage.Level, stage.Stage); yield return(new WaitForSeconds(1f)); EventMonitor.EndEvent(eventId); yield return(null); }
public IEnumerator RunMissionChosen(string eventId, Mission m) { EventMonitor.StartEvent(eventId); PlayerData.myWallet -= m.Cost; yield return(ProgressPanel.WalletInfo.UpdateWalletAndDisplayAsync(eventId, PlayerData.myWallet)); yield return(new WaitForSeconds(.5f)); EventMonitor.EndEvent(eventId); yield return(null); }
private IEnumerator HandleTimeAdjustment(string eventId, RoundResultInfo roundInfo) { EventMonitor.StartEvent(eventId); if (roundInfo.TimeAdjustment != 0) { AdjustmentText.text = string.Format("{0}{1}", roundInfo.TimeAdjustment > 0 ? "+" : "-", TimeUtility.FormattedTime_MSSMM(roundInfo.TimeAdjustment)); textAnim.SetTrigger(roundInfo.TimeAdjustment > 0 ? "AddTime" : "RemoveTime"); yield return(new WaitForSeconds(.25f)); } EventMonitor.EndEvent(eventId); yield return(null); }
public IEnumerator RunCountdown(string eventId, int countdownStart) { EventMonitor.StartEvent(eventId); myGroup.alpha = 1f; myGroup.blocksRaycasts = true; float step = .1f; progress = 0f; for (float lcv = countdownStart; lcv >= 0; lcv -= step) { progress += step; var normalProgress = progress / countdownStart; ProgressImage.fillAmount = normalProgress; ProgressImage.color = ColorProgression.Evaluate(normalProgress); yield return(new WaitForSeconds(step)); } myGroup.alpha = 0f; myGroup.blocksRaycasts = false; EventMonitor.EndEvent(eventId); }