Exemplo 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);
        }
Exemplo 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);
        }
Exemplo 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);
        }
Exemplo 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);
        }
Exemplo 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);
        }
Exemplo 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);
        }