public override void OnInspectorGUI() { serializedObject.Update(); ToolboxGuiLayout.BeginBox("Move Around Properties"); SerializedProperty radiusProperty = serializedObject.FindProperty("radius"); EditorGUILayout.Slider(radiusProperty, 1f, 100f); SerializedProperty speedProperty = serializedObject.FindProperty("speed"); EditorGUILayout.Slider(speedProperty, 0f, 500f); ToolboxGuiLayout.EndBox(); SerializedProperty useGuiDebug = serializedObject.FindProperty("guiDebug"); SerializedProperty useGizmosDebug = serializedObject.FindProperty("gizmosDebug"); useGuiDebug.boolValue = EditorGUILayout.Toggle("Display GUI", useGuiDebug.boolValue); if (useGuiDebug.boolValue) { DisplayGuiDebug(); } useGizmosDebug.boolValue = EditorGUILayout.Toggle("Display Gizmos", useGizmosDebug.boolValue); if (useGizmosDebug.boolValue) { DisplayGizmosDebug(); } serializedObject.ApplyModifiedProperties(); }
private void DisplayGuiDebug() { ToolboxGuiLayout.BeginBox("GUI Debug Properties"); EditorGUILayout.PropertyField(serializedObject.FindProperty("guiFontSize")); EditorGUILayout.PropertyField(serializedObject.FindProperty("guiColor")); ToolboxGuiLayout.EndBox(); }
private void DisplayGizmosDebug() { ToolboxGuiLayout.BeginBox("Gizmos Debug Properties"); EditorGUILayout.Slider(serializedObject.FindProperty("gizmosSize"), 0.1f, 1f); EditorGUILayout.PropertyField(serializedObject.FindProperty("gizmosCenterColor")); EditorGUILayout.PropertyField(serializedObject.FindProperty("gizmosDestinationColor")); EditorGUILayout.PropertyField(serializedObject.FindProperty("gizmosRadiusColor")); ToolboxGuiLayout.EndBox(); }