Ejemplo n.º 1
0
        private void CreateUI()
        {
            _Frame     = new Skill.Framework.UI.Frame("Frame");
            _Panel     = new Skill.Framework.UI.StackPanel();
            _BtnUpdate = new Button()
            {
                Height = 20, Margin = new Skill.Framework.UI.Thickness(0, 0, 0, 4)
            }; _BtnUpdate.Content.text = "Count";
            _LblCount             = new LabelField(); _LblCount.Label.text = "Count";
            _LblCount.Label2.text = _ChildCounter.Count.ToString();

            _Panel.Controls.Add(_LblCount);
            _Panel.Controls.Add(_BtnUpdate);

            _Frame.Grid.Controls.Add(_Panel);
            _BtnUpdate.Click += _BtnUpdate_Click;
        }
Ejemplo n.º 2
0
        private void CreateUI()
        {
            _Frame       = new Skill.Framework.UI.Frame("Frame");
            _Panel       = new Skill.Framework.UI.StackPanel();
            _BtnGenerate = new Button()
            {
                Height = 20, Margin = new Skill.Framework.UI.Thickness(0, 0, 0, 4)
            }; _BtnGenerate.Content.text = "Generate";
            _BtnDestroy = new Button()
            {
                Height = 20, Margin = new Skill.Framework.UI.Thickness(0, 0, 0, 4)
            }; _BtnDestroy.Content.text = "Clear";

            _Panel.Controls.Add(_BtnGenerate);
            _Panel.Controls.Add(_BtnDestroy);
            _Frame.Grid.Controls.Add(_Panel);

            _BtnGenerate.Click += _BtnGenerate_Click;
            _BtnDestroy.Click  += _BtnDestroy_Click;
        }
