public override void OnInspectorGUI() { BoundingBoxManipulate bbm = (BoundingBoxManipulate)target; GUI.color = HUXEditorUtils.DefaultColor; bbm.Target = (GameObject)EditorGUILayout.ObjectField("Target", bbm.Target, typeof(GameObject), true); bbm.ActiveHandle = (BoundingBoxHandle)EditorGUILayout.ObjectField("Active Handle", bbm.ActiveHandle, typeof(BoundingBoxHandle), true); bbm.PhysicsLayer = EditorGUILayout.IntSlider("Physics / Rendering Layer", bbm.PhysicsLayer, 0, 32); bbm.IgnoreLayer = EditorGUILayout.IntSlider("Ignore Mesh Renderers on this Layer", bbm.IgnoreLayer, 0, 32); bbm.DragMultiplier = EditorGUILayout.Slider("Drag input scale", bbm.DragMultiplier, 0.01f, 20f); bbm.RotateMultiplier = EditorGUILayout.Slider("Rotation input scale", bbm.RotateMultiplier, 0.01f, 20f); bbm.ScaleMultiplier = EditorGUILayout.Slider("Scale input scale", bbm.ScaleMultiplier, 0.01f, 20f); bbm.MinScalePercentage = EditorGUILayout.Slider("Minimum scale per operation", bbm.MinScalePercentage, 0.05f, 1f); bbm.PermittedOperations = (BoundingBoxManipulate.OperationEnum)HUXEditorUtils.EnumCheckboxField <BoundingBoxManipulate.OperationEnum>( "Permitted Operations", bbm.PermittedOperations, "Default", BoundingBoxManipulate.OperationEnum.ScaleUniform | BoundingBoxManipulate.OperationEnum.RotateY | BoundingBoxManipulate.OperationEnum.Drag, BoundingBoxManipulate.OperationEnum.Drag); if (!Application.isPlaying) { bbm.AcceptInput = EditorGUILayout.Toggle("Accept Input", bbm.AcceptInput); bbm.ManipulatingNow = EditorGUILayout.Toggle("Manipulating Now", bbm.ManipulatingNow); } HUXEditorUtils.SaveChanges(bbm); }
public override void OnInspectorGUI() { BoundingBoxTarget bbt = (BoundingBoxTarget)target; // See if there's a bounding box yet BoundingBoxManipulate bbm = GameObject.FindObjectOfType <BoundingBoxManipulate>(); AppBar toolbar = GameObject.FindObjectOfType <AppBar>(); if (bbm == null || toolbar == null) { HUXEditorUtils.ErrorMessage( "Couldn't find a bounding box prefab and/or manipulation toolbar in the scene. Bounding box target won't work without them.", AddBoundingBox); } HUXEditorUtils.DrawFilterTagField(serializedObject, "TagOnSelected"); HUXEditorUtils.DrawFilterTagField(serializedObject, "TagOnDeselected"); bbt.PermittedOperations = (BoundingBoxManipulate.OperationEnum)HUXEditorUtils.EnumCheckboxField <BoundingBoxManipulate.OperationEnum>( "Permitted Operations", bbt.PermittedOperations, "Default", BoundingBoxManipulate.OperationEnum.ScaleUniform | BoundingBoxManipulate.OperationEnum.RotateY | BoundingBoxManipulate.OperationEnum.Drag, BoundingBoxManipulate.OperationEnum.Drag); bbt.ShowAppBar = EditorGUILayout.Toggle("Toolbar Display", bbt.ShowAppBar); HUXEditorUtils.SaveChanges(bbt); }
public override void OnInspectorGUI() { BoundingBoxTarget bbt = (BoundingBoxTarget)target; HUXEditorUtils.DrawFilterTagField(serializedObject, "TagOnSelected"); HUXEditorUtils.DrawFilterTagField(serializedObject, "TagOnDeselected"); bbt.PermittedOperations = (BoundingBoxManipulate.OperationEnum)HUXEditorUtils.EnumCheckboxField <BoundingBoxManipulate.OperationEnum>( "Permitted Operations", bbt.PermittedOperations, "Default", BoundingBoxManipulate.OperationEnum.ScaleUniform | BoundingBoxManipulate.OperationEnum.RotateY | BoundingBoxManipulate.OperationEnum.Drag, BoundingBoxManipulate.OperationEnum.Drag); bbt.ShowAppBar = EditorGUILayout.Toggle("Toolbar Display", bbt.ShowAppBar); HUXEditorUtils.SaveChanges(bbt); }
public override void OnInspectorGUI() { BoundingBoxTarget bbt = (BoundingBoxTarget)target; HUXEditorUtils.DrawFilterTagField(serializedObject, "TagOnSelected"); HUXEditorUtils.DrawFilterTagField(serializedObject, "TagOnDeselected"); /*EditorGUILayout.BeginHorizontal(); * EditorGUILayout.LabelField("Bounds method", GUILayout.MaxWidth(100)); * bbt.BoundsCalculationMethod = (BoundingBox.BoundsCalculationMethodEnum)EditorGUILayout.EnumPopup(bbt.BoundsCalculationMethod, GUILayout.MaxWidth(155)); * switch (bbt.BoundsCalculationMethod) * { * case BoundingBox.BoundsCalculationMethodEnum.MeshFilterBounds: * HUXEditorUtils.DrawSubtleMiniLabel("Uses all MeshFilters to calculate bounds. This setting is more accurate (especially for flat objects), but will only calculate bounds for mesh-based objects."); * break; * * case BoundingBox.BoundsCalculationMethodEnum.RendererBounds: * HUXEditorUtils.DrawSubtleMiniLabel("Uses all Renderers to calculate bounds. This setting is less accurate, but can calculate bounds for objects like particle systems."); * break; * } * EditorGUILayout.EndHorizontal();*/ bbt.PermittedOperations = (BoundingBoxManipulate.OperationEnum)HUXEditorUtils.EnumCheckboxField <BoundingBoxManipulate.OperationEnum>( "Permitted Operations", bbt.PermittedOperations, "Default", BoundingBoxManipulate.OperationEnum.ScaleUniform | BoundingBoxManipulate.OperationEnum.RotateY | BoundingBoxManipulate.OperationEnum.Drag, BoundingBoxManipulate.OperationEnum.Drag); bbt.FlattenPreference = (BoundingBox.FlattenModeEnum)EditorGUILayout.EnumPopup("Flattening mode", bbt.FlattenPreference); bbt.ShowAppBar = EditorGUILayout.Toggle("Toolbar Display", bbt.ShowAppBar); HUXEditorUtils.SaveChanges(target, serializedObject); }
public override void OnInspectorGUI() { InteractionManager interactionManager = (InteractionManager)target; interactionManager.RecognizableGesures = (UnityEngine.XR.WSA.Input.GestureSettings)HUXEditorUtils.EnumCheckboxField <UnityEngine.XR.WSA.Input.GestureSettings>( "Recognizable gestures", interactionManager.RecognizableGesures, "Default", UnityEngine.XR.WSA.Input.GestureSettings.Tap | UnityEngine.XR.WSA.Input.GestureSettings.DoubleTap | UnityEngine.XR.WSA.Input.GestureSettings.Hold | UnityEngine.XR.WSA.Input.GestureSettings.NavigationX | UnityEngine.XR.WSA.Input.GestureSettings.NavigationY); HUXEditorUtils.SaveChanges(target, serializedObject); }
public override void OnInspectorGUI() { BoundingBoxManipulate bbm = (BoundingBoxManipulate)target; GUI.color = HUXEditorUtils.DefaultColor; bbm.Target = (GameObject)EditorGUILayout.ObjectField("Target", bbm.Target, typeof(GameObject), true); //bbm.ActiveHandle = (BoundingBoxHandle)EditorGUILayout.ObjectField("Active Handle", bbm.ActiveHandle, typeof(BoundingBoxHandle), true); HUXEditorUtils.BeginSectionBox("Settings"); EditorGUILayout.BeginHorizontal(); EditorGUILayout.LabelField("Bounds method", GUILayout.MaxWidth(100)); bbm.BoundsCalculationMethod = (BoundingBox.BoundsCalculationMethodEnum)EditorGUILayout.EnumPopup(bbm.BoundsCalculationMethod, GUILayout.MaxWidth(155)); switch (bbm.BoundsCalculationMethod) { case BoundingBox.BoundsCalculationMethodEnum.MeshFilterBounds: HUXEditorUtils.DrawSubtleMiniLabel("Uses all MeshFilters to calculate bounds. This setting is more accurate (especially for flat objects), but will only calculate bounds for mesh-based objects."); break; case BoundingBox.BoundsCalculationMethodEnum.RendererBounds: HUXEditorUtils.DrawSubtleMiniLabel("Uses all Renderers to calculate bounds. This setting is less accurate, but can calculate bounds for objects like particle systems."); break; } EditorGUILayout.EndHorizontal(); bbm.PhysicsLayer = EditorGUILayout.IntSlider("Physics / Rendering Layer", bbm.PhysicsLayer, 0, 32); bbm.IgnoreLayer = EditorGUILayout.IntSlider("Ignore Mesh Renderers on this Layer", bbm.IgnoreLayer, 0, 32); HUXEditorUtils.EndSectionBox(); HUXEditorUtils.BeginSectionBox("Manipulation"); bbm.DragMultiplier = EditorGUILayout.Slider("Drag input scale", bbm.DragMultiplier, 0.01f, 20f); bbm.RotateMultiplier = EditorGUILayout.Slider("Rotation input scale", bbm.RotateMultiplier, 0.01f, 20f); bbm.ScaleMultiplier = EditorGUILayout.Slider("Scale input scale", bbm.ScaleMultiplier, 0.01f, 20f); bbm.MinScalePercentage = EditorGUILayout.Slider("Minimum scale per operation", bbm.MinScalePercentage, 0.05f, 1f); HUXEditorUtils.EndSectionBox(); HUXEditorUtils.BeginSectionBox("Flattening"); bbm.FlattenPreference = (BoundingBox.FlattenModeEnum)EditorGUILayout.EnumPopup("Flattening preference", bbm.FlattenPreference); switch (bbm.FlattenPreference) { case BoundingBox.FlattenModeEnum.DoNotFlatten: HUXEditorUtils.DrawSubtleMiniLabel("Bounding box will never be flattened no matter how thin the target object gets."); break; case BoundingBox.FlattenModeEnum.FlattenAuto: HUXEditorUtils.DrawSubtleMiniLabel("If an axis drops below the relative % threshold, that axis will be flattened to the specified thickness."); bbm.FlattenAxisThreshold = EditorGUILayout.Slider("Flatten axis threshold %", (bbm.FlattenAxisThreshold * 100), 0.01f, 100f) / 100; bbm.FlattenedAxisThickness = EditorGUILayout.Slider("Flattened axis thickness", bbm.FlattenedAxisThickness, 0.001f, 1f); if (bbm.BoundsCalculationMethod == BoundingBox.BoundsCalculationMethodEnum.RendererBounds) { HUXEditorUtils.WarningMessage("The " + bbm.BoundsCalculationMethod + " method may result in distortion for flattened objects. " + BoundingBox.BoundsCalculationMethodEnum.MeshFilterBounds + " method is recommended for this setting."); } EditorGUILayout.EnumPopup("Current flattened axis: ", bbm.FlattenedAxis); break; case BoundingBox.FlattenModeEnum.FlattenX: case BoundingBox.FlattenModeEnum.FlattenY: case BoundingBox.FlattenModeEnum.FlattenZ: HUXEditorUtils.DrawSubtleMiniLabel("The selected axis will be flattened to the specified thickness."); bbm.FlattenedAxisThickness = EditorGUILayout.Slider("Flattened axis thickness", bbm.FlattenedAxisThickness, 0.001f, 1f); if (bbm.BoundsCalculationMethod == BoundingBox.BoundsCalculationMethodEnum.RendererBounds) { HUXEditorUtils.WarningMessage("The " + bbm.BoundsCalculationMethod + " method may result in distortion for flattened objects. " + BoundingBox.BoundsCalculationMethodEnum.MeshFilterBounds + " method is recommended for this setting."); } break; } HUXEditorUtils.EndSubSectionBox(); bbm.PermittedOperations = (BoundingBoxManipulate.OperationEnum)HUXEditorUtils.EnumCheckboxField <BoundingBoxManipulate.OperationEnum>( "Permitted Operations", bbm.PermittedOperations, "Default", BoundingBoxManipulate.OperationEnum.ScaleUniform | BoundingBoxManipulate.OperationEnum.RotateY | BoundingBoxManipulate.OperationEnum.Drag, BoundingBoxManipulate.OperationEnum.Drag); if (!Application.isPlaying) { bbm.AcceptInput = EditorGUILayout.Toggle("Accept Input", bbm.AcceptInput); bbm.ManipulatingNow = EditorGUILayout.Toggle("Manipulating Now", bbm.ManipulatingNow); } HUXEditorUtils.SaveChanges(bbm); }
public override void OnInspectorGUI() { HandCoach coach = (HandCoach)target; //DrawDefaultInspector(); HUXEditorUtils.BeginSectionBox("Material settings"); coach.HandMaterial = (Material)EditorGUILayout.ObjectField("Material", coach.HandMaterial, typeof(Material), false); coach.HighlightColor = EditorGUILayout.ColorField("Highlight color", coach.HighlightColor); coach.NormalColor = EditorGUILayout.ColorField("Normal color", coach.NormalColor); coach.TrackedColor = EditorGUILayout.ColorField("Tracked color", coach.TrackedColor); coach.TrackingLostColor = EditorGUILayout.ColorField("Tracking lost color", coach.TrackingLostColor); coach.HighlightColorProperty = HUXEditorUtils.MaterialPropertyName(coach.HighlightColorProperty, coach.HandMaterial, ShaderUtil.ShaderPropertyType.Color, false, "_Color", "Highlight"); coach.TrackingColorProperty = HUXEditorUtils.MaterialPropertyName(coach.TrackingColorProperty, coach.HandMaterial, ShaderUtil.ShaderPropertyType.Color, false, "_Color", "Tracking"); coach.MaterialTransparencyIsFloat = EditorGUILayout.Toggle("Use float property for transparency", coach.MaterialTransparencyIsFloat); if (coach.MaterialTransparencyIsFloat) { coach.MaterialTransparencyProperty = HUXEditorUtils.MaterialPropertyName(coach.MaterialTransparencyProperty, coach.HandMaterial, ShaderUtil.ShaderPropertyType.Range, false, "_Color", "Transparency"); } else { coach.MaterialTransparencyProperty = HUXEditorUtils.MaterialPropertyName(coach.MaterialTransparencyProperty, coach.HandMaterial, ShaderUtil.ShaderPropertyType.Color, false, "_Color", "Transparency"); } coach.Highlight = (HandCoach.HandVisibilityEnum)EditorGUILayout.EnumPopup("Hands to highlight", coach.Highlight); HUXEditorUtils.EndSectionBox(); HUXEditorUtils.BeginSectionBox("Tracking settings"); coach.CheckTracking = (HandCoach.HandVisibilityEnum)EditorGUILayout.EnumPopup("Check tracking", coach.CheckTracking); coach.AutoGhostLostTracking = EditorGUILayout.Toggle("Auto-ghost hands when tracking lost", coach.AutoGhostLostTracking); coach.Ghosting = (HandCoach.HandVisibilityEnum)EditorGUILayout.EnumPopup("Ghosting", coach.Ghosting); coach.Tracking = (HandCoach.HandVisibilityEnum)EditorGUILayout.EnumPopup("Tracking", coach.Tracking); HUXEditorUtils.EndSectionBox(); HUXEditorUtils.BeginSectionBox("Gesture settings"); coach.Visibility = (HandCoach.HandVisibilityEnum)EditorGUILayout.EnumPopup("Hands to show", coach.Visibility); coach.AutoLowerOnInvisible = EditorGUILayout.Toggle("Auto-lower on invisible", coach.AutoLowerOnInvisible); coach.RightGesture = (HandCoach.HandGestureEnum)EditorGUILayout.EnumPopup("Right gesture", coach.RightGesture); coach.LeftGesture = (HandCoach.HandGestureEnum)EditorGUILayout.EnumPopup("Left gesture", coach.LeftGesture); coach.RightMovement = (HandCoach.HandMovementEnum)EditorGUILayout.EnumPopup("Right movement", coach.RightMovement); coach.LeftMovement = (HandCoach.HandMovementEnum)EditorGUILayout.EnumPopup("Left movement", coach.LeftMovement); coach.RightDirection = (HandCoach.HandDirectionEnum)HUXEditorUtils.EnumCheckboxField <HandCoach.HandDirectionEnum>("Right hand direction", coach.RightDirection, "None", HandCoach.HandDirectionEnum.None); coach.LeftDirection = (HandCoach.HandDirectionEnum)HUXEditorUtils.EnumCheckboxField <HandCoach.HandDirectionEnum>("Left hand direction", coach.LeftDirection, "None", HandCoach.HandDirectionEnum.None); coach.StaticCurve = EditorGUILayout.CurveField("Static movement curve", coach.StaticCurve); coach.DirectionalCurve = EditorGUILayout.CurveField("Directional movement curve", coach.DirectionalCurve); coach.DirectionalTransparencyCurve = EditorGUILayout.CurveField("Directional movement transparency curve", coach.DirectionalTransparencyCurve); coach.PingPongCurve = EditorGUILayout.CurveField("Ping pong movement curve", coach.PingPongCurve); HUXEditorUtils.EndSectionBox(); serializedObject.ApplyModifiedProperties(); HUXEditorUtils.SaveChanges(target); }