public void OnButtonClick(string ButtonName) { switch (ButtonName) { case "BACK": LevelSelectionParent.SetActive(false); PlayerSelectionMenu.SetActive(true); SoundController.Static.playSoundFromName("Click"); break; case "Level1": levelName = "GamePlay"; ControlSelection.SetActive(true); LevelSelectionParent.SetActive(false); MainMenu.currentScreen = MainMenu.MenuScreens.ControlselectionMenu; SoundController.Static.playSoundFromName("Click"); break; case "Level2": levelName = "cityGameplay"; ControlSelection.SetActive(true); LevelSelectionParent.SetActive(false); MainMenu.currentScreen = MainMenu.MenuScreens.ControlselectionMenu; SoundController.Static.playSoundFromName("Click"); break; case "Level3": SoundController.Static.playSoundFromName("Click"); levelName = "NightGameplay"; ControlSelection.SetActive(true); LevelSelectionParent.SetActive(false); MainMenu.currentScreen = MainMenu.MenuScreens.ControlselectionMenu; break; } }
public GuiController() { mainMenu = new MainMenu(); playerSelectionMenu = new PlayerSelectionMenu(); diceSelectionMenu = new DiceSelectionMenu(); gameEndMenu = new GameEndMenu(); }
/// <summary> /// Alls menu controls /// </summary> /// <param name="menu"></param> /// <param name="op"></param> private void MainMenu_OnMenuLeave(Menu menu, MenuOperations op) { Console.Clear(); Render(); switch (op) { case MenuOperations.GotoMainMenu: mainMenu.Show(); break; case MenuOperations.GotoPlayerSelectionMenu: if (playerSelectionMenu == null) { playerSelectionMenu = new PlayerSelectionMenu(X, Y, Width, Height); playerSelectionMenu.OnPlayersSelect += PlayerSelectionMenu_OnPlayersSelect; playerSelectionMenu.OnMenuLeave += MainMenu_OnMenuLeave; } playerSelectionMenu.Show(); break; case MenuOperations.Replay: Console.Clear(); //start game gameController.ResetGame(); gameController.StartGame(config.PlayersQ, config.DicesQ); break; case MenuOperations.GotoGameOverMenu: if (gameOverMenu == null) { gameOverMenu = new GameOverMenu(X, Y, Width, Height); gameOverMenu.OnMenuLeave += MainMenu_OnMenuLeave; } gameOverMenu.Show(); break; case MenuOperations.Quit: if (menu is PlayerSelectionMenu) { mainMenu.Show(); break; } else if (menu is DiceSelectionMenu) { playerSelectionMenu.Show(); break; } else { Console.Clear(); Environment.Exit(0); } break; default: break; } }
public MenuController() { gameWindow = new GameWindow(); PlayerSelectionMenu = new PlayerSelectionMenu(); diceSelectionMenu = new DiceSelectionMenu(); gameOverMenu = new GameOverMenu(); //GameController = new GameController(); mainMenu = new MainMenu(); }
//for button control public void OnbuttonClick(System.Object buttonname, EventArgs args) { Debug.Log(" clicked on " + buttonname.ToString()); switch (buttonname.ToString()) { //for select button case "Play": //levelName = "NinjaGameplay"; SoundController.Static.PlayClickSound(); //for click sound PlayerSelectionMenu.SetActive(true); PlayerGroup.SetActive(true); break; case "playGame": //levelName = "NinjaGameplay"; SoundController.Static.PlayClickSound(); //for click sound Application.LoadLevel(1); break; //for previous button case "Previous": SoundController.Static.PlayClickSound(); //for click sound showPreviousPlayer(); //for previos polayer information break; //for next button case "Next": SoundController.Static.PlayClickSound(); //for click sound showNextPlayer(); //for next polayer information break; //for buy button case "Buy": SoundController.Static.PlayClickSound(); //for click sound PlayerGroup.SetActive(false); //for player disable purchasePlayer(); //for player purchase information //MainMenuScreens.currentScreen = MainMenuScreens.MenuScreens.UnSufficentCoinsMenu;//for moving unsufficent menu state break; //for back button case "Back": SoundController.Static.PlayClickSound(); //for click sound PlayerSelectionMenu.SetActive(false); PlayerGroup.SetActive(false); MainMenuParent.SetActive(true); //for mainmenu enable break; } }
//for button control public void OnbuttonClick(System.Object buttonname, EventArgs args) { Debug.Log(" clicked on " + buttonname.ToString()); switch (buttonname.ToString()) { //for ok button case "Ok": SoundController.Static.PlayClickSound(); //for click sound UnsufficentCoinsForPlayerselectionMenu.SetActive(false); //for unsufficent menu Disables PlayerGroupMenu.SetActive(true); PlayerSelectionMenu.SetActive(true); //InAppMenuParent.SetActive(true);//inapp menu Enables // MainMenuScreens.currentScreen=MainMenuScreens.MenuScreens;//for moving inapp menu state break; } }
//for button control public void OnButtonClick(string ButtonName) { switch (ButtonName) { //for select button case "Select": //levelName = "NinjaGameplay"; SoundController.Static.PlayClickSound(); //for click sound PlayerSelectionMenu.SetActive(false); PlayerGroup.SetActive(false); LoadingMenuParent.SetActive(true); Invoke("LategamePlay", 3f); //for game play MainMenuScreens.currentScreen = MainMenuScreens.MenuScreens.Loadindmenu; //for moving loading menu state break; //for previous button case "Previous": SoundController.Static.PlayClickSound(); //for click sound showPreviousPlayer(); //for previos polayer information break; //for next button case "Next": SoundController.Static.PlayClickSound(); //for click sound showNextPlayer(); //for next polayer information break; //for buy button case "Buy": SoundController.Static.PlayClickSound(); //for click sound PlayerGroup.SetActive(false); //for player disable purchasePlayer(); //for player purchase information MainMenuScreens.currentScreen = MainMenuScreens.MenuScreens.UnSufficentCoinsMenu; //for moving unsufficent menu state break; //for back button case "Back": SoundController.Static.PlayClickSound(); //for click sound PlayerSelectionMenu.SetActive(false); PlayerGroup.SetActive(false); MainMenuParent.SetActive(true); //for mainmenu enable break; } }
public void OnButtonClick(string ButtonName) { switch (ButtonName) { case "Select": SoundController.Static.playSoundFromName("Click"); selectedButton.SetActive(true); // save selected player index PlayerPrefs.SetInt("SelectedPlayer", PlayerIndex); break; case "Previous": SoundController.Static.playSoundFromName("Click"); showPreviousPlayer(); break; case "Next": SoundController.Static.playSoundFromName("Click"); showNextPlayer(); break; case "Buy": SoundController.Static.playSoundFromName("Click"); PurchasePlayer(); MainMenu.currentScreen = MainMenu.MenuScreens.UnSufficentCoinsMenu; break; case "Back": SoundController.Static.playSoundFromName("Click"); PlayerSelectionWithCamera.SetActive(false); PlayerSelectionMenu.SetActive(false); MainMenuParent.SetActive(true); pc.InstantiateSelectedPlayer(); MainMenu.currentScreen = MainMenu.MenuScreens.mainmenu; break; } }
public static void PlayerMenuRender() { playerMenu = new PlayerSelectionMenu(); playerMenu.Render(); }
//for player purchase information void purchasePlayer() { switch (PlayerIndex) { //for player 2 case 1: if (TotalCoins.Static.totalCoins >= 1000) { buyPopUP.PlayerCost = 1000; //to set the cost in buyPopUpScript buyPopUp.SetActive(true); PlayerSelectionMenu.SetActive(false); } else { /// InAPPMenu.SetActive(true); // gameObject.SetActive(false); UnsufficentCoinsForPlayerselection.SetActive(true); PlayerSelectionMenu.SetActive(false); } break; //for player 3 case 2: if (TotalCoins.Static.totalCoins >= 3000) { buyPopUP.PlayerCost = 3000; buyPopUp.SetActive(true); PlayerSelectionMenu.SetActive(false); } else { // InAPPMenu.SetActive(true); //PlayerSelectionMenu.SetActive(false); UnsufficentCoinsForPlayerselection.SetActive(true); PlayerSelectionMenu.SetActive(false); } break; //for player 4 case 3: if (TotalCoins.Static.totalCoins >= 4000) { buyPopUP.PlayerCost = 4000; buyPopUp.SetActive(true); PlayerSelectionMenu.SetActive(false); } else { //InAPPMenu.SetActive(true); //PlayerSelectionMenu.SetActive(false); UnsufficentCoinsForPlayerselection.SetActive(true); PlayerSelectionMenu.SetActive(false); } break; //for player 5 case 4: if (TotalCoins.Static.totalCoins >= 5000) { buyPopUP.PlayerCost = 5000; buyPopUp.SetActive(true); PlayerSelectionMenu.SetActive(false); } else { // InAPPMenu.SetActive(true); //PlayerSelectionMenu.SetActive(false); UnsufficentCoinsForPlayerselection.SetActive(true); PlayerSelectionMenu.SetActive(false); } break; //for player 6 case 5: if (TotalCoins.Static.totalCoins >= 6000) { buyPopUP.PlayerCost = 6000; buyPopUp.SetActive(true); PlayerSelectionMenu.SetActive(false); } else { // InAPPMenu.SetActive(true); // PlayerSelectionMenu.SetActive(false); UnsufficentCoinsForPlayerselection.SetActive(true); PlayerSelectionMenu.SetActive(false); } break; } }