Ejemplo n.º 1
0
    private static void DrawImage(Image image)
    {
        using (new GUILayout.HorizontalScope())
        {
            GUILayout.Label("Image", NitroxGUILayout.DrawerLabel, GUILayout.Width(NitroxGUILayout.DEFAULT_LABEL_WIDTH));
            NitroxGUILayout.Separator();
            DrawTexture(image.mainTexture);
        }

        using (new GUILayout.HorizontalScope())
        {
            GUILayout.Label("Color", NitroxGUILayout.DrawerLabel, GUILayout.Width(NitroxGUILayout.DEFAULT_LABEL_WIDTH));
            NitroxGUILayout.Separator();
            image.color = ColorDrawer.Draw(image.color);
        }

        using (new GUILayout.HorizontalScope())
        {
            GUILayout.Label("Material", NitroxGUILayout.DrawerLabel, GUILayout.Width(NitroxGUILayout.DEFAULT_LABEL_WIDTH));
            NitroxGUILayout.Separator();
            image.material = MaterialDrawer.Draw(image.material);
        }

        using (new GUILayout.HorizontalScope())
        {
            GUILayout.Label("Raycast Target", NitroxGUILayout.DrawerLabel, GUILayout.Width(NitroxGUILayout.DEFAULT_LABEL_WIDTH));
            NitroxGUILayout.Separator();
            image.raycastTarget = NitroxGUILayout.BoolField(image.raycastTarget);
        }
    }
Ejemplo n.º 2
0
    private static void DrawCanvasGroup(CanvasGroup canvasGroup)
    {
        using (new GUILayout.HorizontalScope())
        {
            GUILayout.Label("Alpha", NitroxGUILayout.DrawerLabel, GUILayout.Width(NitroxGUILayout.DEFAULT_LABEL_WIDTH));
            NitroxGUILayout.Separator();
            canvasGroup.alpha = NitroxGUILayout.SliderField(canvasGroup.alpha, 0f, 1f);
        }

        using (new GUILayout.HorizontalScope())
        {
            GUILayout.Label("Interactable", NitroxGUILayout.DrawerLabel, GUILayout.Width(NitroxGUILayout.DEFAULT_LABEL_WIDTH));
            NitroxGUILayout.Separator();
            canvasGroup.interactable = NitroxGUILayout.BoolField(canvasGroup.interactable);
        }

        using (new GUILayout.HorizontalScope())
        {
            GUILayout.Label("Blocks Raycasts", NitroxGUILayout.DrawerLabel, GUILayout.Width(NitroxGUILayout.DEFAULT_LABEL_WIDTH));
            NitroxGUILayout.Separator();
            canvasGroup.blocksRaycasts = NitroxGUILayout.BoolField(canvasGroup.blocksRaycasts);
        }

        using (new GUILayout.HorizontalScope())
        {
            GUILayout.Label("Ignore Parent Groups", NitroxGUILayout.DrawerLabel, GUILayout.Width(NitroxGUILayout.DEFAULT_LABEL_WIDTH));
            NitroxGUILayout.Separator();
            canvasGroup.ignoreParentGroups = NitroxGUILayout.BoolField(canvasGroup.ignoreParentGroups);
        }
    }
Ejemplo n.º 3
0
    private static void DrawLayoutElement(LayoutElement layoutElement)
    {
        using (new GUILayout.HorizontalScope())
        {
            GUILayout.Label("Ignore Layout", NitroxGUILayout.DrawerLabel, GUILayout.Width(LABEL_WIDTH));
            NitroxGUILayout.Separator();
            layoutElement.ignoreLayout = NitroxGUILayout.BoolField(layoutElement.ignoreLayout);
        }

        GUILayout.Space(8f);

        layoutElement.minWidth  = DrawToggleableFloat("Min Width", layoutElement.minWidth);
        layoutElement.minHeight = DrawToggleableFloat("Min Height", layoutElement.minHeight);

        layoutElement.preferredWidth  = DrawToggleableFloat("Preferred Width", layoutElement.preferredWidth);
        layoutElement.preferredHeight = DrawToggleableFloat("Preferred Height", layoutElement.preferredHeight);

        layoutElement.flexibleWidth  = DrawToggleableFloat("Flexible Width", layoutElement.flexibleWidth);
        layoutElement.flexibleHeight = DrawToggleableFloat("Flexible Height", layoutElement.flexibleHeight);

        using (new GUILayout.HorizontalScope())
        {
            GUILayout.Label("Layout Priority", NitroxGUILayout.DrawerLabel, GUILayout.Width(LABEL_WIDTH));
            NitroxGUILayout.Separator();
            layoutElement.layoutPriority = NitroxGUILayout.IntField(layoutElement.layoutPriority);
        }
    }
Ejemplo n.º 4
0
    private void DrawTransform(Transform transform)
    {
        using (new GUILayout.VerticalScope())
        {
            if (showGlobal)
            {
                using (new GUILayout.HorizontalScope())
                {
                    GUILayout.Label("Global Position", NitroxGUILayout.DrawerLabel, GUILayout.Width(LABEL_WIDTH));
                    NitroxGUILayout.Separator();
                    VectorDrawer.DrawVector3(transform.position, VECTOR_MAX_WIDTH);
                }

                using (new GUILayout.HorizontalScope())
                {
                    GUILayout.Label("Global Rotation", NitroxGUILayout.DrawerLabel, GUILayout.Width(LABEL_WIDTH));
                    NitroxGUILayout.Separator();
                    VectorDrawer.DrawVector3(transform.rotation.eulerAngles, VECTOR_MAX_WIDTH);
                }

                using (new GUILayout.HorizontalScope())
                {
                    GUILayout.Label("Lossy Scale", NitroxGUILayout.DrawerLabel, GUILayout.Width(LABEL_WIDTH));
                    NitroxGUILayout.Separator();
                    VectorDrawer.DrawVector3(transform.lossyScale, VECTOR_MAX_WIDTH);
                }
            }
            else
            {
                using (new GUILayout.HorizontalScope())
                {
                    GUILayout.Label("Local  Position", NitroxGUILayout.DrawerLabel, GUILayout.Width(LABEL_WIDTH));
                    NitroxGUILayout.Separator();
                    transform.localPosition = VectorDrawer.DrawVector3(transform.localPosition, VECTOR_MAX_WIDTH);
                }

                using (new GUILayout.HorizontalScope())
                {
                    GUILayout.Label("Local  Rotation", NitroxGUILayout.DrawerLabel, GUILayout.Width(LABEL_WIDTH));
                    NitroxGUILayout.Separator();
                    transform.localRotation = Quaternion.Euler(VectorDrawer.DrawVector3(transform.localRotation.eulerAngles, VECTOR_MAX_WIDTH));
                }

                using (new GUILayout.HorizontalScope())
                {
                    GUILayout.Label("Local  Scale", NitroxGUILayout.DrawerLabel, GUILayout.Width(LABEL_WIDTH));
                    NitroxGUILayout.Separator();
                    transform.localScale = VectorDrawer.DrawVector3(transform.localScale, VECTOR_MAX_WIDTH);
                }
            }

            GUILayout.Space(5);

            if (GUILayout.Button("Toggle Local/Global", GUILayout.MaxWidth(125)))
            {
                showGlobal = !showGlobal;
            }
        }
    }
Ejemplo n.º 5
0
 private static void DrawCanvasRenderer(CanvasRenderer canvasRenderer)
 {
     using (new GUILayout.HorizontalScope())
     {
         GUILayout.Label("Raycast Target", NitroxGUILayout.DrawerLabel, GUILayout.Width(NitroxGUILayout.DEFAULT_LABEL_WIDTH));
         NitroxGUILayout.Separator();
         canvasRenderer.cullTransparentMesh = NitroxGUILayout.BoolField(canvasRenderer.cullTransparentMesh);
     }
 }
Ejemplo n.º 6
0
 private static void DrawToggleGroup(ToggleGroup toggleGroup)
 {
     using (new GUILayout.HorizontalScope())
     {
         GUILayout.Label("Allow Switch Off", NitroxGUILayout.DrawerLabel, GUILayout.Width(NitroxGUILayout.DEFAULT_LABEL_WIDTH));
         NitroxGUILayout.Separator();
         toggleGroup.allowSwitchOff = NitroxGUILayout.BoolField(toggleGroup.allowSwitchOff);
     }
 }
Ejemplo n.º 7
0
 private static void DrawNitroxId(NitroxId nitroxId)
 {
     using (new GUILayout.HorizontalScope())
     {
         GUILayout.Label("NitroxId", GUILayout.Width(LABEL_WIDTH));
         NitroxGUILayout.Separator();
         GUILayout.TextField(nitroxId == null ? "ID IS NULL!!!" : nitroxId.ToString());
     }
 }
