private void Start()
        {
            PauseMenuController.PauseOptions options = new PauseMenuController.PauseOptions();
            options.SetUp(ContinueButton, ExitButton, SceneToExit, ArrowSprite, SelectedColor, textColor, ResumeGame);

            menuItems = new GameObject[transform.childCount];
            int i = 0;

            foreach (Transform t in transform)
            {
                if (t.GetComponent <PauseMenuController>() != null)
                {
                    pMenuController = t.GetComponent <PauseMenuController>();
                    pMenuController.SetOptions(options, SimpleMenuManager.vAxis, SimpleMenuManager.inputKey);
                }
                else if (t.GetComponent <UnityEngine.UI.Text>() != null)
                {
                    UnityEngine.UI.Text pauseTitle = t.GetComponent <UnityEngine.UI.Text>();
                    pauseTitle.color = textColor;
                    pauseTitle.text  = PauseTitle;
                }
                menuItems[i] = t.gameObject;
                i++;
            }
            backgroundImage = GetComponent <Image>();
            SetMenuState(false);
        }
Example #2
0
 public void SetButton(PauseMenuController.PauseOptions options)
 {
     if (type == ButtonType.Continue)
     {
         getOptionText().text = options.continueText;
         getOptionButton().onClick.AddListener(delegate() { options.unpause(); });
     }
     else if (type == ButtonType.Exit)
     {
         getOptionText().text = options.pauseText;
         sceneToChange        = options.exitScene;
         getOptionButton().onClick.AddListener(delegate() { ChangeScene(); });
     }
     selectedImage           = options.selectedImage;
     sColor                  = options.sColor;
     bColor                  = options.bColor;
     getArrowImage().enabled = false;
 }