예제 #1
0
        public static bool CreateButtonsList(string[] names, BUTTONTYPE type, ref List <ButtonInfo> buttonInfos)
        {
            for (int i = 0; i < names.Length; i++)
            {
                buttonInfos.Add(new ButtonInfo()
                {
                    Name    = names[i],
                    Enabled = true,
                    Type    = type,
                    Pressed = false
                });
            }

            return(true);
        }
예제 #2
0
        public static GUIStyle GetCustomStyle(bool pressed, BUTTONTYPE type)
        {
            switch (type)
            {
            case BUTTONTYPE.NORMAL_CENTER:
                if (pressed)
                {
                    Normal.normal.textColor = Color.green;
                    Normal.hover.textColor  = Color.yellow;
                    Normal.active.textColor = Color.green;
                    Normal.alignment        = TextAnchor.MiddleCenter;
                }
                else
                {
                    Normal.normal.textColor = Color.gray;
                    Normal.hover.textColor  = Color.white;
                    Normal.active.textColor = Color.green;
                    Normal.alignment        = TextAnchor.MiddleCenter;
                }
                return(Normal);

            case BUTTONTYPE.NORMAL_LEFTALIGN:
                if (pressed)
                {
                    Normal.normal.textColor = Color.green;
                    Normal.hover.textColor  = Color.yellow;
                    Normal.active.textColor = Color.green;
                    Normal.alignment        = TextAnchor.MiddleLeft;
                }
                else
                {
                    Normal.normal.textColor = Color.gray;
                    Normal.hover.textColor  = Color.white;
                    Normal.active.textColor = Color.green;
                    Normal.alignment        = TextAnchor.MiddleLeft;
                }
                return(Normal);

            case BUTTONTYPE.TOGGLE_CENTER:
                if (pressed)
                {
                    Toggle.normal.textColor = Color.green;
                    Toggle.hover.textColor  = Color.green;
                    Toggle.active.textColor = Color.red;
                }
                else
                {
                    Toggle.normal.textColor = Color.red;
                    Toggle.hover.textColor  = Color.red;
                    Toggle.active.textColor = Color.green;
                }
                return(Toggle);

            case BUTTONTYPE.TAB_CENTER:
                if (pressed)
                {
                    Tab.normal.textColor = Color.green;
                    Tab.hover.textColor  = Color.green;
                    Tab.active.textColor = Color.green;
                }
                else
                {
                    Tab.normal.textColor = Color.gray;
                    Tab.hover.textColor  = Color.white;
                    Tab.active.textColor = Color.green;
                }
                return(Tab);

            default:
                return(Normal);
            }
        }