Exemple #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);
        }
        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);
        }
        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);
        }
        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);
        }
Exemple #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);
        }
Exemple #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);
        }