Ejemplo n.º 8
0
 private static void DrawMask(Mask mask)
 {
     using (new GUILayout.HorizontalScope())
     {
         GUILayout.Label("Show Mask Graphic", NitroxGUILayout.DrawerLabel, GUILayout.Width(NitroxGUILayout.DEFAULT_LABEL_WIDTH));
         NitroxGUILayout.Separator();
         mask.showMaskGraphic = NitroxGUILayout.BoolField(mask.showMaskGraphic);
     }
 }
Ejemplo n.º 9
0
 public static void DrawUnityEventBase(UnityEventBase unityEventBase)
 {
     for (int index = 0; index < unityEventBase.GetPersistentEventCount(); index++)
     {
         using (new GUILayout.HorizontalScope())
         {
             NitroxGUILayout.Separator();
             GUILayout.Label(unityEventBase.GetPersistentMethodName(index), NitroxGUILayout.DrawerLabel, GUILayout.Width(LABEL_WIDTH));
         }
     }
 }
Ejemplo n.º 10
0
    private static void DrawLayoutGroup(HorizontalOrVerticalLayoutGroup layoutGroup)
    {
        using (new GUILayout.HorizontalScope())
        {
            GUILayout.Label("Padding", NitroxGUILayout.DrawerLabel, GUILayout.Width(NitroxGUILayout.DEFAULT_LABEL_WIDTH));
            NitroxGUILayout.Separator();
            Tuple <int, int, int, int> padding = VectorDrawer.DrawInt4(layoutGroup.padding.left, layoutGroup.padding.right,
                                                                       layoutGroup.padding.top, layoutGroup.padding.bottom);

            layoutGroup.padding.left   = padding.Item1;
            layoutGroup.padding.right  = padding.Item2;
            layoutGroup.padding.top    = padding.Item3;
            layoutGroup.padding.bottom = padding.Item4;
        }

        using (new GUILayout.HorizontalScope())
        {
            GUILayout.Label("Spacing", NitroxGUILayout.DrawerLabel, GUILayout.Width(NitroxGUILayout.DEFAULT_LABEL_WIDTH));
            NitroxGUILayout.Separator();
            layoutGroup.spacing = NitroxGUILayout.FloatField(layoutGroup.spacing);
        }

        using (new GUILayout.HorizontalScope())
        {
            GUILayout.Label("Child Alignment", NitroxGUILayout.DrawerLabel, GUILayout.Width(NitroxGUILayout.DEFAULT_LABEL_WIDTH));
            NitroxGUILayout.Separator();
            layoutGroup.childAlignment = NitroxGUILayout.EnumPopup(layoutGroup.childAlignment);
        }

        using (new GUILayout.HorizontalScope())
        {
            GUILayout.Label("Control Child Size", NitroxGUILayout.DrawerLabel, GUILayout.Width(NitroxGUILayout.DEFAULT_LABEL_WIDTH));
            NitroxGUILayout.Separator();
            layoutGroup.childControlWidth  = NitroxGUILayout.BoolField(layoutGroup.childControlWidth, "Width");
            layoutGroup.childControlHeight = NitroxGUILayout.BoolField(layoutGroup.childControlHeight, "Height");
        }

        using (new GUILayout.HorizontalScope())
        {
            GUILayout.Label("Use Child Scale", NitroxGUILayout.DrawerLabel, GUILayout.Width(NitroxGUILayout.DEFAULT_LABEL_WIDTH));
            NitroxGUILayout.Separator();
            layoutGroup.childScaleWidth  = NitroxGUILayout.BoolField(layoutGroup.childScaleWidth, "Width");
            layoutGroup.childScaleHeight = NitroxGUILayout.BoolField(layoutGroup.childScaleHeight, "Height");
        }

        using (new GUILayout.HorizontalScope())
        {
            GUILayout.Label("Child Force Expand", NitroxGUILayout.DrawerLabel, GUILayout.Width(NitroxGUILayout.DEFAULT_LABEL_WIDTH));
            NitroxGUILayout.Separator();
            layoutGroup.childForceExpandWidth  = NitroxGUILayout.BoolField(layoutGroup.childForceExpandWidth, "Width");
            layoutGroup.childForceExpandHeight = NitroxGUILayout.BoolField(layoutGroup.childForceExpandHeight, "Height");
        }
    }
Ejemplo n.º 11
0
    private static void DrawNitroxEntity(NitroxEntity nitroxEntity)
    {
        DrawNitroxId(nitroxEntity.Id);

        GUILayout.Space(8);

        using (new GUILayout.HorizontalScope())
        {
            GUILayout.Label("GameObject with IDs", GUILayout.Width(LABEL_WIDTH));
            NitroxGUILayout.Separator();
            GUILayout.TextField(NitroxEntity.GetGameObjects().Count().ToString());
        }
    }
Ejemplo n.º 12
0
    private static void DrawScrollbar(Scrollbar scrollbar)
    {
        SelectableDrawer.DrawSelectable(scrollbar);

        GUILayout.Space(10);

        using (new GUILayout.HorizontalScope())
        {
            GUILayout.Label("Handle Rect", NitroxGUILayout.DrawerLabel, GUILayout.Width(NitroxGUILayout.DEFAULT_LABEL_WIDTH));
            NitroxGUILayout.Separator();
            if (GUILayout.Button("Jump to", GUILayout.Width(NitroxGUILayout.DEFAULT_LABEL_WIDTH)))
            {
                NitroxServiceLocator.Cache <SceneDebugger> .Value.JumpToComponent(scrollbar.handleRect);
            }
        }

        using (new GUILayout.HorizontalScope())
        {
            GUILayout.Label("Direction", NitroxGUILayout.DrawerLabel, GUILayout.Width(NitroxGUILayout.DEFAULT_LABEL_WIDTH));
            NitroxGUILayout.Separator();
            scrollbar.direction = NitroxGUILayout.EnumPopup(scrollbar.direction);
        }

        using (new GUILayout.HorizontalScope())
        {
            GUILayout.Label("Value", NitroxGUILayout.DrawerLabel, GUILayout.Width(NitroxGUILayout.DEFAULT_LABEL_WIDTH));
            NitroxGUILayout.Separator();
            scrollbar.value = NitroxGUILayout.SliderField(scrollbar.value, 0f, 1f);
        }

        using (new GUILayout.HorizontalScope())
        {
            GUILayout.Label("Size", NitroxGUILayout.DrawerLabel, GUILayout.Width(NitroxGUILayout.DEFAULT_LABEL_WIDTH));
            NitroxGUILayout.Separator();
            scrollbar.size = NitroxGUILayout.SliderField(scrollbar.size, 0f, 1f);
        }

        using (new GUILayout.HorizontalScope())
        {
            GUILayout.Label("Number Of Steps", NitroxGUILayout.DrawerLabel, GUILayout.Width(NitroxGUILayout.DEFAULT_LABEL_WIDTH));
            NitroxGUILayout.Separator();
            scrollbar.numberOfSteps = NitroxGUILayout.SliderField(scrollbar.numberOfSteps, 0, 11);
        }

        using (new GUILayout.HorizontalScope())
        {
            GUILayout.Label("On Value Changed", NitroxGUILayout.DrawerLabel, GUILayout.Width(NitroxGUILayout.DEFAULT_LABEL_WIDTH));
            NitroxGUILayout.Separator();
            GUILayout.Button("Unsupported", GUILayout.Width(NitroxGUILayout.DEFAULT_LABEL_WIDTH));
        }
    }
Ejemplo n.º 13
0
    public static void DrawUnityEvent(UnityEvent unityEvent, string name = "NoName")
    {
        using (new GUILayout.HorizontalScope())
        {
            GUILayout.Label(name, NitroxGUILayout.DrawerLabel, GUILayout.Width(LABEL_WIDTH));
            NitroxGUILayout.Separator();
            if (GUILayout.Button("Invoke All", GUILayout.Width(100)))
            {
                unityEvent.Invoke();
            }
        }

        DrawUnityEventBase(unityEvent);
    }
Ejemplo n.º 14
0
    private static void DrawContentSizeFitter(ContentSizeFitter contentSizeFitter)
    {
        using (new GUILayout.HorizontalScope())
        {
            GUILayout.Label("Horizontal Fit", NitroxGUILayout.DrawerLabel, GUILayout.Width(NitroxGUILayout.DEFAULT_LABEL_WIDTH));
            NitroxGUILayout.Separator();
            contentSizeFitter.horizontalFit = NitroxGUILayout.EnumPopup(contentSizeFitter.horizontalFit);
        }

        using (new GUILayout.HorizontalScope())
        {
            GUILayout.Label("Vertical Fit", NitroxGUILayout.DrawerLabel, GUILayout.Width(NitroxGUILayout.DEFAULT_LABEL_WIDTH));
            NitroxGUILayout.Separator();
            contentSizeFitter.verticalFit = NitroxGUILayout.EnumPopup(contentSizeFitter.verticalFit);
        }
    }
