private void UpdateMenuElement(GameMenus menu, uint element, string baseLabel, int value, Color labelColor) { Menu _menu = MenusController.Instance[(uint)menu]; string label = baseLabel + value.ToString(); _menu.UpdateElement(element, label, labelColor); }
public void HideMenu(GameMenus menuToBeHid) { var menuToHide = menuList[(int)menuToBeHid]; if (menuToHide == null) return; menuToHide.Hide(); }
public void ShowMenu(GameMenus menuToBeShown) { var menuToShow = menuList[(int)menuToBeShown]; if (menuToShow == null) return; menuToShow.Show(); menuToShow.Reset(); }
public void MoveMenuToForeground(GameMenus menuToForeground) { var menuToBePushedToForeground = menuList[(int)menuToForeground]; if (menuToBePushedToForeground != null) { menuToBePushedToForeground.Enable(); } }
private void ResetInGameUI() { GameMenus menu = GameMenus.IN_GAME; uint element = (uint)InGameMenuElements.ROUND_COUNTER; UpdateMenuElement(menu, element, "Round ", 1, Color.white); element = (uint)InGameMenuElements.TURN_COUNTER; UpdateMenuElement(menu, element, "Turn ", 1, playersAdmin[0].Color); }
public void HideMenu(GameMenus menuToBeHid) { var menuToHide = menuList[(int)menuToBeHid]; if (menuToHide == null) { return; } menuToHide.Hide(); }
public void ShowMenu(GameMenus menuToBeShown) { var menuToShow = menuList[(int)menuToBeShown]; if (menuToShow == null) { return; } menuToShow.Show(); menuToShow.Reset(); }
// Required to define the current active scene for a reload, and required for the on start event private void OnSceneLoaded(Scene loadedScene, LoadSceneMode sceneLoadMode) { string currentLevelName = GetCurrentLevelName(); if (currentLevelName != "") { if (loadedScene.name == currentLevelName) { // Load in the in game UI if needed so we only need to load it once if (loadedInGameUI == null && inGameUI != null) { loadedInGameUI = Instantiate(inGameUI); } if (SceneManager.GetActiveScene().buildIndex != loadedScene.buildIndex) { SceneManager.SetActiveScene(loadedScene); } // Reassign the starting time of this level timeSinceLevelStarted = Time.time; // Reset the total steps required for a level if (levelTotalStepsRequiredCounter.ContainsKey(currentLevelName)) { levelTotalStepsRequiredCounter[currentLevelName] = 0; } // Keep track of the amount of times a level has been played if (levelReplayCounter.ContainsKey(currentLevelName)) { levelReplayCounter[currentLevelName]++; } else { levelReplayCounter.Add(currentLevelName, 1); } //AnalyticsManager.Instance.RecordCustomEvent("OnLevelStarted", new Dictionary<string, object> { // {"Level " + GetCurrentLevelName() + " ReplayCount", levelReplayCounter[currentLevelName]} //}); } else if (SceneManager.GetActiveScene().name == currentLevelName && Application.isEditor) { // Load in the in game UI if needed so we only need to load it once if (loadedInGameUI == null && inGameUI != null) { loadedInGameUI = Instantiate(inGameUI); } } } }
public void Show(GameMenus menu) { int menuIndex = (int)menu; if (menuIndex < 0 || menuIndex >= menus.Length) { return; } if (menus[menuIndex] == null) { return; } HideAll(); menus[menuIndex].Show(); }
private static void ToggleMenus(GameMenus menuToShow) { PlayClickedSound(); MenuController.Current.HideMenu(GameMenus.SceneMainMenu); MenuController.Current.ShowMenu(menuToShow); }
public Menu GetMenu(GameMenus menu) { return menuList[(int)menu]; }
public void MoveMenuToForeground(GameMenus menuToForeground) { var menuToBePushedToForeground = menuList[(int)menuToForeground]; if (menuToBePushedToForeground != null) menuToBePushedToForeground.Enable(); }
public Menu GetMenu(GameMenus menu) { return(menuList[(int)menu]); }
private static void ToggleVisibility(GameMenus menuToHide, GameMenus menuToShow) { MenuController.Current.HideMenu(menuToHide); MenuController.Current.ShowMenu(menuToShow); }
private void ShowMenu(GameMenus menu) { MenusController.Instance.Show(menu); }
static void Main(string[] args) { GameMenus newGame = new GameMenus(); newGame.RunInterface(); }