Пример #1
0
            public CurveTrackTreeViewItem(CurveTrack track, CurveEditor.EditCurveInfo info)
            {
                this.Track = track;
                this.Info  = info;

                this.ColumnDefinitions.Add(20, GridUnitType.Pixel);
                this.ColumnDefinitions.Add(1, GridUnitType.Star);
                this.ColumnDefinitions.Add(36, GridUnitType.Pixel);

                _TbVisible = new Skill.Editor.UI.ToggleButton()
                {
                    Column = 0, IsChecked = track.Visibility == Skill.Framework.UI.Visibility.Visible
                };
                _LblName = new Label()
                {
                    Column = 1, Text = info.Attribute.Name
                };
                _CFColor = new Skill.Editor.UI.ColorField()
                {
                    Column = 2, Color = track.Color
                };

                this.Controls.Add(_TbVisible);
                this.Controls.Add(_LblName);
                this.Controls.Add(_CFColor);

                _TbVisible.Changed    += _TbVisible_Changed;
                _CFColor.ColorChanged += _CFColor_ColorChanged;
            }
Пример #2
0
            public CurveTrackTreeViewItem(string name, CurveTrack curveTrack, BaseTrackBar trackBar, KeyType keyType)
            {
                this.CurveTrack = curveTrack;
                this.TrackBar   = trackBar;
                this.KeyType    = keyType;


                this.ColumnDefinitions.Add(22, GridUnitType.Pixel);
                this.ColumnDefinitions.Add(1, GridUnitType.Star);
                this.ColumnDefinitions.Add(20, GridUnitType.Pixel);

                _TbVisible = new Skill.Editor.UI.ToggleButton()
                {
                    Column = 0, IsChecked = TrackBar.Visibility == Skill.Framework.UI.Visibility.Visible, Margin = new Thickness(2, 0, 0, 0)
                };
                _LblName = new Label()
                {
                    Column = 1, Text = name
                };

                this.Controls.Add(_TbVisible);
                this.Controls.Add(_LblName);

                _TbVisible.Changed += _TbVisible_Changed;
            }
Пример #3
0
        void OnEnable()
        {
            _ScreenShot = base.serializedObject.targetObject as ScreenShot;

            _Frame = new Skill.Framework.UI.Frame("Frame");
            _Frame.Grid.RowDefinitions.Add(1, Skill.Framework.UI.GridUnitType.Star);
            _Frame.Grid.RowDefinitions.Add(1, Skill.Framework.UI.GridUnitType.Star);
            _Frame.Grid.RowDefinitions.Add(1, Skill.Framework.UI.GridUnitType.Star);

            _BtnCustomSize = new Skill.Editor.UI.ToggleButton()
            {
                Row = 0, Column = 0, IsChecked = _ScreenShot.CustomSize
            };
            _BtnCustomSize.Label.text = "Custom size";

            Skill.Framework.UI.Thickness margin = new Skill.Framework.UI.Thickness(20, 0, 0, 0);

            _IFieldWidth = new Skill.Editor.UI.IntField()
            {
                Row = 1, Column = 0, Value = _ScreenShot.Width, Margin = margin
            };
            _IFieldWidth.Label.text = "Width";

            _IFieldHeight = new Skill.Editor.UI.IntField()
            {
                Row = 2, Column = 0, Value = _ScreenShot.Height, Margin = margin
            };
            _IFieldHeight.Label.text = "Height";

            _FFieldScale = new Skill.Editor.UI.FloatField()
            {
                Row = 1, Column = 0, Value = _ScreenShot.Scale, Margin = margin
            };
            _FFieldScale.Label.text = "Scale";

            _Frame.Grid.Controls.Add(_BtnCustomSize);
            _Frame.Grid.Controls.Add(_IFieldWidth);
            _Frame.Grid.Controls.Add(_IFieldHeight);
            _Frame.Grid.Controls.Add(_FFieldScale);

            _BtnCustomSize.Changed     += _BtnCustomSize_Changed;
            _IFieldWidth.ValueChanged  += _Width_ValueChanged;
            _IFieldHeight.ValueChanged += _Height_ValueChanged;
            _FFieldScale.ValueChanged  += _Scale_ValueChanged;

            ManageControls();
        }
