Beispiel #1
0
        protected override void InitUI(UIWidget layout)
        {
            EditorVerticalLayout innerLayout = new EditorVerticalLayout();

            innerLayout.InnerSpace = 10;
            layout.Add(innerLayout);

            {
                EditorHorizontalLayout hLayout = new EditorHorizontalLayout();
                hLayout.InnerSpace = 10;

                EditorPrefixLabel label = new EditorPrefixLabel();
                label.Text = "Asset Path :";
                hLayout.Add(label);

                bundleFolder.Text = "Open";
                string bundles = FilePath.BundlesPath;
                bundleFolder.Filepath = Path.Combine(EditorAssets.Root, bundles).Replace("\\", "/");
                hLayout.Add(bundleFolder);

                innerLayout.Add(hLayout);
            }
            {
                EditorHorizontalLayout hLayout = new EditorHorizontalLayout();
                hLayout.InnerSpace = 10;

                EditorPrefixLabel label = new EditorPrefixLabel();
                label.Text = "Out Path :";
                hLayout.Add(label);

                outputFolder.Filepath = Path.Combine(EditorAssets.Root, "Output").Replace("\\", "/");
                outputFolder.Text     = "Open";
                hLayout.Add(outputFolder);

                innerLayout.Add(hLayout);
            }

            {
                VerticalLayout vLayout = new VerticalLayout();
                vLayout.InnerSpace = 10;

                EditorIntPopup popup = new EditorIntPopup();
                popup.Text           = "Choose Platform :";
                popup.Value          = platformIndex;
                popup.TriggerHandler = (Widget w) =>
                {
                    platformIndex = popup.Value;
                };

                for (int i = 0; i < PlatformInfo.Count; i++)
                {
                    popup.Add(new EditorIntPopup.DisplayItem(PlatformInfo[i].name, PlatformInfo[i].index));
                }

                vLayout.Add(popup);

                GUIButton button = new GUIButton();
                button.Text           = "Pack";
                button.TriggerHandler = (Widget w) =>
                {
                    Pack((Platform)PlatformInfo[platformIndex].value, PlatformInfo[platformIndex].name);
                };
                vLayout.Add(button);

                innerLayout.Add(vLayout);
            }
        }
Beispiel #2
0
        protected override void InitUI(UIWidget layout)
        {
            UIFloatFieldWidget distance = new UIFloatFieldWidget("Distance", _distance);

            distance.OnValueChanged = (object value) =>
            {
                _distance = (float)value;
            };
            layout.Add(distance);

            layout.Add(new EditorHorizontalLine());

            UITextFieldWidget axis = new UITextFieldWidget("AXIS:", GetText());

            layout.Add(axis);

            EditorHorizontalLayout hlayout1 = new EditorHorizontalLayout();

            layout.Add(hlayout1);
            GUIButton axisX = new GUIButton();

            axisX.Text           = "X";
            axisX.TriggerHandler = (Widget w) =>
            {
                this.OrderBy(OrderAxis.X);
                this.SetText(axis);
            };
            hlayout1.Add(axisX);

            GUIButton axisY = new GUIButton();

            axisY.Text           = "Y";
            axisY.TriggerHandler = (Widget w) =>
            {
                this.OrderBy(OrderAxis.Y);
                this.SetText(axis);
            };
            hlayout1.Add(axisY);

            GUIButton axisZ = new GUIButton();

            axisZ.Text           = "Z";
            axisZ.TriggerHandler = (Widget w) =>
            {
                this.OrderBy(OrderAxis.Z);
                this.SetText(axis);
            };
            hlayout1.Add(axisZ);

            EditorPrefixLabel alignment = new EditorPrefixLabel();

            alignment.Text = "Alignment:";
            layout.Add(alignment);

            EditorHorizontalLayout hlayout2 = new EditorHorizontalLayout();

            layout.Add(hlayout2);

            GUIButton left = new GUIButton();

            left.ImagePath      = EditorAssets.GetResourcePath("Icons/layout_alignment_left.png");
            left.TriggerHandler = (Widget w) =>
            {
                this.OrderBy(TextAlignment.Left);
            };
            hlayout2.Add(left);

            GUIButton center = new GUIButton();

            center.ImagePath      = EditorAssets.GetResourcePath("Icons/layout_alignment_center.png");
            center.TriggerHandler = (Widget w) =>
            {
                this.OrderBy(TextAlignment.Center);
            };
            hlayout2.Add(center);

            GUIButton right = new GUIButton();

            right.ImagePath      = EditorAssets.GetResourcePath("Icons/layout_alignment_right.png");
            right.TriggerHandler = (Widget w) =>
            {
                this.OrderBy(TextAlignment.Right);
            };
            hlayout2.Add(right);
        }