Example #1
0
        public InputField MenuAddInputField(MenuBehavior _menu, string _name, Vector2 _position)
        {
            InputField[] inputFields = _menu.GetComponentsInChildren <InputField>(true);

            foreach (InputField inf in inputFields)
            {
                if (inf.name == _name)
                {
                    return(inf);
                }
            }
            return(MenuForceAddInputField(_menu, _name, _position));
        }
Example #2
0
        public Button MenuAddButton(MenuBehavior _menu, string _name, Sprite _sprite, Vector2 _position, UnityAction _action)
        {
            Button[] buttons = _menu.GetComponentsInChildren <Button>(true);

            foreach (Button btn in buttons)
            {
                if (btn.name == _name)
                {
                    return(btn);
                }
            }

            return(MenuForceAddButton(_menu, _name, _sprite, _position, _action));
        }
Example #3
0
        public Text MenuAddText(MenuBehavior _menu, string _name, Vector2 _position, string _context)
        {
            Text[] texts = _menu.GetComponentsInChildren <Text>(true);

            foreach (Text txt in texts)
            {
                if (txt.name == _name)
                {
                    return(txt);
                }
            }

            return(MenuForceAddText(_menu, _name, _position, _context));
        }
Example #4
0
        public Image MenuAddImage(MenuBehavior _menu, string _imageName, Sprite _imageSprite, Vector2 _position)
        {
            Image[] images = _menu.GetComponentsInChildren <Image>(true);

            foreach (Image img in images)
            {
                if (img.name == _imageName)
                {
                    return(img);
                }
            }

            return(MenuForceAddImage(_menu, _imageName, _imageSprite, _position));
        }