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); } }
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); } }
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); } }
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); } }
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); } }
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); } }
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"); } }
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); } }
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()"); }
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); } }
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)); } }
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); } } } } }
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); } }
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)); } }
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)); } }