Ejemplo n.º 3
0
        private void CreateUI()
        {
            _ChangeCheck = new ChangeCheck();
            _ChangeCheck.ColumnDefinitions.Add(1, Skill.Framework.UI.GridUnitType.Star);
            _ChangeCheck.ColumnDefinitions.Add(1, Skill.Framework.UI.GridUnitType.Star);

            _ChangeCheck.RowDefinitions.Add(24, Skill.Framework.UI.GridUnitType.Pixel);  // _BtnAdd , _BtnRemove
            _ChangeCheck.RowDefinitions.Add(164, Skill.Framework.UI.GridUnitType.Pixel); // _PointsScrollView
            _ChangeCheck.RowDefinitions.Add(86, Skill.Framework.UI.GridUnitType.Pixel);  // _PnlPoperties
            _ChangeCheck.RowDefinitions.Add(130, Skill.Framework.UI.GridUnitType.Pixel); //_PnlTools

            _BtnAdd = new Button()
            {
                Row = 0, Column = 0
            }; _BtnAdd.Content.text = "Add"; _BtnAdd.Content.tooltip = "Add new point the end of the path."; _BtnAdd.Content.image = Resources.UITextures.Plus;
            _BtnRemove = new Button()
            {
                Row = 0, Column = 1
            }; _BtnRemove.Content.text = "Remove"; _BtnRemove.Content.tooltip = "Remove selected point."; _BtnRemove.Content.image = Resources.UITextures.Minus;
            _PointsScrollView          = new Skill.Framework.UI.ScrollView()
            {
                Row = 1, Column = 0, ColumnSpan = 2, AlwayShowVertical = true, Padding = new Skill.Framework.UI.Thickness(0, 2)
            };
            _GridPoints = new Skill.Framework.UI.SelectionGrid()
            {
                XCount = 5
            };
            _PointsScrollView.Controls.Add(_GridPoints);
            _PointsScrollView.RenderAreaChanged += _PointsScrollView_RenderAreaChanged;

            _SelectedPointPropertiesBackground = new Skill.Framework.UI.Box()
            {
                Row = 2, Column = 0, ColumnSpan = 2
            };
            _PnlPoperties = new Skill.Framework.UI.StackPanel()
            {
                Row = 2, Column = 0, ColumnSpan = 2, Orientation = Skill.Framework.UI.Orientation.Vertical, Padding = new Skill.Framework.UI.Thickness(2)
            };

            _FFTime = new FloatField()
            {
                Height = 16, Margin = new Skill.Framework.UI.Thickness(0, 2, 0, 4)
            }; _FFTime.Label.text = "Time";
            _VFValue = new Vector3Field()
            {
                Height = 20
            }; _VFValue.Label.text = "Position";
            _VFInTangent           = new Vector3Field()
            {
                Height = 20
            }; _VFInTangent.Label.text = "InTangent";
            _VFOutTangent = new Vector3Field()
            {
                Height = 20
            }; _VFOutTangent.Label.text = "OutTangent";

            _PnlPoperties.Controls.Add(_FFTime);
            _PnlPoperties.Controls.Add(_VFValue);
            _PnlPoperties.Controls.Add(_VFInTangent);
            _PnlPoperties.Controls.Add(_VFOutTangent);

            _PnlTools = new Skill.Framework.UI.Grid()
            {
                Row = 5, Column = 0, ColumnSpan = 2, Padding = new Skill.Framework.UI.Thickness(2)
            };
            _PnlTools.ColumnDefinitions.Add(1, Skill.Framework.UI.GridUnitType.Star);
            _PnlTools.ColumnDefinitions.Add(1, Skill.Framework.UI.GridUnitType.Star);
            _PnlTools.ColumnDefinitions.Add(2, Skill.Framework.UI.GridUnitType.Star);

            _PnlTools.RowDefinitions.Add(1, Skill.Framework.UI.GridUnitType.Star); // _LmGroundLayer
            _PnlTools.RowDefinitions.Add(1, Skill.Framework.UI.GridUnitType.Star); // _BtnGroundAll , _BtnGroundSelected
            _PnlTools.RowDefinitions.Add(1, Skill.Framework.UI.GridUnitType.Star); // _LblFLinearTime
            _PnlTools.RowDefinitions.Add(1, Skill.Framework.UI.GridUnitType.Star);
            _PnlTools.RowDefinitions.Add(1, Skill.Framework.UI.GridUnitType.Star);

            _LmGroundLayer = new LayerMaskField()
            {
                Row = 0, Column = 0, ColumnSpan = 3, Layers = _Path.GroundLayer, Margin = new Framework.UI.Thickness(2)
            }; _LmGroundLayer.Label.text = "Ground Layer";
            _BtnGroundSelected           = new Button()
            {
                Row = 1, Column = 0, ColumnSpan = 2, Margin = new Skill.Framework.UI.Thickness(2, 2)
            }; _BtnGroundSelected.Content.text = "Ground Selected"; _BtnGroundSelected.Content.tooltip = "put selected on ground";
            _BtnGroundAll = new Button()
            {
                Row = 1, Column = 2, Margin = new Skill.Framework.UI.Thickness(2, 2)
            }; _BtnGroundAll.Content.text = "Ground All"; _BtnGroundAll.Content.tooltip = "put all points on ground";

            _LblFLinearTime = new LabelField()
            {
                Row = 2, Column = 0, Margin = new Skill.Framework.UI.Thickness(0, 2)
            }; _LblFLinearTime.Label.text = "Time";
            _FFLinearTime = new FloatField()
            {
                Row = 2, Column = 1, Margin = new Skill.Framework.UI.Thickness(0, 2), Value = _Path.PathTime
            };
            _BtnSetLinearTime = new Button()
            {
                Row = 2, Column = 2, Margin = new Skill.Framework.UI.Thickness(2, 2)
            }; _BtnSetLinearTime.Content.text = "Set Time by Distance"; _BtnSetLinearTime.Content.tooltip = "Set time of nodes by relative distance";

            _SliSmoothValue = new Skill.Editor.UI.Slider()
            {
                Row = 3, Column = 0, ColumnSpan = 3, MinValue = 0.0f, MaxValue = 1.0f, Value = _Path.SmoothValue
            }; _SliSmoothValue.Label.text = "Smooth Value";
            _BtnSmoothCurve = new Button()
            {
                Row = 4, Column = 0, ColumnSpan = 2, Margin = new Skill.Framework.UI.Thickness(2, 2)
            }; _BtnSmoothCurve.Content.text = "Smooth Curve"; _BtnSmoothCurve.Content.tooltip = "Smooth the in and out tangents of the keys.";
            _BtnSmoothPoint = new Button()
            {
                Row = 4, Column = 2, Margin = new Skill.Framework.UI.Thickness(2, 2)
            }; _BtnSmoothPoint.Content.text = "Smooth Point"; _BtnSmoothPoint.Content.tooltip = "Smooth the in and out tangents of the selected key.";

            _PnlTools.Controls.Add(_LmGroundLayer);
            _PnlTools.Controls.Add(_BtnGroundSelected);
            _PnlTools.Controls.Add(_BtnGroundAll);
            _PnlTools.Controls.Add(_LblFLinearTime);
            _PnlTools.Controls.Add(_FFLinearTime);
            _PnlTools.Controls.Add(_BtnSetLinearTime);
            _PnlTools.Controls.Add(_SliSmoothValue);
            _PnlTools.Controls.Add(_BtnSmoothPoint);
            _PnlTools.Controls.Add(_BtnSmoothCurve);


            _ChangeCheck.Controls.Add(_BtnAdd);
            _ChangeCheck.Controls.Add(_BtnRemove);
            _ChangeCheck.Controls.Add(_PointsScrollView);
            _ChangeCheck.Controls.Add(_SelectedPointPropertiesBackground);
            _ChangeCheck.Controls.Add(_PnlPoperties);
            _ChangeCheck.Controls.Add(_PnlTools);

            _Frame = new Skill.Framework.UI.Frame("EditorFrame");
            _Frame.Grid.Controls.Add(_ChangeCheck);

            _BtnAdd.Click               += _BtnAdd_Click;
            _BtnRemove.Click            += _BtnRemove_Click;
            _ChangeCheck.Changed        += _ChangeCheck_Changed;
            _GridPoints.SelectedChanged += _GridPoints_SelectedChanged;

            _FFTime.ValueChanged       += SelectedPoint_ValueChanged;
            _VFValue.ValueChanged      += SelectedPoint_ValueChanged;
            _VFInTangent.ValueChanged  += SelectedPoint_ValueChanged;
            _VFOutTangent.ValueChanged += SelectedPoint_ValueChanged;

            _FFLinearTime.ValueChanged += _FFLinearTime_ValueChanged;
            _BtnSmoothPoint.Click      += _BtnSmoothPoint_Click;
            _BtnSmoothCurve.Click      += _BtnSmoothCurve_Click;
            _BtnSetLinearTime.Click    += _BtnSetLinearTime_Click;

            _SliSmoothValue.ValueChanged += _SliSmoothValue_ValueChanged;

            _LmGroundLayer.LayersChanged += _LmGroundLayer_LayersChanged;
            _BtnGroundSelected.Click     += _BtnGroundSelected_Click;
            _BtnGroundAll.Click          += _BtnGroundAll_Click;
        }
Ejemplo n.º 4
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;
        }
Ejemplo n.º 5
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;
        }