예제 #1
0
        protected override void InitFieldStyle()
        {
            base.InitFieldStyle();
            var background = VisualEditorGUIStyle.GetTexture(BuiltInColors.GetDark(_node.Type), new Color(0, 0, 0, 0), true, true, true, true);

            fieldStyle.normal.background  = background.Texture;
            fieldStyle.active.background  = background.Texture;
            fieldStyle.focused.background = background.Texture;
            fieldStyle.hover.background   = background.Texture;
        }
예제 #2
0
        protected virtual void InitSelectionStyle()
        {
            var background = VisualEditorGUIStyle.GetTexture(new Color(0.85f, 0.51f, 0.00f, 1.00f), new Color(0.85f, 0.51f, 0.00f, 0.00f), false, false, false, false);

            selectionStyle = new GUIStyle(GUI.skin.box);
            selectionStyle.normal.background = background.Texture;
            selectionStyle.fontStyle         = FontStyle.Bold;
            selectionStyle.alignment         = TextAnchor.MiddleCenter;
            selectionStyle.normal.textColor  = Color.white;
            selectionStyle.border            = background.BorderOffset;
        }
예제 #3
0
        protected override void InitGUIStyles()
        {
            buttonStyle          = new GUIStyle(GUI.skin.button);
            buttonStyle.fontSize = 9;
            buttonStyle.margin   = new RectOffset(0, 0, 0, 0);
            buttonStyle.padding  = new RectOffset(0, 0, 0, 0);

            foreach (var t in _availableTypes)
            {
                var color = BuiltInColors.Get(t);
                var tex   = VisualEditorGUIStyle.GetTexture(color, color, true, true, true, true);

                GUIStyle s = new GUIStyle(GUI.skin.box);
                s.normal.background = tex.Texture;
                s.border            = tex.BorderOffset;
                styles.Add(t, s);
            }
            base.InitGUIStyles();
        }
예제 #4
0
        protected virtual void InitFieldStyle()
        {
            var textColor = Color.white;
            var bg        = VisualEditorGUIStyle.GetTexture(BuiltInColors.Default, new Color(0, 0, 0, 0), true, true, true, true);

            fieldStyle           = new GUIStyle(GUI.skin.textField);
            fieldStyle.fontStyle = FontStyle.Bold;
            fieldStyle.alignment = TextAnchor.MiddleCenter;
            fieldStyle.border    = bg.BorderOffset;
            fieldStyle.padding   = new RectOffset(0, 0, 0, 0);
            fieldStyle.margin    = new RectOffset(0, 0, 0, 0);

            fieldStyle.normal.textColor   = textColor;
            fieldStyle.normal.background  = bg.Texture;
            fieldStyle.active.textColor   = textColor;
            fieldStyle.active.background  = bg.Texture;
            fieldStyle.focused.textColor  = textColor;
            fieldStyle.focused.background = bg.Texture;
            fieldStyle.hover.textColor    = textColor;
            fieldStyle.hover.background   = bg.Texture;
        }