Esempio n. 1
0
        void ApplyButtonStyle <BtnTy>(EleGenButton <BtnTy> ele)
            where BtnTy : UnityEngine.UI.Button

        {
            ele.border = this.buttonPadding;
            this.ApplyButtonStyle(ele.Button, ele.Plate, ele.text, true);
        }
Esempio n. 2
0
        public EleGenButton <ty> CreateButton <ty>(string text) where ty : UnityEngine.UI.Button
        {
            if (this.head.rect == null)
            {
                return(null);
            }

            EleGenButton <ty> btn = this.uiFactory.CreateButton <ty>(this.head.rect, text);

            return(btn);
        }
Esempio n. 3
0
        public EleGenButton <ty> PushButton <ty>(string text, float proportion, LFlag flags) where ty : UnityEngine.UI.Button
        {
            EleGenButton <ty> ret = this.AddButton <ty>(text, proportion, flags);

            if (ret == null)
            {
                return(null);
            }

            this.stack.Push(this.head);

            this.head = new Entry(ret);
            return(ret);
        }
Esempio n. 4
0
        public EleGenButton <ty> AddButton <ty>(string text, float proportion, LFlag flags) where ty : UnityEngine.UI.Button
        {
            EleBaseSizer szr = this.head.GetSizer();

            if (szr == null)
            {
                return(null);
            }

            EleGenButton <ty> btn = this.uiFactory.CreateButton <ty>(this.head.rect, text);

            szr.Add(btn, proportion, flags);
            return(btn);
        }
Esempio n. 5
0
        public EleGenButton <BtnTy> CreateButton <BtnTy>(EleBaseRect parent, string text)
            where BtnTy : UnityEngine.UI.Button
        {
            EleGenButton <BtnTy> ele =
                new EleGenButton <BtnTy>(
                    parent,
                    this.buttonFont.font,
                    this.buttonFont.fontSize,
                    this.buttonFont.color,
                    text,
                    this.buttonStyle.normalSprite);

            this.ApplyButtonStyle(ele);
            return(ele);
        }
Esempio n. 6
0
        public EleGenButton <BtnTy> CreateButton <BtnTy>(EleBaseRect parent, string text, Vector2 size, string name = "")
            where BtnTy : UnityEngine.UI.Button
        {
            EleGenButton <BtnTy> ele =
                new EleGenButton <BtnTy>(
                    parent,
                    this.buttonFont.font,
                    this.buttonFont.fontSize,
                    this.buttonFont.color,
                    text,
                    this.buttonStyle.normalSprite,
                    size,
                    name);

            ele.border = this.buttonPadding;

            this.ApplyButtonStyle(ele);
            return(ele);
        }