Ejemplo n.º 15
0
    private static float DrawToggleableFloat(string name, float value)
    {
        using (new GUILayout.HorizontalScope())
        {
            GUILayout.Label(name, NitroxGUILayout.DrawerLabel, GUILayout.Width(LABEL_WIDTH));
            NitroxGUILayout.Separator();

            bool active = value >= 0;
            if (GUILayout.Button(active ? "X" : " ", GUILayout.Width(25)))
            {
                value = active ? -1 : 0;
            }

            return(Math.Max(-1, NitroxGUILayout.FloatField(value)));
        }
    }
Ejemplo n.º 16
0
    private static void DrawGraphicRaycaster(GraphicRaycaster graphicRaycaster)
    {
        using (new GUILayout.HorizontalScope())
        {
            GUILayout.Label("Ignore Reversed Graphics", NitroxGUILayout.DrawerLabel, GUILayout.Width(NitroxGUILayout.DEFAULT_LABEL_WIDTH));
            NitroxGUILayout.Separator();
            graphicRaycaster.ignoreReversedGraphics = NitroxGUILayout.BoolField(graphicRaycaster.ignoreReversedGraphics);
        }

        using (new GUILayout.HorizontalScope())
        {
            GUILayout.Label("Blocking Objects", NitroxGUILayout.DrawerLabel, GUILayout.Width(NitroxGUILayout.DEFAULT_LABEL_WIDTH));
            NitroxGUILayout.Separator();
            graphicRaycaster.blockingObjects = NitroxGUILayout.EnumPopup(graphicRaycaster.blockingObjects);
        }
    }
Ejemplo n.º 17
0
    private static void DrawToggle(Toggle toggle)
    {
        SelectableDrawer.DrawSelectable(toggle);
        GUILayout.Space(10);

        using (new GUILayout.HorizontalScope())
        {
            GUILayout.Label("Is On", GUILayout.Width(NitroxGUILayout.DEFAULT_LABEL_WIDTH));
            NitroxGUILayout.Separator();
            toggle.isOn = NitroxGUILayout.BoolField(toggle.isOn);
        }

        using (new GUILayout.HorizontalScope())
        {
            GUILayout.Label("Toggle Transition", NitroxGUILayout.DrawerLabel, GUILayout.Width(NitroxGUILayout.DEFAULT_LABEL_WIDTH));
            NitroxGUILayout.Separator();
            toggle.toggleTransition = NitroxGUILayout.EnumPopup(toggle.toggleTransition);
        }

        using (new GUILayout.HorizontalScope())
        {
            GUILayout.Label("Graphic", NitroxGUILayout.DrawerLabel, GUILayout.Width(NitroxGUILayout.DEFAULT_LABEL_WIDTH));
            NitroxGUILayout.Separator();
            if (GUILayout.Button("Jump to", GUILayout.Width(NitroxGUILayout.DEFAULT_LABEL_WIDTH)))
            {
                NitroxServiceLocator.Cache <SceneDebugger> .Value.UpdateSelectedObject(toggle.graphic.gameObject);
            }
        }

        using (new GUILayout.HorizontalScope())
        {
            GUILayout.Label("Group", NitroxGUILayout.DrawerLabel, GUILayout.Width(NitroxGUILayout.DEFAULT_LABEL_WIDTH));
            NitroxGUILayout.Separator();
            if (GUILayout.Button("Jump to", GUILayout.Width(NitroxGUILayout.DEFAULT_LABEL_WIDTH)))
            {
                NitroxServiceLocator.Cache <SceneDebugger> .Value.UpdateSelectedObject(toggle.group.gameObject);
            }
        }

        UnityEventDrawer.DrawUnityEventBool(toggle.onValueChanged, "OnClick()");
    }
Ejemplo n.º 18
0
    private static void DrawTransitionSpriteSwap(Selectable selectable)
    {
        using (new GUILayout.HorizontalScope())
        {
            GUILayout.Label("Target Graphic", NitroxGUILayout.DrawerLabel, GUILayout.Width(NitroxGUILayout.DEFAULT_LABEL_WIDTH));
            NitroxGUILayout.Separator();
            if (GUILayout.Button("Jump to", GUILayout.Width(NitroxGUILayout.DEFAULT_LABEL_WIDTH)))
            {
                NitroxServiceLocator.Cache <SceneDebugger> .Value.UpdateSelectedObject(selectable.targetGraphic.gameObject);
            }
        }

        using (new GUILayout.HorizontalScope())
        {
            GUILayout.Label("Highlighted Sprite", NitroxGUILayout.DrawerLabel, GUILayout.Width(NitroxGUILayout.DEFAULT_LABEL_WIDTH));
            NitroxGUILayout.Separator();
            ImageDrawer.DrawTexture(selectable.spriteState.highlightedSprite.texture);
        }

        using (new GUILayout.HorizontalScope())
        {
            GUILayout.Label("Pressed Sprite", NitroxGUILayout.DrawerLabel, GUILayout.Width(NitroxGUILayout.DEFAULT_LABEL_WIDTH));
            NitroxGUILayout.Separator();
            ImageDrawer.DrawTexture(selectable.spriteState.pressedSprite.texture);
        }

        using (new GUILayout.HorizontalScope())
        {
            GUILayout.Label("Selected Sprite", NitroxGUILayout.DrawerLabel, GUILayout.Width(NitroxGUILayout.DEFAULT_LABEL_WIDTH));
            NitroxGUILayout.Separator();
            ImageDrawer.DrawTexture(selectable.spriteState.selectedSprite.texture);
        }

        using (new GUILayout.HorizontalScope())
        {
            GUILayout.Label("Disabled Sprite", NitroxGUILayout.DrawerLabel, GUILayout.Width(NitroxGUILayout.DEFAULT_LABEL_WIDTH));
            NitroxGUILayout.Separator();
            ImageDrawer.DrawTexture(selectable.spriteState.disabledSprite.texture);
        }
    }
Ejemplo n.º 19
0
    public static void DrawSelectable(Selectable selectable)
    {
        using (new GUILayout.HorizontalScope())
        {
            GUILayout.Label("Interactable", NitroxGUILayout.DrawerLabel, GUILayout.Width(NitroxGUILayout.DEFAULT_LABEL_WIDTH));
            NitroxGUILayout.Separator();
            selectable.interactable = NitroxGUILayout.BoolField(selectable.interactable);
        }

        using (new GUILayout.HorizontalScope())
        {
            GUILayout.Label("Transition", NitroxGUILayout.DrawerLabel, GUILayout.Width(NitroxGUILayout.DEFAULT_LABEL_WIDTH));
            NitroxGUILayout.Separator();
            selectable.transition = NitroxGUILayout.EnumPopup(selectable.transition);
        }

        switch (selectable.transition)
        {
        case Selectable.Transition.ColorTint:
            DrawTransitionColorTint(selectable);
            break;

        case Selectable.Transition.SpriteSwap:
            DrawTransitionSpriteSwap(selectable);
            break;

        case Selectable.Transition.Animation:
            DrawTransitionAnimation(selectable);
            break;
        }

        using (new GUILayout.HorizontalScope())
        {
            GUILayout.Label("Navigation", NitroxGUILayout.DrawerLabel, GUILayout.Width(NitroxGUILayout.DEFAULT_LABEL_WIDTH));
            NitroxGUILayout.Separator();
            NitroxGUILayout.EnumPopup(selectable.navigation.mode);
        }
    }
Ejemplo n.º 20
0
    private static void DrawTransitionAnimation(Selectable selectable)
    {
        using (new GUILayout.HorizontalScope())
        {
            GUILayout.Label("Normal Trigger", NitroxGUILayout.DrawerLabel, GUILayout.Width(NitroxGUILayout.DEFAULT_LABEL_WIDTH));
            NitroxGUILayout.Separator();
            selectable.animationTriggers.normalTrigger = GUILayout.TextField(selectable.animationTriggers.normalTrigger);
        }

        using (new GUILayout.HorizontalScope())
        {
            GUILayout.Label("Highlighted Trigger", NitroxGUILayout.DrawerLabel, GUILayout.Width(NitroxGUILayout.DEFAULT_LABEL_WIDTH));
            NitroxGUILayout.Separator();
            selectable.animationTriggers.highlightedTrigger = GUILayout.TextField(selectable.animationTriggers.highlightedTrigger);
        }

        using (new GUILayout.HorizontalScope())
        {
            GUILayout.Label("Pressed Trigger", NitroxGUILayout.DrawerLabel, GUILayout.Width(NitroxGUILayout.DEFAULT_LABEL_WIDTH));
            NitroxGUILayout.Separator();
            selectable.animationTriggers.pressedTrigger = GUILayout.TextField(selectable.animationTriggers.pressedTrigger);
        }

        using (new GUILayout.HorizontalScope())
        {
            GUILayout.Label("Selected Trigger", NitroxGUILayout.DrawerLabel, GUILayout.Width(NitroxGUILayout.DEFAULT_LABEL_WIDTH));
            NitroxGUILayout.Separator();
            selectable.animationTriggers.selectedTrigger = GUILayout.TextField(selectable.animationTriggers.selectedTrigger);
        }

        using (new GUILayout.HorizontalScope())
        {
            GUILayout.Label("Disabled Trigger", NitroxGUILayout.DrawerLabel, GUILayout.Width(NitroxGUILayout.DEFAULT_LABEL_WIDTH));
            NitroxGUILayout.Separator();
            selectable.animationTriggers.disabledTrigger = GUILayout.TextField(selectable.animationTriggers.disabledTrigger);
        }
    }