Пример #4
0
        public CacheObjectField(CacheGroupEditor editor)
        {
            this.Editor = editor;

            this._PrefabField = new ObjectField <GameObject>()
            {
                Row = 0, Column = 0, AllowSceneObjects = false, Margin = new Thickness(4, 2, 4, 0)
            };
            this._PrefabField.Label.text = "Prefab";

            this._CacheSizeField = new Skill.Editor.UI.IntField()
            {
                Row = 1, Column = 0, Margin = new Thickness(4, 2, 4, 2)
            };
            this._CacheSizeField.Label.text = "CacheSize";

            this._TbGrowable = new Skill.Editor.UI.ToggleButton()
            {
                Row = 2, Column = 0, Margin = new Thickness(4, 2, 4, 2)
            };
            this._TbGrowable.Label.text = "Growable?";

            this.Padding    = new Thickness(2);
            this.AutoHeight = true;
            this.RowDefinitions.Add(1, GridUnitType.Star);
            this.RowDefinitions.Add(1, GridUnitType.Star);
            this.RowDefinitions.Add(1, GridUnitType.Star);
            this.ColumnDefinitions.Add(1, GridUnitType.Star);

            this.Controls.Add(_PrefabField);
            this.Controls.Add(_CacheSizeField);
            this.Controls.Add(_TbGrowable);

            this._CacheSizeField.ValueChanged += _CacheSizeField_ValueChanged;
            this._TbGrowable.Changed          += _TbGrowable_Changed;
            this._PrefabField.ObjectChanged   += _PrefabField_ObjectChanged;

            this.Object = null;
            this.Height = _PrefabField.LayoutHeight + _PrefabField.Margin.Vertical +
                          _CacheSizeField.LayoutHeight + _CacheSizeField.Margin.Vertical +
                          _TbGrowable.LayoutHeight + _TbGrowable.Margin.Vertical + 2;
        }
