Exemplo n.º 1
0
        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");
        }
Exemplo n.º 2
0
        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);
        }
Exemplo n.º 3
0
        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);
        }
Exemplo n.º 4
0
 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);
 }
Exemplo n.º 5
0
        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);
        }