Ejemplo n.º 21
0
    private static void DrawAspectRatioFitter(AspectRatioFitter aspectRatioFitter)
    {
        using (new GUILayout.HorizontalScope())
        {
            GUILayout.Label("Aspect Mode", NitroxGUILayout.DrawerLabel, GUILayout.Width(NitroxGUILayout.DEFAULT_LABEL_WIDTH));
            NitroxGUILayout.Separator();
            aspectRatioFitter.aspectMode = NitroxGUILayout.EnumPopup(aspectRatioFitter.aspectMode);
        }

        using (new GUILayout.HorizontalScope())
        {
            GUILayout.Label("Aspect Ratio", NitroxGUILayout.DrawerLabel, GUILayout.Width(NitroxGUILayout.DEFAULT_LABEL_WIDTH));
            NitroxGUILayout.Separator();

            if (aspectRatioFitter.aspectMode == AspectRatioFitter.AspectMode.None)
            {
                NitroxGUILayout.FloatField(aspectRatioFitter.aspectRatio);
            }
            else
            {
                aspectRatioFitter.aspectRatio = NitroxGUILayout.FloatField(aspectRatioFitter.aspectRatio);
            }
        }
    }
Ejemplo n.º 22
0
    private static void DrawTransitionColorTint(Selectable selectable)
    {
        using (new GUILayout.HorizontalScope())
        {
            GUILayout.Label("Target Graphic", NitroxGUILayout.DrawerLabel, GUILayout.Width(NitroxGUILayout.DEFAULT_LABEL_WIDTH));
            NitroxGUILayout.Separator();
            if (GUILayout.Button("Jump to", GUILayout.Width(NitroxGUILayout.VALUE_WIDTH)))
            {
                NitroxServiceLocator.Cache <SceneDebugger> .Value.UpdateSelectedObject(selectable.targetGraphic.gameObject);
            }
        }

        Color normalColor, highlightedColor, pressedColor, selectedColor, disabledColor;
        float colorMultiplier, fadeDuration;

        using (new GUILayout.HorizontalScope())
        {
            GUILayout.Label("Normal Color", NitroxGUILayout.DrawerLabel, GUILayout.Width(NitroxGUILayout.DEFAULT_LABEL_WIDTH));
            NitroxGUILayout.Separator();
            normalColor = ColorDrawer.Draw(selectable.colors.normalColor);
        }

        using (new GUILayout.HorizontalScope())
        {
            GUILayout.Label("Highlighted Color", NitroxGUILayout.DrawerLabel, GUILayout.Width(NitroxGUILayout.DEFAULT_LABEL_WIDTH));
            NitroxGUILayout.Separator();
            highlightedColor = ColorDrawer.Draw(selectable.colors.highlightedColor);
        }

        using (new GUILayout.HorizontalScope())
        {
            GUILayout.Label("Pressed Color", NitroxGUILayout.DrawerLabel, GUILayout.Width(NitroxGUILayout.DEFAULT_LABEL_WIDTH));
            NitroxGUILayout.Separator();
            pressedColor = ColorDrawer.Draw(selectable.colors.pressedColor);
        }

        using (new GUILayout.HorizontalScope())
        {
            GUILayout.Label("Selected Color", NitroxGUILayout.DrawerLabel, GUILayout.Width(NitroxGUILayout.DEFAULT_LABEL_WIDTH));
            NitroxGUILayout.Separator();
            selectedColor = ColorDrawer.Draw(selectable.colors.selectedColor);
        }

        using (new GUILayout.HorizontalScope())
        {
            GUILayout.Label("Disabled Color", NitroxGUILayout.DrawerLabel, GUILayout.Width(NitroxGUILayout.DEFAULT_LABEL_WIDTH));
            NitroxGUILayout.Separator();
            disabledColor = ColorDrawer.Draw(selectable.colors.disabledColor);
        }

        using (new GUILayout.HorizontalScope())
        {
            GUILayout.Label("Color Multiplier", NitroxGUILayout.DrawerLabel, GUILayout.Width(NitroxGUILayout.DEFAULT_LABEL_WIDTH));
            NitroxGUILayout.Separator();
            colorMultiplier = NitroxGUILayout.SliderField(selectable.colors.colorMultiplier, 1, 5);
        }

        using (new GUILayout.HorizontalScope())
        {
            GUILayout.Label("Fader Duration", NitroxGUILayout.DrawerLabel, GUILayout.Width(NitroxGUILayout.DEFAULT_LABEL_WIDTH));
            NitroxGUILayout.Separator();
            fadeDuration = NitroxGUILayout.SliderField(selectable.colors.fadeDuration, 1, 5);
        }

        selectable.colors = new ColorBlock
        {
            normalColor      = normalColor,
            highlightedColor = highlightedColor,
            pressedColor     = pressedColor,
            selectedColor    = selectedColor,
            disabledColor    = disabledColor,
            colorMultiplier  = colorMultiplier,
            fadeDuration     = fadeDuration
        };
    }
