Example #1
0
    public void OnButtonClick(string ButtonName)
    {
        switch (ButtonName)
        {
        case "AccelarationMode":
            SoundController.Static.PlayClickSound();
            LoadingMenuParent.SetActive(true);
            ControlSelectionParent.SetActive(false);
            TotalCoinsParent.SetActive(false);
            break;

        case "ButtonMode":
            SoundController.Static.PlayClickSound();
            LoadingMenuParent.SetActive(true);
            ControlSelectionParent.SetActive(false);
            TotalCoinsParent.SetActive(false);
            break;

        case "Back":
            SoundController.Static.PlayClickSound();
            ControlSelectionParent.SetActive(false);
            LevelSelectionParent.SetActive(true);
            break;
        }
    }
Example #2
0
    //void DoPlayStart()
    //{
    //    GameController.Static.currentGameState = GameController.GameState.gameplay;
    //    MainMenuParent.SetActive(false);
    //    InGameUi.SetActive(true);
    //    CameraFade.current.FadeIn(null, 1f, 0f);
    //}

    public void OnButtonClick(string ButtonName)
    {
        switch (ButtonName)
        {
        case "Play":             // start intro animation, enable ingameUI
            CameraFade.current.FadeOut(CameraFade.current.FadeInTest, 0.3f, 0f);
            GameController.Static.OnGameStart();
            SoundController.Static.playSoundFromName("Click");
            MainMenuParent.SetActive(false);
            InGameUi.SetActive(true);
            TotalCoinsParent.SetActive(false);
            break;

        case "PlayerSelect":
            CameraFade.current.FadeOut(CameraFade.current.FadeInTest, 0.3f, 0f);
            Invoke("OpenPlayerSelection", 0.2f);
            break;

        case "Credits":
            SoundController.Static.playSoundFromName("Click");
            MainMenuParent.SetActive(false);
            CreditsMenuParent.SetActive(true);
            TotalCoinsParent.SetActive(false);
            currentScreen = MenuScreens.CredtsMenu;
            break;

        case "Exit":
            SoundController.Static.playSoundFromName("Click");
            ExitParent.SetActive(true);
            MainMenuParent.SetActive(false);
            TotalCoinsParent.SetActive(false);
            Application.Quit();
            break;

        case "Store":
            CameraFade.current.FadeOut(CameraFade.current.FadeInTest, 0.3f, 0f);
            Invoke("OpenUpgradesMenu", 0.2f);
            break;

        case "Missions":
            //CameraFade.current.FadeOut(CameraFade.current.FadeInTest, 0.3f, 0f);
            Invoke("OpenMissionsMenu", 0.2f);
            break;

        case "Settings":
            //CameraFade.current.FadeOut(CameraFade.current.FadeInTest, 0.3f, 0f);
            Invoke("OpenSettingsMenu", 0.2f);
            break;

        case "PauseMenu":
            //CameraFade.current.FadeOut(CameraFade.current.FadeInTest, 0.3f, 0f);
            SettingsMenuParent.SetActive(true);
            MainMenuParent.SetActive(false);
            TotalCoinsParent.SetActive(false);
            SoundController.Static.playSoundFromName("Click");
            currentScreen = MenuScreens.PauseMenu;
            break;
        }
    }
Example #3
0
 void OpenSettingsMenu()
 {
     SettingsMenuParent.SetActive(true);
     MainMenuParent.SetActive(false);
     TotalCoinsParent.SetActive(false);
     SoundController.Static.playSoundFromName("Click");
     currentScreen = MenuScreens.SettingsMenu;
 }
Example #4
0
 void OpenPlayerSelection()
 {
     MainMenuParent.SetActive(false);
     PlayerSelectionWithCamera.SetActive(true);
     PlayerSelectionmenuParent.SetActive(true);
     TotalCoinsParent.SetActive(true);
     SoundController.Static.playSoundFromName("Click");
     currentScreen = MenuScreens.playerSelectionMenu;
 }
Example #5
0
 void OpenUpgradesMenu()
 {
     PlayerSelectionmenuParent.SetActive(false);
     UpgradesMenuParent.SetActive(true);
     MainMenuParent.SetActive(false);
     TotalCoinsParent.SetActive(true);
     SoundController.Static.playSoundFromName("Click");
     currentScreen = MenuScreens.StoreMenu;
 }
