Пример #1
0
        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);
        }
Пример #2
0
		public void HideMenu(GameMenus menuToBeHid)
		{
			var menuToHide = menuList[(int)menuToBeHid];
			if (menuToHide == null)
				return;

			menuToHide.Hide();
		}
Пример #3
0
		public void ShowMenu(GameMenus menuToBeShown)
		{
			var menuToShow = menuList[(int)menuToBeShown];
			if (menuToShow == null)
				return;

			menuToShow.Show();
			menuToShow.Reset();
		}
Пример #4
0
        public void MoveMenuToForeground(GameMenus menuToForeground)
        {
            var menuToBePushedToForeground = menuList[(int)menuToForeground];

            if (menuToBePushedToForeground != null)
            {
                menuToBePushedToForeground.Enable();
            }
        }
Пример #5
0
        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);
        }
Пример #6
0
        public void HideMenu(GameMenus menuToBeHid)
        {
            var menuToHide = menuList[(int)menuToBeHid];

            if (menuToHide == null)
            {
                return;
            }

            menuToHide.Hide();
        }
Пример #7
0
        public void ShowMenu(GameMenus menuToBeShown)
        {
            var menuToShow = menuList[(int)menuToBeShown];

            if (menuToShow == null)
            {
                return;
            }

            menuToShow.Show();
            menuToShow.Reset();
        }
Пример #8
0
    // 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);
                }
            }
        }
    }
Пример #9
0
        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();
        }
Пример #10
0
 private static void ToggleMenus(GameMenus menuToShow)
 {
     PlayClickedSound();
     MenuController.Current.HideMenu(GameMenus.SceneMainMenu);
     MenuController.Current.ShowMenu(menuToShow);
 }
Пример #11
0
		public Menu GetMenu(GameMenus menu)
		{
			return menuList[(int)menu];
		}
Пример #12
0
		public void MoveMenuToForeground(GameMenus menuToForeground)
		{
			var menuToBePushedToForeground = menuList[(int)menuToForeground];
			if (menuToBePushedToForeground != null)
				menuToBePushedToForeground.Enable();
		}
Пример #13
0
 public Menu GetMenu(GameMenus menu)
 {
     return(menuList[(int)menu]);
 }
Пример #14
0
		private static void ToggleMenus(GameMenus menuToShow)
		{
			PlayClickedSound();
			MenuController.Current.HideMenu(GameMenus.SceneMainMenu);
			MenuController.Current.ShowMenu(menuToShow);
		}
Пример #15
0
		private static void ToggleVisibility(GameMenus menuToHide, GameMenus menuToShow)
		{
			MenuController.Current.HideMenu(menuToHide);
			MenuController.Current.ShowMenu(menuToShow);
		}
Пример #16
0
 private void ShowMenu(GameMenus menu)
 {
     MenusController.Instance.Show(menu);
 }
 private static void ToggleVisibility(GameMenus menuToHide, GameMenus menuToShow)
 {
     MenuController.Current.HideMenu(menuToHide);
     MenuController.Current.ShowMenu(menuToShow);
 }
Пример #18
0
        static void Main(string[] args)
        {
            GameMenus newGame = new GameMenus();

            newGame.RunInterface();
        }