Ejemplo n.º 23
0
    private static void DrawInputField(InputField inputField)
    {
        SelectableDrawer.DrawSelectable(inputField);

        GUILayout.Space(NitroxGUILayout.DEFAULT_SPACE);

        using (new GUILayout.HorizontalScope())
        {
            GUILayout.Label("Text Component", NitroxGUILayout.DrawerLabel, GUILayout.Width(NitroxGUILayout.DEFAULT_LABEL_WIDTH));
            NitroxGUILayout.Separator();
            if (GUILayout.Button("Jump to", GUILayout.Width(NitroxGUILayout.DEFAULT_LABEL_WIDTH)))
            {
                NitroxServiceLocator.Cache <SceneDebugger> .Value.JumpToComponent(inputField.textComponent);
            }
        }

        using (new GUILayout.HorizontalScope())
        {
            GUILayout.Label("Text", NitroxGUILayout.DrawerLabel, GUILayout.Width(NitroxGUILayout.DEFAULT_LABEL_WIDTH));
            NitroxGUILayout.Separator();
            inputField.text = GUILayout.TextArea(inputField.text, GUILayout.MaxHeight(100));
        }

        using (new GUILayout.HorizontalScope())
        {
            GUILayout.Label("Character Limit", NitroxGUILayout.DrawerLabel, GUILayout.Width(NitroxGUILayout.DEFAULT_LABEL_WIDTH));
            NitroxGUILayout.Separator();
            inputField.characterLimit = NitroxGUILayout.IntField(inputField.characterLimit);
        }

        GUILayout.Space(NitroxGUILayout.DEFAULT_SPACE);

        using (new GUILayout.HorizontalScope())
        {
            GUILayout.Label("Content Type", NitroxGUILayout.DrawerLabel, GUILayout.Width(NitroxGUILayout.DEFAULT_LABEL_WIDTH));
            NitroxGUILayout.Separator();
            inputField.contentType = NitroxGUILayout.EnumPopup(inputField.contentType);
        }

        using (new GUILayout.HorizontalScope())
        {
            GUILayout.Label("Line Type", NitroxGUILayout.DrawerLabel, GUILayout.Width(NitroxGUILayout.DEFAULT_LABEL_WIDTH));
            NitroxGUILayout.Separator();
            inputField.lineType = NitroxGUILayout.EnumPopup(inputField.lineType);
        }

        GUILayout.Space(NitroxGUILayout.DEFAULT_SPACE);

        using (new GUILayout.HorizontalScope())
        {
            GUILayout.Label("Placeholder", NitroxGUILayout.DrawerLabel, GUILayout.Width(NitroxGUILayout.DEFAULT_LABEL_WIDTH));
            NitroxGUILayout.Separator();
            if (GUILayout.Button("Jump to", GUILayout.Width(NitroxGUILayout.DEFAULT_LABEL_WIDTH)))
            {
                NitroxServiceLocator.Cache <SceneDebugger> .Value.JumpToComponent(inputField.placeholder);
            }
        }

        using (new GUILayout.HorizontalScope())
        {
            GUILayout.Label("Caret Blink Rate", NitroxGUILayout.DrawerLabel, GUILayout.Width(NitroxGUILayout.DEFAULT_LABEL_WIDTH));
            NitroxGUILayout.Separator();
            inputField.caretBlinkRate = NitroxGUILayout.SliderField(inputField.caretBlinkRate, 0f, 4f);
        }

        using (new GUILayout.HorizontalScope())
        {
            GUILayout.Label("Caret Width", NitroxGUILayout.DrawerLabel, GUILayout.Width(NitroxGUILayout.DEFAULT_LABEL_WIDTH));
            NitroxGUILayout.Separator();
            inputField.caretWidth = NitroxGUILayout.SliderField(inputField.caretWidth, 1, 5);
        }

        using (new GUILayout.HorizontalScope())
        {
            GUILayout.Label("Custom Caret Color", NitroxGUILayout.DrawerLabel, GUILayout.Width(NitroxGUILayout.DEFAULT_LABEL_WIDTH));
            NitroxGUILayout.Separator();
            inputField.customCaretColor = NitroxGUILayout.BoolField(inputField.customCaretColor);
        }

        if (inputField.customCaretColor)
        {
            using (new GUILayout.HorizontalScope())
            {
                GUILayout.Label("Caret Color", NitroxGUILayout.DrawerLabel, GUILayout.Width(NitroxGUILayout.DEFAULT_LABEL_WIDTH));
                NitroxGUILayout.Separator();
                inputField.caretColor = ColorDrawer.Draw(inputField.caretColor);
            }
        }

        using (new GUILayout.HorizontalScope())
        {
            GUILayout.Label("Selection Color", NitroxGUILayout.DrawerLabel, GUILayout.Width(NitroxGUILayout.DEFAULT_LABEL_WIDTH));
            NitroxGUILayout.Separator();
            inputField.selectionColor = ColorDrawer.Draw(inputField.selectionColor);
        }

        using (new GUILayout.HorizontalScope())
        {
            GUILayout.Label("Hide Mobile Input", NitroxGUILayout.DrawerLabel, GUILayout.Width(NitroxGUILayout.DEFAULT_LABEL_WIDTH));
            NitroxGUILayout.Separator();
            inputField.shouldHideMobileInput = NitroxGUILayout.BoolField(inputField.shouldHideMobileInput);
        }

        using (new GUILayout.HorizontalScope())
        {
            GUILayout.Label("Read Only", NitroxGUILayout.DrawerLabel, GUILayout.Width(NitroxGUILayout.DEFAULT_LABEL_WIDTH));
            NitroxGUILayout.Separator();
            inputField.readOnly = NitroxGUILayout.BoolField(inputField.readOnly);
        }

        GUILayout.Space(NitroxGUILayout.DEFAULT_SPACE);

        using (new GUILayout.HorizontalScope())
        {
            GUILayout.Label("On Value Changed", NitroxGUILayout.DrawerLabel, GUILayout.Width(NitroxGUILayout.DEFAULT_LABEL_WIDTH));
            NitroxGUILayout.Separator();
            GUILayout.Button("Unsupported", GUILayout.Width(NitroxGUILayout.DEFAULT_LABEL_WIDTH));
        }

        using (new GUILayout.HorizontalScope())
        {
            GUILayout.Label("On End Edit", NitroxGUILayout.DrawerLabel, GUILayout.Width(NitroxGUILayout.DEFAULT_LABEL_WIDTH));
            NitroxGUILayout.Separator();
            GUILayout.Button("Unsupported", GUILayout.Width(NitroxGUILayout.DEFAULT_LABEL_WIDTH));
        }
    }
Ejemplo n.º 24
0
    private static void DrawScrollRect(ScrollRect scrollRect)
    {
        using (new GUILayout.HorizontalScope())
        {
            GUILayout.Label("Content", NitroxGUILayout.DrawerLabel, GUILayout.Width(NitroxGUILayout.DEFAULT_LABEL_WIDTH));
            NitroxGUILayout.Separator();
            if (GUILayout.Button("Jump to", GUILayout.Width(NitroxGUILayout.DEFAULT_LABEL_WIDTH)))
            {
                NitroxServiceLocator.Cache <SceneDebugger> .Value.JumpToComponent(scrollRect.content);
            }
        }

        using (new GUILayout.HorizontalScope())
        {
            GUILayout.Label("Horizontal", NitroxGUILayout.DrawerLabel, GUILayout.Width(NitroxGUILayout.DEFAULT_LABEL_WIDTH));
            NitroxGUILayout.Separator();
            scrollRect.horizontal = NitroxGUILayout.BoolField(scrollRect.horizontal);
        }

        using (new GUILayout.HorizontalScope())
        {
            GUILayout.Label("Vertical", NitroxGUILayout.DrawerLabel, GUILayout.Width(NitroxGUILayout.DEFAULT_LABEL_WIDTH));
            NitroxGUILayout.Separator();
            scrollRect.vertical = NitroxGUILayout.BoolField(scrollRect.vertical);
        }

        using (new GUILayout.HorizontalScope())
        {
            GUILayout.Label("MovementType", NitroxGUILayout.DrawerLabel, GUILayout.Width(NitroxGUILayout.DEFAULT_LABEL_WIDTH));
            NitroxGUILayout.Separator();
            scrollRect.movementType = NitroxGUILayout.EnumPopup(scrollRect.movementType);
        }

        if (scrollRect.movementType == ScrollRect.MovementType.Elastic)
        {
            using (new GUILayout.HorizontalScope())
            {
                GUILayout.Label("Elasticity", NitroxGUILayout.DrawerLabel, GUILayout.Width(NitroxGUILayout.DEFAULT_LABEL_WIDTH));
                NitroxGUILayout.Separator();
                scrollRect.elasticity = NitroxGUILayout.FloatField(scrollRect.elasticity);
            }
        }

        using (new GUILayout.HorizontalScope())
        {
            GUILayout.Label("Inertia", NitroxGUILayout.DrawerLabel, GUILayout.Width(NitroxGUILayout.DEFAULT_LABEL_WIDTH));
            NitroxGUILayout.Separator();
            scrollRect.inertia = NitroxGUILayout.BoolField(scrollRect.inertia);
        }

        if (scrollRect.inertia)
        {
            using (new GUILayout.HorizontalScope())
            {
                GUILayout.Label("Deceleration Rate", NitroxGUILayout.DrawerLabel, GUILayout.Width(NitroxGUILayout.DEFAULT_LABEL_WIDTH));
                NitroxGUILayout.Separator();
                scrollRect.decelerationRate = NitroxGUILayout.FloatField(scrollRect.decelerationRate);
            }
        }

        using (new GUILayout.HorizontalScope())
        {
            GUILayout.Label("Scroll Sensitivity", NitroxGUILayout.DrawerLabel, GUILayout.Width(NitroxGUILayout.DEFAULT_LABEL_WIDTH));
            NitroxGUILayout.Separator();
            scrollRect.scrollSensitivity = NitroxGUILayout.FloatField(scrollRect.scrollSensitivity);
        }

        GUILayout.Space(8f);

        using (new GUILayout.HorizontalScope())
        {
            GUILayout.Label("Viewport", NitroxGUILayout.DrawerLabel, GUILayout.Width(NitroxGUILayout.DEFAULT_LABEL_WIDTH));
            NitroxGUILayout.Separator();
            if (GUILayout.Button("Jump to", GUILayout.Width(NitroxGUILayout.DEFAULT_LABEL_WIDTH)))
            {
                NitroxServiceLocator.Cache <SceneDebugger> .Value.JumpToComponent(scrollRect.viewport);
            }
        }

        using (new GUILayout.HorizontalScope())
        {
            GUILayout.Label("Horizontal Scrollbar", NitroxGUILayout.DrawerLabel, GUILayout.Width(NitroxGUILayout.DEFAULT_LABEL_WIDTH));
            NitroxGUILayout.Separator();
            if (GUILayout.Button("Jump to", GUILayout.Width(NitroxGUILayout.DEFAULT_LABEL_WIDTH)))
            {
                NitroxServiceLocator.Cache <SceneDebugger> .Value.JumpToComponent(scrollRect.horizontalScrollbar);
            }
        }

        using (new GUILayout.HorizontalScope())
        {
            GUILayout.Label("Vertical Scrollbar", NitroxGUILayout.DrawerLabel, GUILayout.Width(NitroxGUILayout.DEFAULT_LABEL_WIDTH));
            NitroxGUILayout.Separator();
            if (GUILayout.Button("Jump to", GUILayout.Width(NitroxGUILayout.DEFAULT_LABEL_WIDTH)))
            {
                NitroxServiceLocator.Cache <SceneDebugger> .Value.JumpToComponent(scrollRect.verticalScrollbar);
            }
        }

        using (new GUILayout.HorizontalScope())
        {
            GUILayout.Label("On Value Changed", NitroxGUILayout.DrawerLabel, GUILayout.Width(NitroxGUILayout.DEFAULT_LABEL_WIDTH));
            NitroxGUILayout.Separator();
            GUILayout.Button("Unsupported", GUILayout.Width(NitroxGUILayout.DEFAULT_LABEL_WIDTH));
        }
    }