Example #6
0
    void Update()
    {
        if (GameController.Static.currentGameState == GameController.GameState.gameplay)
        {
            return;
        }

        switch (currentScreen)
        {
        case MenuScreens.mainmenu:
            TotalCoinsParent.SetActive(false);

            if (Input.GetKeyDown(KeyCode.Escape))
            {
                //DeActive();
                ExitParent.SetActive(true);
            }
            break;

        case MenuScreens.playerSelectionMenu:
            if (Input.GetKeyDown(KeyCode.Escape))
            {
                DeActive();
                //FindObjectOfType<PlayerController>().InstantiateSelectedPlayer(); why doesnt this work after purchasing a player??? fuuuck
                MainMenuParent.SetActive(true);
            }
            break;

        case MenuScreens.ControlselectionMenu:
            if (Input.GetKeyDown(KeyCode.Escape))
            {
                DeActive();
                LevelSelectionMenuParent.SetActive(true);
                currentScreen = MenuScreens.LevelSelectionMenu;
                //TotalCoinsParent.SetActive(true);
            }
            break;

        case MenuScreens.CredtsMenu:
            if (Input.GetKeyDown(KeyCode.Escape))
            {
                DeActive();
                MainMenuParent.SetActive(true);
            }
            break;

        case MenuScreens.ByPopupMenu:
            if (Input.GetKeyDown(KeyCode.Escape))
            {
                DeActive();
                PlayerSelectionmenuParent.SetActive(true);
            }
            break;

        case MenuScreens.UnSufficentCoinsMenu:
            if (Input.GetKeyDown(KeyCode.Escape))
            {
                DeActive();
                MainMenuParent.SetActive(true);
            }
            break;

        case MenuScreens.LevelSelectionMenu:
            if (Input.GetKeyDown(KeyCode.Escape))
            {
                DeActive();
                PlayerSelectionmenuParent.SetActive(true);
                currentScreen = MenuScreens.playerSelectionMenu;
            }
            break;

        case MenuScreens.StoreMenu:
            if (Input.GetKeyDown(KeyCode.Escape))
            {
                DeActive();
                MainMenuParent.SetActive(true);
            }
            break;

        case MenuScreens.InnAppmenu:
            if (Input.GetKeyDown(KeyCode.Escape))
            {
                DeActive();
                MainMenuParent.SetActive(true);
            }
            break;

        case MenuScreens.Missions:
            if (Input.GetKeyDown(KeyCode.Escape))
            {
                DeActive();
                MainMenuParent.SetActive(true);
            }
            break;
        }
    }
    void Update()
    {
        if (GameController.Static.currentGameState == GameController.GameState.gameplay)
        {
            return;
        }
        Debug.Log("HUEHUEHUE");
        switch (currentScreen)
        {
        case MenuScreens.mainmenu:
            Debug.Log("main menu enumerator");
            if (Input.GetKeyDown(KeyCode.Escape))
            {
                DeActive();
            }
            break;

        case MenuScreens.playerSelectionMenu:
            if (Input.GetKeyDown(KeyCode.Escape))
            {
                DeActive();
                MainMenuParent.SetActive(true);
            }
            break;

        case MenuScreens.ControlselectionMenu:
            if (Input.GetKeyDown(KeyCode.Escape))
            {
                DeActive();
                LevelSelectionMenuParent.SetActive(true);
                currentScreen = MenuScreens.LevelSelectionMenu;
                TotalCoinsParent.SetActive(true);
            }
            break;

        case MenuScreens.CredtsMenu:
            if (Input.GetKeyDown(KeyCode.Escape))
            {
                DeActive();
                MainMenuParent.SetActive(true);
            }
            break;

        case MenuScreens.ByPopupMenu:
            if (Input.GetKeyDown(KeyCode.Escape))
            {
                DeActive();
                PlayerSelectionParent.SetActive(true);
            }
            break;

        case MenuScreens.UnSufficentCoinsMenu:
            if (Input.GetKeyDown(KeyCode.Escape))
            {
                DeActive();
                MainMenuParent.SetActive(true);
            }
            break;

        case MenuScreens.LevelSelectionMenu:
            if (Input.GetKeyDown(KeyCode.Escape))
            {
                DeActive();
                PlayerSelectionParent.SetActive(true);
                currentScreen = MenuScreens.playerSelectionMenu;
            }
            break;

        case MenuScreens.StoreMenu:
            if (Input.GetKeyDown(KeyCode.Escape))
            {
                DeActive();
                MainMenuParent.SetActive(true);
            }
            break;

        case MenuScreens.InnAppmenu:
            if (Input.GetKeyDown(KeyCode.Escape))
            {
                DeActive();
                MainMenuParent.SetActive(true);
            }
            break;

        case MenuScreens.Missions:
            if (Input.GetKeyDown(KeyCode.Escape))
            {
                DeActive();
                MainMenuParent.SetActive(true);
            }
            break;
        }
    }