Пример #5
0
        private void CreateUI()
        {
            Thickness margin = new Thickness(0, 2, 0, 4);

            _Frame = new Skill.Framework.UI.Frame("Frame");
            _Panel = new StackPanel();

            Grid pnlToggles = new Grid()
            {
                Height = 22
            };

            pnlToggles.ColumnDefinitions.Add(1, GridUnitType.Star);
            pnlToggles.ColumnDefinitions.Add(1, GridUnitType.Star);

            _TbEnable = new UI.ToggleButton()
            {
                IsChecked = _Implant.IsEnable, Margin = margin, Left = true, Column = 0
            }; _TbEnable.Label.text = "Enable";
            _TbUniform = new UI.ToggleButton()
            {
                IsChecked = _Implant.Uniform, Margin = margin, Left = true, Column = 1
            }; _TbUniform.Label.text = "Uniform";

            pnlToggles.Controls.Add(_TbEnable);
            pnlToggles.Controls.Add(_TbUniform);

            _AssetField = new Skill.Editor.UI.ObjectField <ImplantAsset>()
            {
                VerticalAlignment = VerticalAlignment.Center, Margin = margin, AllowSceneObjects = false
            };
            _AssetField.Label.text = "ImplantAsset";
            if (_Implant.ImplantAsset != null)
            {
                _Asset = _Implant.ImplantAsset as ImplantAsset;
                _Implant.ImplantAsset = _AssetField.Object = _Asset;
            }

            _RootField = new ObjectField <Transform>()
            {
                Margin = margin, AllowSceneObjects = true, Object = _Implant.Root
            }; _RootField.Label.text = "Root";

            _Layers = new Skill.Editor.UI.LayerMaskField()
            {
                Layers = _Implant.LayerMask, VerticalAlignment = VerticalAlignment.Center, Margin = margin
            };
            _Layers.Label.text = "Raycast layers";

            _SliDensity = new Skill.Editor.UI.IntSlider()
            {
                Value = _Implant.Density, MinValue = 1, MaxValue = 1000, Margin = margin, Height = 16
            }; _SliDensity.Label.text = "Density"; _SliDensity.Label.tooltip = "Shift + (W/S)";
            _SliRotation = new Skill.Editor.UI.Slider()
            {
                Value = _Implant.Rotation, MinValue = 0.0f, MaxValue = 360, Margin = margin, Height = 16
            }; _SliRotation.Label.text = "Rotation"; _SliRotation.Label.tooltip = "Shift + (A/D)";
            _SliOffsetY = new Skill.Editor.UI.Slider()
            {
                Value = _Implant.OffsetY, MinValue = -10.0f, MaxValue = 20, Margin = margin, Height = 16
            }; _SliOffsetY.Label.text = "Offset Y"; _SliOffsetY.Label.tooltip = "Offset in Y axis)";
            _SliMinRadius             = new Skill.Editor.UI.Slider()
            {
                Value = _Implant.MinRadius, MinValue = 0.0f, MaxValue = 200, Margin = margin, Height = 16
            }; _SliMinRadius.Label.text = "Min Radius";
            _SliMaxRadius = new Skill.Editor.UI.Slider()
            {
                Value = _Implant.MaxRadius, MinValue = 0.0f, MaxValue = 200, Margin = margin, Height = 16
            }; _SliMaxRadius.Label.text = "Max Radius";
            _SliRectWidth = new Skill.Editor.UI.Slider()
            {
                Value = _Implant.RectWidth, MinValue = 0.0f, MaxValue = 1000, Margin = margin, Height = 16
            }; _SliRectWidth.Label.text = "Width";
            _SliRectHeight = new Skill.Editor.UI.Slider()
            {
                Value = _Implant.RectHeight, MinValue = 0.0f, MaxValue = 1000, Margin = margin, Height = 16
            }; _SliRectHeight.Label.text = "Height";
            _Help = new Skill.Editor.UI.HelpBox()
            {
                Message = "Hold Ctrl and Right Click to implant obejcts.\nMouse3 to shuffle.\nShift + R : Make reference point.\nSpace : R reference point", Height = 60, Margin = new Thickness(0, 10, 0, 0)
            };

            _TbModes = new TabHeader {
                Margin = new Thickness(0, 2, 0, 10), HorizontalAlignment = HorizontalAlignment.Center, Width = 200, Height = 20
            };
            _TbModes[0].text     = "Circle";
            _TbModes[1].text     = "Rectangle";
            _TbModes.SelectedTab = _Implant.BrushMode;


            _Panel.Controls.Add(pnlToggles);
            _Panel.Controls.Add(_AssetField);
            _Panel.Controls.Add(_RootField);
            _Panel.Controls.Add(_Layers);
            _Panel.Controls.Add(_SliDensity);
            _Panel.Controls.Add(_SliRotation);
            _Panel.Controls.Add(_SliOffsetY);
            _Panel.Controls.Add(_TbModes);
            _Panel.Controls.Add(_SliMinRadius);
            _Panel.Controls.Add(_SliMaxRadius);
            _Panel.Controls.Add(_SliRectWidth);
            _Panel.Controls.Add(_SliRectHeight);
            _Panel.Controls.Add(_Help);
            _Frame.Grid.Controls.Add(_Panel);

            ChangeMode();
            UpdateRotation();

            _AssetField.ObjectChanged   += _AssetField_ObjectChanged;
            _RootField.ObjectChanged    += _RootField_ObjectChanged;
            _Layers.LayersChanged       += _Layers_LayersChanged;
            _SliDensity.ValueChanged    += _SliDensity_ValueChanged;
            _SliRotation.ValueChanged   += _SliRotation_ValueChanged;
            _TbModes.SelectedTabChanged += _TbModes_SelectedTabChanged;
            _SliMinRadius.ValueChanged  += _SliMinRadius_ValueChanged;
            _SliMaxRadius.ValueChanged  += _SliMaxRadius_ValueChanged;
            _SliRectWidth.ValueChanged  += _SliRectWidth_ValueChanged;
            _SliRectHeight.ValueChanged += _SliRectHeight_ValueChanged;
            _SliOffsetY.ValueChanged    += _SliOffsetY_ValueChanged;
            _TbEnable.Changed           += _TbEnable_Changed;
            _TbUniform.Changed          += _TbUniform_Changed;
        }