Ejemplo n.º 25
0
    private static void DrawCanvasScaler(CanvasScaler canvasScaler)
    {
        if (canvasScaler.GetComponent <Canvas>().renderMode == RenderMode.WorldSpace)
        {
            using (new GUILayout.HorizontalScope())
            {
                GUILayout.Label("Dynamic Pixels Per Unit", NitroxGUILayout.DrawerLabel, GUILayout.Width(NitroxGUILayout.DEFAULT_LABEL_WIDTH));
                NitroxGUILayout.Separator();
                canvasScaler.dynamicPixelsPerUnit = NitroxGUILayout.FloatField(canvasScaler.dynamicPixelsPerUnit);
            }
        }
        else
        {
            using (new GUILayout.HorizontalScope())
            {
                GUILayout.Label("UI Scale Mode", NitroxGUILayout.DrawerLabel, GUILayout.Width(NitroxGUILayout.DEFAULT_LABEL_WIDTH));
                NitroxGUILayout.Separator();
                canvasScaler.uiScaleMode = NitroxGUILayout.EnumPopup(canvasScaler.uiScaleMode);
            }

            if (canvasScaler.uiScaleMode == CanvasScaler.ScaleMode.ConstantPixelSize)
            {
                using (new GUILayout.HorizontalScope())
                {
                    GUILayout.Label("Scale Factor", NitroxGUILayout.DrawerLabel, GUILayout.Width(NitroxGUILayout.DEFAULT_LABEL_WIDTH));
                    NitroxGUILayout.Separator();
                    canvasScaler.scaleFactor = NitroxGUILayout.FloatField(canvasScaler.scaleFactor);
                }
            }
            else if (canvasScaler.uiScaleMode == CanvasScaler.ScaleMode.ScaleWithScreenSize)
            {
                using (new GUILayout.HorizontalScope())
                {
                    GUILayout.Label("Reference Resolution", NitroxGUILayout.DrawerLabel, GUILayout.Width(NitroxGUILayout.DEFAULT_LABEL_WIDTH));
                    NitroxGUILayout.Separator();
                    canvasScaler.referenceResolution = VectorDrawer.DrawVector2(canvasScaler.referenceResolution);
                }

                using (new GUILayout.HorizontalScope())
                {
                    GUILayout.Label("Screen Match Mode", NitroxGUILayout.DrawerLabel, GUILayout.Width(NitroxGUILayout.DEFAULT_LABEL_WIDTH));
                    NitroxGUILayout.Separator();
                    canvasScaler.screenMatchMode = NitroxGUILayout.EnumPopup(canvasScaler.screenMatchMode);
                }

                using (new GUILayout.HorizontalScope())
                {
                    GUILayout.Label("Match", NitroxGUILayout.DrawerLabel, GUILayout.Width(NitroxGUILayout.DEFAULT_LABEL_WIDTH));
                    NitroxGUILayout.Separator();
                    float newMatchValue = NitroxGUILayout.FloatField(canvasScaler.matchWidthOrHeight);
                    canvasScaler.matchWidthOrHeight = Mathf.Max(0, Mathf.Min(newMatchValue, 1));
                }
            }
            else
            {
                using (new GUILayout.HorizontalScope())
                {
                    GUILayout.Label("Physical Unit", NitroxGUILayout.DrawerLabel, GUILayout.Width(NitroxGUILayout.DEFAULT_LABEL_WIDTH));
                    NitroxGUILayout.Separator();
                    canvasScaler.physicalUnit = NitroxGUILayout.EnumPopup(canvasScaler.physicalUnit);
                }

                using (new GUILayout.HorizontalScope())
                {
                    GUILayout.Label("Fallback Screen DPI", NitroxGUILayout.DrawerLabel, GUILayout.Width(NitroxGUILayout.DEFAULT_LABEL_WIDTH));
                    NitroxGUILayout.Separator();
                    canvasScaler.matchWidthOrHeight = NitroxGUILayout.FloatField(canvasScaler.fallbackScreenDPI);
                }

                using (new GUILayout.HorizontalScope())
                {
                    GUILayout.Label("Default Sprite DPI", NitroxGUILayout.DrawerLabel, GUILayout.Width(NitroxGUILayout.DEFAULT_LABEL_WIDTH));
                    NitroxGUILayout.Separator();
                    float newDefaultSpriteDPI = NitroxGUILayout.FloatField(canvasScaler.defaultSpriteDPI);
                    canvasScaler.defaultSpriteDPI = Mathf.Max(1, newDefaultSpriteDPI);
                }
            }
        }

        using (new GUILayout.HorizontalScope())
        {
            GUILayout.Label("Reference Pixels Per Unit", NitroxGUILayout.DrawerLabel, GUILayout.Width(NitroxGUILayout.DEFAULT_LABEL_WIDTH));
            NitroxGUILayout.Separator();
            canvasScaler.referencePixelsPerUnit = NitroxGUILayout.FloatField(canvasScaler.referencePixelsPerUnit);
        }
    }
Ejemplo n.º 26
0
    private static void DrawDropdown(Dropdown dropdown)
    {
        SelectableDrawer.DrawSelectable(dropdown);

        GUILayout.Space(NitroxGUILayout.DEFAULT_SPACE);

        using (new GUILayout.HorizontalScope())
        {
            GUILayout.Label("Template", NitroxGUILayout.DrawerLabel, GUILayout.Width(NitroxGUILayout.DEFAULT_LABEL_WIDTH));
            NitroxGUILayout.Separator();
            if (GUILayout.Button("Jump to", GUILayout.Width(NitroxGUILayout.DEFAULT_LABEL_WIDTH)))
            {
                NitroxServiceLocator.Cache <SceneDebugger> .Value.JumpToComponent(dropdown.template);
            }
        }

        using (new GUILayout.HorizontalScope())
        {
            GUILayout.Label("Caption Text", NitroxGUILayout.DrawerLabel, GUILayout.Width(NitroxGUILayout.DEFAULT_LABEL_WIDTH));
            NitroxGUILayout.Separator();
            if (GUILayout.Button("Jump to", GUILayout.Width(NitroxGUILayout.DEFAULT_LABEL_WIDTH)))
            {
                NitroxServiceLocator.Cache <SceneDebugger> .Value.JumpToComponent(dropdown.captionText);
            }
        }

        using (new GUILayout.HorizontalScope())
        {
            GUILayout.Label("Caption Image", NitroxGUILayout.DrawerLabel, GUILayout.Width(NitroxGUILayout.DEFAULT_LABEL_WIDTH));
            NitroxGUILayout.Separator();
            if (GUILayout.Button("Jump to", GUILayout.Width(NitroxGUILayout.DEFAULT_LABEL_WIDTH)))
            {
                NitroxServiceLocator.Cache <SceneDebugger> .Value.JumpToComponent(dropdown.captionImage);
            }
        }

        GUILayout.Space(NitroxGUILayout.DEFAULT_SPACE);

        using (new GUILayout.HorizontalScope())
        {
            GUILayout.Label("Item Text", NitroxGUILayout.DrawerLabel, GUILayout.Width(NitroxGUILayout.DEFAULT_LABEL_WIDTH));
            NitroxGUILayout.Separator();
            if (GUILayout.Button("Jump to", GUILayout.Width(NitroxGUILayout.DEFAULT_LABEL_WIDTH)))
            {
                NitroxServiceLocator.Cache <SceneDebugger> .Value.JumpToComponent(dropdown.itemText);
            }
        }

        using (new GUILayout.HorizontalScope())
        {
            GUILayout.Label("Item Image", NitroxGUILayout.DrawerLabel, GUILayout.Width(NitroxGUILayout.DEFAULT_LABEL_WIDTH));
            NitroxGUILayout.Separator();
            if (GUILayout.Button("Jump to", GUILayout.Width(NitroxGUILayout.DEFAULT_LABEL_WIDTH)))
            {
                NitroxServiceLocator.Cache <SceneDebugger> .Value.JumpToComponent(dropdown.itemImage);
            }
        }

        GUILayout.Space(NitroxGUILayout.DEFAULT_SPACE);

        using (new GUILayout.HorizontalScope())
        {
            GUILayout.Label("Value", NitroxGUILayout.DrawerLabel, GUILayout.Width(NitroxGUILayout.DEFAULT_LABEL_WIDTH));
            NitroxGUILayout.Separator();
            dropdown.value = NitroxGUILayout.IntField(dropdown.value);
        }

        using (new GUILayout.HorizontalScope())
        {
            GUILayout.Label("Alpha Fade Speed", NitroxGUILayout.DrawerLabel, GUILayout.Width(NitroxGUILayout.DEFAULT_LABEL_WIDTH));
            NitroxGUILayout.Separator();
            dropdown.alphaFadeSpeed = NitroxGUILayout.FloatField(dropdown.alphaFadeSpeed);
        }

        using (new GUILayout.HorizontalScope())
        {
            GUILayout.Label("Options", NitroxGUILayout.DrawerLabel, GUILayout.Width(NitroxGUILayout.DEFAULT_LABEL_WIDTH));
            NitroxGUILayout.Separator();
            GUILayout.Button("Unsupported", GUILayout.Width(NitroxGUILayout.DEFAULT_LABEL_WIDTH));
        }

        using (new GUILayout.HorizontalScope())
        {
            GUILayout.Label("On Value Changed", NitroxGUILayout.DrawerLabel, GUILayout.Width(NitroxGUILayout.DEFAULT_LABEL_WIDTH));
            NitroxGUILayout.Separator();
            GUILayout.Button("Unsupported", GUILayout.Width(NitroxGUILayout.DEFAULT_LABEL_WIDTH));
        }
    }
