public override void Show(System.Action <IMenu> stateChanged)
        {
            // Call base function
            base.Show(stateChanged);

            // Check if we should stop time
            if (pauseOnStart == true)
            {
                // Stop time
                Singleton.Get <TimeManager>().IsManuallyPaused = true;
            }

            // Check if we've previously binded to the singleton's update function
            if (checkInput != null)
            {
                Singleton.Instance.OnUpdate -= checkInput;
                checkInput = null;
            }

            // Bind to Singleton's update function
            checkInput = new System.Action <float>(CheckForAnyKey);
            Singleton.Instance.OnUpdate += checkInput;
        }
        public GameObject SetButtonsEnabled(bool enabled)
        {
            // Set all buttons
            GameObject   returnButton = backButton.gameObject;
            GameSettings gameSettings = Singleton.Get <GameSettings>();

            for (int index = 0; index < allLevelButtons.Length; ++index)
            {
                // Make the button interactable if it's unlocked
                if ((enabled == true) && (index < gameSettings.NumLevelsUnlocked))
                {
                    allLevelButtons[index].interactable = true;
                    returnButton = allLevelButtons[index].gameObject;
                }
                else
                {
                    allLevelButtons[index].interactable = false;
                }
            }
            backButton.interactable = enabled;

            // Return the last interactable button
            return(returnButton);
        }
示例#3
0
 /// <summary>
 /// Called when any scene after the first one is loaded.
 /// </summary>
 public override void SceneAwake(Singleton globalGameObject)
 {
     // Do nothing
 }
示例#4
0
 public override void SceneAwake(Singleton instance)
 {
     // Do nothing
 }
示例#5
0
 public override void SceneAwake(Singleton instance)
 {
 }
示例#6
0
 public override void SingletonAwake(Singleton instance)
 {
     // Load settings
     RetrieveFromSettings();
 }
 public override void SingletonAwake(Singleton instance)
 {
     originalTimeScale          = Time.timeScale;
     timeScale                  = Time.timeScale;
     instance.OnRealTimeUpdate += UpdateRealtime;
 }