Пример #6
0
                public SubtitleEventProperties(SubtitleEvent se)
                    : base(se)
                {
                    _Event = se;


                    _BtnPickTitle = new Skill.Framework.UI.Button()
                    {
                        Margin = ControlMargin
                    };
                    _BtnPickTitle.Content.text = "Select Subtitle";
                    this.Controls.Add(_BtnPickTitle);

                    _TimeField = new Skill.Editor.UI.FloatField()
                    {
                        Margin = ControlMargin
                    };
                    _TimeField.Label.text = "Time";
                    this.Controls.Add(_TimeField);

                    _DurationField = new Skill.Editor.UI.FloatField()
                    {
                        Margin = ControlMargin
                    };
                    _DurationField.Label.text = "Duration";
                    this.Controls.Add(_DurationField);


                    _TbOverrideStyle = new Skill.Editor.UI.ToggleButton()
                    {
                        Margin = ControlMargin
                    };
                    _TbOverrideStyle.Label.text = "Override Style";
                    this.Controls.Add(_TbOverrideStyle);

                    _ColorField = new Skill.Editor.UI.ColorField()
                    {
                        Margin = ControlMargin
                    };
                    _ColorField.Label.text = "Font Color";
                    this.Controls.Add(_ColorField);

                    _FontStyleField = new Skill.Editor.UI.EnumPopup()
                    {
                        Margin = ControlMargin
                    };
                    _FontStyleField.Label.text = "Font Style";
                    this.Controls.Add(_FontStyleField);

                    _AlignmentField = new Skill.Editor.UI.EnumPopup()
                    {
                        Margin = ControlMargin
                    };
                    _AlignmentField.Label.text = "Alignment";
                    this.Controls.Add(_AlignmentField);

                    _BtnPickTitle.Click          += _BtnPickTitle_Click;
                    _TimeField.ValueChanged      += _TimeField_ValueChanged;
                    _DurationField.ValueChanged  += _DurationField_ValueChanged;
                    _TbOverrideStyle.Changed     += _TbOverrideStyle_Changed;
                    _ColorField.ColorChanged     += _ColorField_ColorChanged;
                    _FontStyleField.ValueChanged += _FontStyleField_ValueChanged;
                    _AlignmentField.ValueChanged += _AlignmentField_ValueChanged;
                }
Пример #7
0
        private void CreateUI()
        {
            _Frame = new Skill.Framework.UI.Frame("Frame");
            _Panel = new Skill.Framework.UI.StackPanel();
            _Frame.Grid.Controls.Add(_Panel);

            _FrameHeight = 2;
            Thickness margin = new Thickness(2);

            _Receiver = new ObjectField <GameObject>()
            {
                Margin = margin
            }; _Receiver.Label.text = "Receiver";
            _Panel.Controls.Add(_Receiver);
            _FrameHeight += _Receiver.Height + margin.Vertical;

            _FunctionName = new Skill.Editor.UI.TextField()
            {
                Margin = margin
            }; _FunctionName.Label.text = "Function";
            _Panel.Controls.Add(_FunctionName);
            _FrameHeight += _FunctionName.Height + margin.Vertical;


            _MessageOptions = new EnumPopup()
            {
                Margin = margin
            }; _MessageOptions.Label.text = "Message Options";
            _Panel.Controls.Add(_MessageOptions);
            _FrameHeight += _MessageOptions.Height + margin.Vertical;

            _ParameterType = new EnumPopup()
            {
                Margin = margin
            }; _ParameterType.Label.text = "Parameter Type";
            _Panel.Controls.Add(_ParameterType);
            _FrameHeight += _ParameterType.Height + margin.Vertical;


            _Float = new FloatField()
            {
                Margin = margin
            }; _Float.Label.text = "Float";
            _Panel.Controls.Add(_Float);
            _FrameHeight += _Float.Height + margin.Vertical;

            _Int = new IntField()
            {
                Margin = margin
            }; _Int.Label.text = "Float";
            _Panel.Controls.Add(_Int);
            _FrameHeight += _Int.Height + margin.Vertical;

            _Boolean = new Skill.Editor.UI.ToggleButton()
            {
                Margin = margin, Left = true
            }; _Boolean.Label.text = "Boolean";
            _Panel.Controls.Add(_Boolean);
            _FrameHeight += _Boolean.Height + margin.Vertical;

            _ObjectReference = new ObjectField <Object>()
            {
                Margin = margin
            }; _ObjectReference.Label.text = "Object";
            _Panel.Controls.Add(_ObjectReference);
            _FrameHeight += _ObjectReference.Height + margin.Vertical;

            _String = new Skill.Editor.UI.TextField()
            {
                Margin = margin
            }; _String.Label.text = "String";
            _Panel.Controls.Add(_String);
            _FrameHeight += _String.Height + margin.Vertical;


            _Receiver.Object        = _Data.Receiver;
            _FunctionName.Text      = _Data.FunctionName;
            _MessageOptions.Value   = _Data.MessageOptions;
            _ParameterType.Value    = _Data.ParameterType;
            _Float.Value            = _Data.Float;
            _Int.Value              = _Data.Int;
            _Boolean.IsChecked      = _Data.Boolean;
            _ObjectReference.Object = _Data.ObjectReference;
            _String.Text            = _Data.String;

            UpdateVisibility();

            _Receiver.ObjectChanged        += _Receiver_ObjectChanged;
            _FunctionName.TextChanged      += _FunctionName_TextChanged;
            _MessageOptions.ValueChanged   += _MessageOptions_ValueChanged;
            _ParameterType.ValueChanged    += _ParameterType_ValueChanged;
            _Float.ValueChanged            += _Float_ValueChanged;
            _Int.ValueChanged              += _Int_ValueChanged;
            _Boolean.Changed               += _Boolean_Changed;
            _ObjectReference.ObjectChanged += _ObjectReference_ObjectChanged;
            _String.TextChanged            += _String_TextChanged;
        }