Ejemplo n.º 27
0
    private static void DrawSlider(Slider slider)
    {
        SelectableDrawer.DrawSelectable(slider);

        GUILayout.Space(10);

        using (new GUILayout.HorizontalScope())
        {
            GUILayout.Label("Fill Rect", NitroxGUILayout.DrawerLabel, GUILayout.Width(NitroxGUILayout.DEFAULT_LABEL_WIDTH));
            NitroxGUILayout.Separator();
            if (GUILayout.Button("Jump to", GUILayout.Width(NitroxGUILayout.DEFAULT_LABEL_WIDTH)))
            {
                NitroxServiceLocator.Cache <SceneDebugger> .Value.JumpToComponent(slider.fillRect);
            }
        }

        using (new GUILayout.HorizontalScope())
        {
            GUILayout.Label("Handle Rect", NitroxGUILayout.DrawerLabel, GUILayout.Width(NitroxGUILayout.DEFAULT_LABEL_WIDTH));
            NitroxGUILayout.Separator();
            if (GUILayout.Button("Jump to", GUILayout.Width(NitroxGUILayout.DEFAULT_LABEL_WIDTH)))
            {
                NitroxServiceLocator.Cache <SceneDebugger> .Value.JumpToComponent(slider.handleRect);
            }
        }

        GUILayout.Space(10);

        using (new GUILayout.HorizontalScope())
        {
            GUILayout.Label("Direction", NitroxGUILayout.DrawerLabel, GUILayout.Width(NitroxGUILayout.DEFAULT_LABEL_WIDTH));
            NitroxGUILayout.Separator();
            slider.direction = NitroxGUILayout.EnumPopup(slider.direction);
        }

        using (new GUILayout.HorizontalScope())
        {
            GUILayout.Label("Min Value", NitroxGUILayout.DrawerLabel, GUILayout.Width(NitroxGUILayout.DEFAULT_LABEL_WIDTH));
            NitroxGUILayout.Separator();
            slider.minValue = NitroxGUILayout.FloatField(slider.minValue);
        }

        using (new GUILayout.HorizontalScope())
        {
            GUILayout.Label("Max Value", NitroxGUILayout.DrawerLabel, GUILayout.Width(NitroxGUILayout.DEFAULT_LABEL_WIDTH));
            NitroxGUILayout.Separator();
            slider.maxValue = NitroxGUILayout.FloatField(slider.maxValue);
        }

        using (new GUILayout.HorizontalScope())
        {
            GUILayout.Label("Whole Numbers", NitroxGUILayout.DrawerLabel, GUILayout.Width(NitroxGUILayout.DEFAULT_LABEL_WIDTH));
            NitroxGUILayout.Separator();
            slider.wholeNumbers = NitroxGUILayout.BoolField(slider.wholeNumbers);
        }

        using (new GUILayout.HorizontalScope())
        {
            GUILayout.Label("Value", NitroxGUILayout.DrawerLabel, GUILayout.Width(NitroxGUILayout.DEFAULT_LABEL_WIDTH));
            NitroxGUILayout.Separator();
            if (slider.wholeNumbers)
            {
                slider.value = NitroxGUILayout.SliderField((int)slider.value, (int)slider.minValue, (int)slider.maxValue);
            }
            else
            {
                slider.value = NitroxGUILayout.SliderField(slider.value, slider.minValue, slider.maxValue);
            }
        }

        GUILayout.Space(10);

        using (new GUILayout.HorizontalScope())
        {
            GUILayout.Label("On Value Changed", NitroxGUILayout.DrawerLabel, GUILayout.Width(NitroxGUILayout.DEFAULT_LABEL_WIDTH));
            NitroxGUILayout.Separator();
            GUILayout.Button("Unsupported", GUILayout.Width(NitroxGUILayout.DEFAULT_LABEL_WIDTH));
        }
    }
Ejemplo n.º 28
0
    private static void DrawCanvas(Canvas canvas)
    {
        RenderMode renderMode = canvas.renderMode;

        using (new GUILayout.HorizontalScope())
        {
            GUILayout.Label("Raycast Target", NitroxGUILayout.DrawerLabel, GUILayout.Width(NitroxGUILayout.DEFAULT_LABEL_WIDTH));
            NitroxGUILayout.Separator();
            renderMode = NitroxGUILayout.EnumPopup(renderMode);
        }

        if (renderMode == RenderMode.WorldSpace)
        {
            using (new GUILayout.HorizontalScope())
            {
                GUILayout.Label("Event Camera", NitroxGUILayout.DrawerLabel, GUILayout.Width(NitroxGUILayout.DEFAULT_LABEL_WIDTH));
                NitroxGUILayout.Separator();
                if (GUILayout.Button("Jump to", GUILayout.Width(NitroxGUILayout.DEFAULT_LABEL_WIDTH)))
                {
                    NitroxServiceLocator.Cache <SceneDebugger> .Value.UpdateSelectedObject(canvas.worldCamera.gameObject);
                }
            }

            using (new GUILayout.HorizontalScope())
            {
                GUILayout.Label("Sorting layer", NitroxGUILayout.DrawerLabel, GUILayout.Width(NitroxGUILayout.DEFAULT_LABEL_WIDTH));
                NitroxGUILayout.Separator();
                canvas.sortingLayerID = NitroxGUILayout.IntField(canvas.sortingLayerID);
            }

            using (new GUILayout.HorizontalScope())
            {
                GUILayout.Label("Order in Layer", NitroxGUILayout.DrawerLabel, GUILayout.Width(NitroxGUILayout.DEFAULT_LABEL_WIDTH));
                NitroxGUILayout.Separator();
                canvas.sortingOrder = NitroxGUILayout.IntField(canvas.sortingOrder);
            }

            using (new GUILayout.HorizontalScope())
            {
                GUILayout.Label("Additional Shader Channels", NitroxGUILayout.DrawerLabel, GUILayout.Width(NitroxGUILayout.DEFAULT_LABEL_WIDTH));
                NitroxGUILayout.Separator();
                canvas.additionalShaderChannels = NitroxGUILayout.EnumPopup(canvas.additionalShaderChannels);
            }
        }
        else
        {
            using (new GUILayout.HorizontalScope())
            {
                GUILayout.Label("Pixel Perfect", NitroxGUILayout.DrawerLabel, GUILayout.Width(NitroxGUILayout.DEFAULT_LABEL_WIDTH));
                NitroxGUILayout.Separator();
                canvas.pixelPerfect = NitroxGUILayout.BoolField(canvas.pixelPerfect);
            }

            using (new GUILayout.HorizontalScope())
            {
                GUILayout.Label("Sort Order", NitroxGUILayout.DrawerLabel, GUILayout.Width(NitroxGUILayout.DEFAULT_LABEL_WIDTH));
                NitroxGUILayout.Separator();
                canvas.sortingOrder = NitroxGUILayout.IntField(canvas.sortingOrder);
            }

            if (renderMode == RenderMode.ScreenSpaceOverlay)
            {
                using (new GUILayout.HorizontalScope())
                {
                    GUILayout.Label("Target Display", NitroxGUILayout.DrawerLabel, GUILayout.Width(NitroxGUILayout.DEFAULT_LABEL_WIDTH));
                    NitroxGUILayout.Separator();
                    int newTargetDisplay = NitroxGUILayout.IntField(canvas.targetDisplay);
                    canvas.targetDisplay = Math.Max(0, Math.Min(8, newTargetDisplay));
                }
            }
            else
            {
                using (new GUILayout.HorizontalScope())
                {
                    GUILayout.Label("Render Camera", NitroxGUILayout.DrawerLabel, GUILayout.Width(NitroxGUILayout.DEFAULT_LABEL_WIDTH));
                    NitroxGUILayout.Separator();
                    if (GUILayout.Button("Jump to", GUILayout.Width(NitroxGUILayout.DEFAULT_LABEL_WIDTH)))
                    {
                        NitroxServiceLocator.Cache <SceneDebugger> .Value.UpdateSelectedObject(canvas.worldCamera.gameObject);
                    }
                }

                if (canvas.worldCamera)
                {
                    using (new GUILayout.HorizontalScope())
                    {
                        GUILayout.Label("Plane Distance", NitroxGUILayout.DrawerLabel, GUILayout.Width(NitroxGUILayout.DEFAULT_LABEL_WIDTH));
                        NitroxGUILayout.Separator();
                        canvas.planeDistance = NitroxGUILayout.FloatField(canvas.planeDistance);
                    }
                }
            }
        }
    }
