// Use this for initialization
    void Awake()
    {
        //If we have to add multiple text boxes then we will need this script to sort through them and select the proper textbox
        Text[] textBoxes = gameObject.GetComponentsInChildren <Text>(true);
        if (textBoxes != null)
        {
            foreach (Text text in textBoxes)
            {
                if (text.gameObject.name == "MenuOptionText")
                {
                    _menuOptionText = text;
                }
                else if (text.gameObject.name == "ValueText")
                {
                    _valueText = text;
                }
            }
        }

        MenuArrow[] arrows = gameObject.GetComponentsInChildren <MenuArrow>(true);
        if (arrows != null)
        {
            foreach (MenuArrow scr in arrows)
            {
                if (scr.gameObject.name == "LeftArrow")
                {
                    _leftArrow = scr;
                }
                else if (scr.gameObject.name == "RightArrow")
                {
                    _rightArrow = scr;
                }
            }
        }
    }
Exemple #2
0
 void Start()
 {
     index              = 0;
     menu               = GameObject.Find("Arrow").GetComponent <MenuArrow>();
     musicControls      = GameObject.Find("Music").GetComponent <Image>();
     soundControls      = GameObject.Find("Sound").GetComponent <Image>();
     fullscreenControls = GameObject.Find("Fullscreen").GetComponent <Image>();
     animator           = GameObject.Find("Arrow Options").GetComponent <Animator>();
 }