Пример #8
0
        private void CreateUI()
        {
            _ObjectField = new CacheObjectField(this)
            {
                Row = 2, Column = 1
            };

            _MainPanel = new ChangeCheck()
            {
                Row = 1, Column = 0
            };
            _MainPanel.RowDefinitions.Add(ButtonRowHeight, GridUnitType.Pixel);           // _BtnAdd
            _MainPanel.RowDefinitions.Add(1, GridUnitType.Star);                          // _ItemsList
            _MainPanel.RowDefinitions.Add(_ObjectField.LayoutHeight, GridUnitType.Pixel); // _ObjectField

            _BtnAdd = new Skill.Framework.UI.Button()
            {
                Row = 0, Column = 0, Margin = new Thickness(2)
            };
            _BtnAdd.Content.text = "Add";
            _BtnAdd.Click       += new System.EventHandler(_BtnAdd_Click);

            _ItemsList = new ListBox()
            {
                Row = 1, Column = 0, Margin = new Thickness(2)
            };
            _ItemsList.BackgroundVisible = true;
            _ItemsList.DisableFocusable();

            _MainPanel.Controls.Add(new Box()
            {
                Row = 2, Column = 1
            });
            _MainPanel.Controls.Add(_BtnAdd);
            _MainPanel.Controls.Add(_ItemsList);
            _MainPanel.Controls.Add(_ObjectField);


            _PnlControls = new StackPanel()
            {
                Row = 0, Column = 0
            };
            _BtnInitializeOnAwake = new UI.ToggleButton()
            {
                Height = 18
            };
            _BtnInitializeOnAwake.Label.text    = "Initialize On Awake";
            _BtnInitializeOnAwake.Label.tooltip = "create all cached objects on awake";
            _BtnInitializeOnAwake.IsChecked     = _Data.InitializeOnAwake;

            _BtnMakeAsChild = new UI.ToggleButton()
            {
                Height = 18
            };
            _BtnMakeAsChild.Label.text    = "Make as Child";
            _BtnMakeAsChild.Label.tooltip = "create all cached objects as childs of group";
            _BtnMakeAsChild.IsChecked     = _Data.MakeAsChild;

            _FlCleanInterval = new FloatField()
            {
                Height = 18
            };
            _FlCleanInterval.Label.text    = "Clean Interval";
            _FlCleanInterval.Label.tooltip = "Clean Interval of this group";
            _FlCleanInterval.Value         = _Data.CleanInterval;

            _PnlControls.Controls.Add(_BtnInitializeOnAwake);
            _PnlControls.Controls.Add(_BtnMakeAsChild);
            _PnlControls.Controls.Add(_FlCleanInterval);

            _Frame = new Frame("MainFrame");

            _Frame.Grid.RowDefinitions.Add(56, GridUnitType.Pixel); // _PnlControls
            _Frame.Grid.RowDefinitions.Add(1, GridUnitType.Star);   // _MainPanel

            _Frame.Grid.Controls.Add(_PnlControls);
            _Frame.Grid.Controls.Add(_MainPanel);

            _MainPanel.Changed          += new EventHandler(_ChangeCheck_Changed);
            _ItemsList.SelectionChanged += _ItemsPanel_SelectionChanged;

            _BtnInitializeOnAwake.Changed += Properties_Changed;
            _BtnMakeAsChild.Changed       += Properties_Changed;
            _FlCleanInterval.ValueChanged += Properties_Changed;
        }