Ejemplo n.º 29
0
    private static void DrawText(Text text)
    {
        GUILayout.Label("Text");
        text.text = GUILayout.TextArea(text.text, GUILayout.MaxHeight(100));

        GUILayout.Space(25);
        GUILayout.Label("Character:", "bold");
        using (new GUILayout.HorizontalScope())
        {
            GUILayout.Label("Font", GUILayout.Width(LABEL_WIDTH));
            NitroxGUILayout.Separator();
            GUILayout.TextField(text.font ? text.font.name : "NoFont", GUILayout.Width(VALUE_WIDTH));
        }

        using (new GUILayout.HorizontalScope())
        {
            GUILayout.Label("Font Style", GUILayout.Width(LABEL_WIDTH));
            NitroxGUILayout.Separator();
            GUILayout.TextField(text.fontStyle.ToString(), GUILayout.Width(VALUE_WIDTH));
        }

        using (new GUILayout.HorizontalScope())
        {
            GUILayout.Label("Font Size", GUILayout.Width(LABEL_WIDTH));
            NitroxGUILayout.Separator();
            text.fontSize = NitroxGUILayout.IntField(text.fontSize, VALUE_WIDTH);
        }

        using (new GUILayout.HorizontalScope())
        {
            GUILayout.Label("Line Spacing", GUILayout.Width(LABEL_WIDTH));
            NitroxGUILayout.Separator();
            text.lineSpacing = NitroxGUILayout.FloatField(text.lineSpacing, VALUE_WIDTH);
        }

        using (new GUILayout.HorizontalScope())
        {
            GUILayout.Label("Rich Text", GUILayout.Width(LABEL_WIDTH));
            NitroxGUILayout.Separator();
            text.supportRichText = NitroxGUILayout.BoolField(text.supportRichText, VALUE_WIDTH);
        }

        GUILayout.Space(25);
        GUILayout.Label("Paragraph:", "bold");
        using (new GUILayout.HorizontalScope())
        {
            GUILayout.Label("Alignment", GUILayout.Width(LABEL_WIDTH));
            NitroxGUILayout.Separator();
            text.alignment = NitroxGUILayout.EnumPopup(text.alignment, VALUE_WIDTH);
        }

        using (new GUILayout.HorizontalScope())
        {
            GUILayout.Label("Align By Geometry", GUILayout.Width(LABEL_WIDTH));
            NitroxGUILayout.Separator();
            text.alignByGeometry = NitroxGUILayout.BoolField(text.alignByGeometry, VALUE_WIDTH);
        }

        using (new GUILayout.HorizontalScope())
        {
            GUILayout.Label("Horizontal Overflow", GUILayout.Width(LABEL_WIDTH));
            NitroxGUILayout.Separator();
            text.horizontalOverflow = NitroxGUILayout.EnumPopup(text.horizontalOverflow, VALUE_WIDTH);
        }

        using (new GUILayout.HorizontalScope())
        {
            GUILayout.Label("Vertical Overflow", GUILayout.Width(LABEL_WIDTH));
            NitroxGUILayout.Separator();
            text.verticalOverflow = NitroxGUILayout.EnumPopup(text.verticalOverflow, VALUE_WIDTH);
        }

        using (new GUILayout.HorizontalScope())
        {
            GUILayout.Label("Best Fit", GUILayout.Width(LABEL_WIDTH));
            NitroxGUILayout.Separator();
            text.resizeTextForBestFit = NitroxGUILayout.BoolField(text.resizeTextForBestFit, VALUE_WIDTH);
        }

        GUILayout.Space(25);
        using (new GUILayout.HorizontalScope())
        {
            GUILayout.Label("Color", GUILayout.Width(LABEL_WIDTH));
            NitroxGUILayout.Separator();
            text.color = ColorDrawer.Draw(text.color);
        }

        using (new GUILayout.HorizontalScope())
        {
            GUILayout.Label("Material", GUILayout.Width(LABEL_WIDTH));
            NitroxGUILayout.Separator();
            text.material = MaterialDrawer.Draw(text.material);
        }

        using (new GUILayout.HorizontalScope())
        {
            GUILayout.Label("Raycast Target", GUILayout.Width(LABEL_WIDTH));
            NitroxGUILayout.Separator();
            text.raycastTarget = NitroxGUILayout.BoolField(text.raycastTarget, VALUE_WIDTH);
        }
    }
Ejemplo n.º 30
0
    private static void DrawRectTransform(RectTransform rectTransform)
    {
        using (new GUILayout.VerticalScope())
        {
            //TODO: Implement position display like the Unity editor
            using (new GUILayout.HorizontalScope())
            {
                GUILayout.Label("Local Position", NitroxGUILayout.DrawerLabel, GUILayout.Width(LABEL_WIDTH));
                NitroxGUILayout.Separator();
                rectTransform.localPosition = VectorDrawer.DrawVector3(rectTransform.localPosition, VECTOR_MAX_WIDTH);
            }

            using (new GUILayout.HorizontalScope())
            {
                GUILayout.Label("Local  Rotation", NitroxGUILayout.DrawerLabel, GUILayout.Width(LABEL_WIDTH));
                NitroxGUILayout.Separator();
                rectTransform.localRotation = Quaternion.Euler(VectorDrawer.DrawVector3(rectTransform.localRotation.eulerAngles, VECTOR_MAX_WIDTH));
            }

            using (new GUILayout.HorizontalScope())
            {
                GUILayout.Label("Local  Scale", NitroxGUILayout.DrawerLabel, GUILayout.Width(LABEL_WIDTH));
                NitroxGUILayout.Separator();
                rectTransform.localScale = VectorDrawer.DrawVector3(rectTransform.localScale, VECTOR_MAX_WIDTH);
            }

            GUILayout.Space(20);

            using (new GUILayout.HorizontalScope())
            {
                GUILayout.Label("Size", NitroxGUILayout.DrawerLabel, GUILayout.Width(LABEL_WIDTH));
                NitroxGUILayout.Separator();
                rectTransform.sizeDelta = VectorDrawer.DrawVector2(rectTransform.sizeDelta, VECTOR_MAX_WIDTH);
            }

            using (new GUILayout.HorizontalScope())
            {
                GUILayout.Label("Anchor", NitroxGUILayout.DrawerLabel, GUILayout.Width(LABEL_WIDTH));
                NitroxGUILayout.Separator();
                AnchorMode anchorMode = VectorToAnchorMode(rectTransform.anchorMin, rectTransform.anchorMax);

                if (anchorMode == AnchorMode.NONE)
                {
                    VectorDrawer.DrawVector2(rectTransform.anchorMin, VECTOR_MAX_WIDTH * 0.5f);
                    VectorDrawer.DrawVector2(rectTransform.anchorMax, VECTOR_MAX_WIDTH * 0.5f);
                }
                else
                {
                    anchorMode = NitroxGUILayout.EnumPopup(anchorMode, VECTOR_MAX_WIDTH);

                    // Vector2[] anchorVectors = AnchorModeToVector(anchorMode);
                    // rectTransform.anchorMin = anchorVectors[0];
                    // rectTransform.anchorMax = anchorVectors[1];
                }
            }

            using (new GUILayout.HorizontalScope())
            {
                GUILayout.Label("Pivot", NitroxGUILayout.DrawerLabel, GUILayout.Width(LABEL_WIDTH));
                NitroxGUILayout.Separator();
                rectTransform.pivot = VectorDrawer.DrawVector2(rectTransform.pivot, VECTOR_MAX_WIDTH);
            }
        }
    }