Esempio n. 1
0
        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();
        }
Esempio n. 2
0
        public void SetButton(OnClickItem item)
        {
            menu.SetActiveContextButtons(false, false);

            switch (item.item)
            {
            case MenuItem.MainMenu: { transitionID = MenuState.Title; } break;

            case MenuItem.Store: { transitionID = MenuState.Store; } break;
            }

            switch (item.item)
            {
            case MenuItem.MainMenu:
            case MenuItem.Store: {
                AppMain.HasWon          = false;
                AppMain.DisplayAnchor   = false;
                MetaState.hardcore_mode = false;

                AppMain.tutorial.SetLesson(Lesson.NONE);
                AppMain.tutorial.SetDisplay(false);

                AppMain.top_state.child_state.Dispose();
                AppMain.top_state.child_state = null;
                Game.instance = null;

                Tracker.EndMode(MetaState.hardcore_mode, AppMain.MainMenu.DayName(MetaState.wave_number),
                                MetaState.hardcore_mode ? MetaState.hardcore_score : DataStorage.Money);

                menu.SetActiveDayName(false, true);
            } break;

            case MenuItem.RetryWave:
            case MenuItem.NextWave: {
                MetaState.resetWave(AppMain.HasWon);
                AppMain.HasWon = false;

                AppMain.top_state.Dispose();
                AppMain.top_state = new Game();
            } break;
            }

            objectives.Play(HashIDs.menu.Outtro);
            Play(HashIDs.menu.Outtro);
            menu.Fade(0, 0.3f);
        }
Esempio n. 3
0
 public void ChangeItem(OnClickItem item)
 {
     Debug.Log(item.item.ToString());
 }