Пример #9
0
        private void CreateUI()
        {
            _Panel = new StackPanel()
            {
                Padding = new Skill.Framework.UI.Thickness(2, 4, 2, 0)
            };
            _TextureField = new Skill.Editor.UI.ObjectField <Texture2D>()
            {
                Object = _PaintColor.Texture, HorizontalAlignment = Skill.Framework.UI.HorizontalAlignment.Center, Width = 80, Height = 80, Margin = new Skill.Framework.UI.Thickness(2)
            };


            #region _TbChannels
            _TbChannels = new UI.TabHeader(4, true)
            {
                Margin = new Thickness(0, 2, 0, 10), HorizontalAlignment = HorizontalAlignment.Center, Width = 200, Height = 20
            };
            _TbChannels[0].text = "R";
            _TbChannels[1].text = "G";
            _TbChannels[2].text = "B";
            _TbChannels[3].text = "A";

            _TbChannels.SetTabSelected(0, _PaintColor.ChannelR);
            _TbChannels.SetTabSelected(1, _PaintColor.ChannelG);
            _TbChannels.SetTabSelected(2, _PaintColor.ChannelB);
            _TbChannels.SetTabSelected(3, _PaintColor.ChannelA);
            #endregion

            #region _LayersField and _PUV and _TbBrush

            Grid layersPanel = new Grid()
            {
                Height = 32, Padding = new Thickness(2, 6)
            };
            layersPanel.ColumnDefinitions.Add(90, GridUnitType.Pixel);
            layersPanel.ColumnDefinitions.Add(50, GridUnitType.Pixel);
            layersPanel.ColumnDefinitions.Add(10, GridUnitType.Pixel);
            layersPanel.ColumnDefinitions.Add(45, GridUnitType.Pixel);
            layersPanel.ColumnDefinitions.Add(1, GridUnitType.Star);


            _TbBrush = new UI.ToggleButton()
            {
                Column = 0, IsChecked = _PaintColor.Brush, Left = true
            };
            _TbBrush.Label.text = "Brush View";
            layersPanel.Controls.Add(_TbBrush);

            _PUV = new Popup()
            {
                Row = 0, Column = 1
            };
            PopupOption uv1 = new PopupOption(0)
            {
                Name = "UV1"
            }; uv1.Content.text = "UV 1";
            PopupOption uv2 = new PopupOption(1)
            {
                Name = "UV2"
            }; uv2.Content.text = "UV 2";
            _PUV.Options.Add(uv1);
            _PUV.Options.Add(uv2);
            _PUV.SelectedIndex = _PaintColor.UV2 ? 1 : 0;
            layersPanel.Controls.Add(_PUV);

            Label lbl = new Label()
            {
                Text = "Layers", Column = 3
            };
            layersPanel.Controls.Add(lbl);


            _LayersField = new LayerMaskField()
            {
                Row = 0, Column = 4
            };
            _LayersField.Layers     = _PaintColor.LayerMask;
            _LayersField.Label.text = string.Empty;
            layersPanel.Controls.Add(_LayersField);


            #endregion

            _PnlFavoriteColors = new Grid()
            {
                Height = 22, Margin = new Thickness(0, 2)
            };
            _FavoriteColors = new Color[] { new Color(1.0f, 0.0f, 0.0f, 0.0f),   // red
                                            new Color(0.0f, 1.0f, 0.0f, 0.0f),   // green
                                            new Color(0.0f, 0.0f, 1.0f, 0.0f),   // blue
                                            new Color(0.0f, 0.0f, 0.0f, 1.0f),   // Alpha
                                            new Color(1.0f, 1.0f, 1.0f, 1.0f),   // white
                                            new Color(0.0f, 0.0f, 0.0f, 0.0f) }; // black
            _PnlFavoriteColors.Controls.Add(new Box()
            {
                Row = 0, Column = 0, ColumnSpan = _FavoriteColors.Length
            });
            for (int i = 0; i < _FavoriteColors.Length; i++)
            {
                _PnlFavoriteColors.ColumnDefinitions.Add(1, GridUnitType.Star);
                Skill.Framework.UI.Button btn = new Skill.Framework.UI.Button()
                {
                    Tag = i.ToString(), Margin = new Thickness(4), Style = new GUIStyle(), Column = i
                };
                string    toolTip    = string.Empty;
                Texture2D background = null;
                if (i == 0)
                {
                    background = Skill.Editor.Resources.UITextures.Colors.Red; toolTip = "Red";
                }
                else if (i == 1)
                {
                    background = Skill.Editor.Resources.UITextures.Colors.Green; toolTip = "Green";
                }
                else if (i == 2)
                {
                    background = Skill.Editor.Resources.UITextures.Colors.Blue; toolTip = "Blue";
                }
                else if (i == 3)
                {
                    background = Skill.Editor.Resources.UITextures.Colors.Transparent; toolTip = "Alpha";
                }
                else if (i == 4)
                {
                    background = Skill.Editor.Resources.UITextures.Colors.White; toolTip = "White";
                }
                else if (i == 5)
                {
                    background = Skill.Editor.Resources.UITextures.Colors.Black; toolTip = "Black";
                }
                btn.Style.normal.background = btn.Style.focused.background = btn.Style.hover.background = btn.Style.active.background = background;
                btn.Content.tooltip         = toolTip;
                btn.Click += btn_Click;
                _PnlFavoriteColors.Controls.Add(btn);
            }


            _ColorField = new ColorField()
            {
                Color = _PaintColor.Color, Margin = new Thickness(2)
            };
            _SliRadius = new Skill.Editor.UI.Slider()
            {
                Value = _PaintColor.Radius, MinValue = 1, MaxValue = 40, Margin = new Thickness(2), Height = 16
            }; _SliRadius.Label.text = "Radius"; _SliRadius.Label.tooltip = "Shift + (A/D)";
            _SliStrength             = new Skill.Editor.UI.Slider()
            {
                Value = _PaintColor.Strength, MinValue = 1f, MaxValue = 100f, Margin = new Thickness(2), Height = 16
            }; _SliStrength.Label.text = "Strength";
            _SliFalloff = new Skill.Editor.UI.Slider()
            {
                Value = _PaintColor.Falloff, MinValue = 0.0f, MaxValue = 1.0f, Margin = new Thickness(2), Height = 16
            }; _SliFalloff.Label.text = "Falloff";
            _HelpBox = new HelpBox()
            {
                Height = 60, Message = "Hold CTRL and drag with Right Click to paint.\nTexture must be read/write enable\nValid texture format:\n    ARGB32, RGBA32, RGB24 and Alpha8"
            };

            _BtnSaveTexture = new Skill.Framework.UI.Button()
            {
                Margin = new Thickness(2), Height = 40
            }; _BtnSaveTexture.Content.text = "Save Texture";
            _TbShadowMode = new UI.ToggleButton()
            {
                Left = false, Margin = new Thickness(2), Height = 20
            }; _TbShadowMode.Label.text = "Shadow Mode";


            _Panel.Controls.Add(_TextureField);
            _Panel.Controls.Add(_TbChannels);
            _Panel.Controls.Add(_PnlFavoriteColors);
            _Panel.Controls.Add(_ColorField);
            _Panel.Controls.Add(layersPanel);
            _Panel.Controls.Add(_SliRadius);
            _Panel.Controls.Add(_SliStrength);
            _Panel.Controls.Add(_SliFalloff);
            _Panel.Controls.Add(_TbShadowMode);
            _Panel.Controls.Add(_HelpBox);
            _Panel.Controls.Add(_BtnSaveTexture);

            _Frame = new Frame("Frame");
            _Frame.Grid.Controls.Add(_Panel);

            _TextureField.ObjectChanged += _TextureField_ObjectChanged;
            _TbBrush.Changed            += _TbBrush_Changed;
            _TbShadowMode.Changed       += _TbShadowMode_Changed;

            _TbChannels.TabChanged += Channel_Changed;

            _LayersField.LayersChanged += _LayersField_LayersChanged;
            _PUV.OptionChanged         += _PUV_OptionChanged;
            _ColorField.ColorChanged   += _ColorField_ColorChanged;

            _SliRadius.ValueChanged   += _SliRadius_ValueChanged;
            _SliStrength.ValueChanged += _SliStrength_ValueChanged;
            _SliFalloff.ValueChanged  += _SliFalloff_ValueChanged;
            _BtnSaveTexture.Click     += _BtnSaveTexture_Click;
        }