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