void OnEnable() { animator.speed = 0; refocusSelected.SetActive(false); MetaState.end_game = false; AppMain.screenShake(0, 0); Choom.StopAllEffects(); Choom.Pause(); if (MetaState.wave_number + 1 > DataStorage.StartOnWave) { DataStorage.StartOnWave = MetaState.wave_number + 1; } Objectives.BossDefeated(); Objectives.SurvivedFinalStage(); Platform.SaveEndWave(); Objectives.CheckAchievements(); objectives.UpdateText(); menu.Fade(0.9f, 0.5f, () => { objectives.Play(HashIDs.menu.Intro); animator.speed = 1; }); }
public void SetButton(OnClickItem item) { menu.SetActiveContextButtons(false, false); switch (item.item) { case MenuItem.Resume: { transitionID = MenuState.None; } break; case MenuItem.MainMenu: { transitionID = MenuState.Title; } break; case MenuItem.Audio: { transitionID = MenuState.Audio; } break; } switch (item.item) { case MenuItem.Audio: { menu.SetActiveDayName(false, true); Choom.Pause(false); } break; case MenuItem.MainMenu: { AppMain.HasWon = false; AppMain.DisplayAnchor = false; MetaState.hardcore_mode = false; AppMain.tutorial.SetLesson(Lesson.NONE); AppMain.tutorial.SetDisplay(false); AppMain.MatchBonus.DismissAnimations(); Choom.StopAllEffects(); Choom.Pause(false); AppMain.top_state.child_state.Dispose(); AppMain.top_state.child_state = null; Game.instance = null; if (AppMain.IsPaused) { Tracker.LevelQuit(MetaState.wave_number); } else { Tracker.EndMode(MetaState.hardcore_mode, AppMain.MainMenu.DayName(MetaState.wave_number), MetaState.hardcore_mode ? MetaState.hardcore_score : DataStorage.Money); } menu.SetActiveDayName(false, true); AppMain.IsPaused = false; } break; } CancelPressed(); }
void OnEnable() { Tracker.ScreenVisit(AppMain.HasWon ? SCREEN_NAME.WAVE_COMPLETE : SCREEN_NAME.WAVE_FAILED); AppMain.screenShake(0, 0); Choom.StopAllEffects(); Choom.Pause(); if (AppMain.HasWon) { if (MetaState.wave_number % 3 == 2) { Objectives.BossDefeated(); } if (MetaState.wave_number + 1 > DataStorage.StartOnWave && !MetaState.hardcore_mode) { DataStorage.StartOnWave = MetaState.wave_number + 1; } } else { DataStorage.TimesDefeated++; if (MetaState.hardcore_mode) { Game.instance.saveHardcoreScore(); Platform.SaveHardcore(); } } Platform.SaveEndWave(); Objectives.CheckAchievements(); titles[0].SetActive(AppMain.HasWon); titles[1].SetActive(!AppMain.HasWon); for (int i = 0; i < buttons.Length; ++i) { buttons[i].SetActive(true); } refocusSelected = buttons[0].gameObject; menu.builder.Length = 0; if (MetaState.hardcore_mode && AppMain.HasWon) { menu.builder.AppendFormat("Hardcore mode score so far: {0}", MoneyGuy.me.printed_score); buttons[0].SetActive(true); buttons[1].SetActive(false); buttons[2].SetActive(true); } else if (MetaState.hardcore_mode && !AppMain.HasWon) { menu.builder.AppendFormat("Final hardcore mode score: {0}", MoneyGuy.me.printed_score); refocusSelected = buttons[2].gameObject; buttons[0].SetActive(false); buttons[1].SetActive(false); buttons[2].SetActive(true); } else if (AppMain.HasWon && MetaState.wave_number < GText.Story.story.Length) { menu.builder.Append(GText.Story.story[MetaState.wave_number]); } else { menu.builder.Append(GText.Story.tips[Random.Range(0, GText.Story.tips.Length)]); } waveResponse.item = AppMain.HasWon ? MenuItem.NextWave : MenuItem.RetryWave; waveResponse.GetComponent <TextMeshProUGUI>().text = AppMain.HasWon ? "Next Wave" : "Retry Wave"; topLeftText.text = menu.builder.ToString(); menu.SetActiveDayName(false); menu.Fade(0.9f, 1); }