示例#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();
		}
        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);
        }
        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();
        }
示例#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);
                }
            }
        }
    }
        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();
        }