|
|
@@ -1,10 +1,5 @@
|
|
|
Needed controls:
|
|
|
-IntField (With drag sliding)
|
|
|
-FloatField (With drag sliding)
|
|
|
-ToggleFIeld
|
|
|
-Vector2 field
|
|
|
-Vector3 field
|
|
|
-Vector4 field
|
|
|
+Toggle field
|
|
|
Color field
|
|
|
Array field/List field/Dictionary field
|
|
|
Matrix3 field
|
|
|
@@ -12,7 +7,6 @@ Matrix4 field
|
|
|
GameObject field
|
|
|
Resource field
|
|
|
Component foldout field
|
|
|
-Text field
|
|
|
|
|
|
-------------
|
|
|
Cursor
|
|
|
@@ -28,14 +22,50 @@ Other:
|
|
|
|
|
|
-------------
|
|
|
|
|
|
-When Inspector is displayed a SerializedObject of a Component (or some other type) is created
|
|
|
- - It will contain a list of SerializedFields, which you can call set/get on (setInt, setString, setObject, setArray, etc.)
|
|
|
- - It will also know its own type in an enum
|
|
|
- - You can query all SerializedFields of an SerializedObject or find individual ones by name
|
|
|
+TOMORROW:
|
|
|
+ - InspectableObject calls a C++ method which gets all SerializableFields, and C++ in turn
|
|
|
+ generates a list of InspectableFields
|
|
|
+ - They should have a type, name, and get/set methods
|
|
|
|
|
|
-You can call EditorGUI.SerializedField to automatically draw GUI depending on field type.
|
|
|
- - Or SerializedObject to draw GUI for entire object
|
|
|
+Dont forget to implement SceneObject.GetComponents
|
|
|
|
|
|
-------------
|
|
|
-PRIMARY advantage of handling properties like this, instead of making custom inspectors and calling GUI methods manually is that you get undo/redo support.
|
|
|
-ALSO I need tab movement
|
|
|
+Tab indexes
|
|
|
+ - EditorFields should have SetNextField method that allow you to set tab order directly
|
|
|
+ - InspectableField are automatically assigned ID
|
|
|
+ - ID is part depth (also governs identation) and part sequential index
|
|
|
+ - This allows me to add/remove elements from objects like lists and arrays and not mess up the tab order
|
|
|
+ - Also collapse/expand doesn't require us to modify tab indexes
|
|
|
+ - InspectableObjects should likely have a reference to the Inspector so that they can query next InspectableField based on tab ID
|
|
|
+ - These IDs are then used for calling SetNextField on normal EditorFields
|
|
|
+
|
|
|
+Custom inspector
|
|
|
+ - Custom inspector should have complete knowledge of the GUI objects within it (so that parent Inspector can expand/collapse it without worrying about the user forgetting to hide an element and messing up the other inspectors)
|
|
|
+ - Since custom inspector should have all of its elements in a specific GUILayout, we should be able to just manipulate that GUILayout
|
|
|
+
|
|
|
+Positioning/Indentation
|
|
|
+ - Inspector needs to be provided with a layout
|
|
|
+ - Whenever an InspectableObject is created it will create a new X layout with a space (for indenting) and a Y layout (for child elements)
|
|
|
+ - We will provide it with parent layout from which to create those on
|
|
|
+ - And depth for determining indent amount
|
|
|
+ - For top level objects there is no space or X layout (depth is 0)
|
|
|
+ - InspectableFields will use the Layouts they are given by their parent InspectableObjects
|
|
|
+
|
|
|
+C++ bit for creating InspectableField
|
|
|
+ - Need a way to list all fields in an object (should already have most of that functionality)
|
|
|
+ - And hook up those fields with get/set callbacks for editing/updating
|
|
|
+
|
|
|
+UndoRedo
|
|
|
+ - A global UndoRedo class for generic use
|
|
|
+ - Specific UndoRedo for automatic use in InspectableField
|
|
|
+ - Will likely need Undo/Redo context
|
|
|
+ - e.g. when in a text field I want to undo/redo my changes in that text field one by one
|
|
|
+ - but when I click outside maybe I just want to undo to the previous state before I even focused on that text field
|
|
|
+ - plus it doesn't make sense for example to undo a text field if I'm currently focusing on something in scene
|
|
|
+
|
|
|
+IMPLEMENTATION
|
|
|
+ - Add a Foldout GUI type and its C# version
|
|
|
+ - Attempt to display a list of Components on a SceneObject just by using the foldouts
|
|
|
+
|
|
|
+ - Add basic IntField and hook it up with InspectableField (get/set methods and everything)
|
|
|
+
|
|
|
+ - Add Multi-rank array, List & Dictionary types
|