Beispiel #1
0
 //for disable all menu screens
 void DeActive()
 {
     MainMenuParent.SetActive(false);
     LoadingMenuParent.SetActive(false);
     PlayerSelectionParent.SetActive(false);
     ControlselectionMenuParent.SetActive(false);
     CredtsMenuParent.SetActive(false);
     ByPopupMenuParent.SetActive(false);
     UnSufficentCoinsMenuParent.SetActive(false);
     LevelSelectionMenuParent.SetActive(false);
     StoreMenuParent.SetActive(false);
     InnAppMenuParent.SetActive(false);
     UnsufficentCoinsForPlayerselectionMenu.SetActive(false);
 }
 //for disable all screens
 void DeActive()
 {
     PlayerGroup.SetActive(false);
     MainMenuParent.SetActive(false);
     //LoadingMenuParent.SetActive (false);
     PlayerSelectionParent.SetActive(false);
     //ControlselectionMenuParent.SetActive (false);
     //CredtsMenuParent.SetActive (false);
     ByPopupMenuParent.SetActive(false);
     UnSufficentCoinsMenuParent.SetActive(false);
     //LevelSelectionMenuParent.SetActive (false);
     //StoreMenuParent.SetActive (false);
     //InnAppMenuParent.SetActive (false);
     UnsufficentCoinsForPlayerselectionMenu.SetActive(false);
 }
    void Update()
    {
        //for menu escapes control
        switch (currentScreen)
        {
        // for game close
        case MenuScreens.mainmenu:
            if (Input.GetKeyDown(KeyCode.Escape))
            {
                Application.Quit();                                                 //for game close
            }
            break;

        //for main menu
        case MenuScreens.playerSelectionMenu:
            if (Input.GetKeyDown(KeyCode.Escape))
            {
                DeActive();                                                 //for disable all screens
                MainMenuParent.SetActive(true);                             //for main menu screen screen active
            }
            break;

        //for main menu
//				case MenuScreens.CredtsMenu:
//						if (Input.GetKeyDown (KeyCode.Escape)) {
//								DeActive ();//for disable all screens
//								MainMenuParent.SetActive (true);//for main menu screen active
//						}
//						break;
        //for player selection
        case MenuScreens.ByPopupMenu:
            if (Input.GetKeyDown(KeyCode.Escape))
            {
                DeActive();                                                 //for disable all screens
                PlayerSelectionParent.SetActive(true);                      //for playerselection screen active
                PlayerGroup.SetActive(true);                                //for player active
            }
            break;

        //for main menu
        case MenuScreens.UnSufficentCoinsMenu:
            if (Input.GetKeyDown(KeyCode.Escape))
            {
                DeActive();                                                 //for disable all screens
                MainMenuParent.SetActive(true);                             //for main menu screen active
            }
            break;

        case MenuScreens.Loadindmenu:
            DeActive();                                     //for disable all screens
            //LoadingMenuParent.SetActive (true);//loading menu screen active

            break;
            //for main menu
//				case MenuScreens.StoreMenu:
//						if (Input.GetKeyDown (KeyCode.Escape)) {
//								DeActive ();//for disable all screens
//								MainMenuParent.SetActive (true);//for main menu screen active
//
//						}
//						break;
            //for main menu
//				case MenuScreens.InnAppmenu:
//						if (Input.GetKeyDown (KeyCode.Escape)) {
//								DeActive ();//for disable all screens
//								MainMenuParent.SetActive (true);//for main menu screen  active
//
//						}
//						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;
        }
    }