Browse Source

Refactor: Inspectable fields are no longer dependent on Inspector so they can be used in generic editor windows

BearishSun 6 years ago
parent
commit
b9f23bb906
36 changed files with 226 additions and 194 deletions
  1. 1 1
      Source/EditorManaged/Inspectors/SpriteTextureInspector.cs
  2. 4 4
      Source/EditorManaged/Windows/Inspector/GenericInspector.cs
  3. 3 3
      Source/EditorManaged/Windows/Inspector/InspectableAABox.cs
  4. 17 17
      Source/EditorManaged/Windows/Inspector/InspectableArray.cs
  5. 3 3
      Source/EditorManaged/Windows/Inspector/InspectableBool.cs
  6. 5 5
      Source/EditorManaged/Windows/Inspector/InspectableCategory.cs
  7. 3 3
      Source/EditorManaged/Windows/Inspector/InspectableColor.cs
  8. 3 3
      Source/EditorManaged/Windows/Inspector/InspectableColorDistribution.cs
  9. 3 3
      Source/EditorManaged/Windows/Inspector/InspectableColorGradient.cs
  10. 3 3
      Source/EditorManaged/Windows/Inspector/InspectableCurve.cs
  11. 3 3
      Source/EditorManaged/Windows/Inspector/InspectableDegree.cs
  12. 18 18
      Source/EditorManaged/Windows/Inspector/InspectableDictionary.cs
  13. 3 3
      Source/EditorManaged/Windows/Inspector/InspectableEnum.cs
  14. 3 3
      Source/EditorManaged/Windows/Inspector/InspectableEuler.cs
  15. 72 41
      Source/EditorManaged/Windows/Inspector/InspectableField.cs
  16. 3 3
      Source/EditorManaged/Windows/Inspector/InspectableFloat.cs
  17. 3 3
      Source/EditorManaged/Windows/Inspector/InspectableFloatDistribution.cs
  18. 3 3
      Source/EditorManaged/Windows/Inspector/InspectableGameObjectRef.cs
  19. 3 3
      Source/EditorManaged/Windows/Inspector/InspectableInt.cs
  20. 3 3
      Source/EditorManaged/Windows/Inspector/InspectableLayerMask.cs
  21. 18 18
      Source/EditorManaged/Windows/Inspector/InspectableList.cs
  22. 6 6
      Source/EditorManaged/Windows/Inspector/InspectableObject.cs
  23. 3 3
      Source/EditorManaged/Windows/Inspector/InspectableQuaternion.cs
  24. 3 3
      Source/EditorManaged/Windows/Inspector/InspectableRRef.cs
  25. 3 3
      Source/EditorManaged/Windows/Inspector/InspectableRadian.cs
  26. 4 3
      Source/EditorManaged/Windows/Inspector/InspectableRangedField.cs
  27. 3 3
      Source/EditorManaged/Windows/Inspector/InspectableRangedFloat.cs
  28. 3 3
      Source/EditorManaged/Windows/Inspector/InspectableRangedInt.cs
  29. 3 3
      Source/EditorManaged/Windows/Inspector/InspectableResource.cs
  30. 3 3
      Source/EditorManaged/Windows/Inspector/InspectableString.cs
  31. 3 3
      Source/EditorManaged/Windows/Inspector/InspectableTexture.cs
  32. 3 3
      Source/EditorManaged/Windows/Inspector/InspectableVector2.cs
  33. 3 3
      Source/EditorManaged/Windows/Inspector/InspectableVector2Distribution.cs
  34. 3 3
      Source/EditorManaged/Windows/Inspector/InspectableVector3.cs
  35. 3 3
      Source/EditorManaged/Windows/Inspector/InspectableVector3Distribution.cs
  36. 3 3
      Source/EditorManaged/Windows/Inspector/InspectableVector4.cs

+ 1 - 1
Source/EditorManaged/Inspectors/SpriteTextureInspector.cs

@@ -33,7 +33,7 @@ namespace bs.Editor
             if (spriteTexture == null)
             if (spriteTexture == null)
                 return;
                 return;
 
 
-            genericDrawer = new GenericInspectorDrawer(spriteTexture, this, Layout);
+            genericDrawer = new GenericInspectorDrawer(spriteTexture, new InspectableContext(Persistent), Layout);
 
 
             GUILayout previewLayout = PreviewGUI.AddLayoutY();
             GUILayout previewLayout = PreviewGUI.AddLayoutY();
             previewTitleLayout = GUILayoutWithBackground.Create<GUILayoutX>(previewLayout, Builtin.WhiteTexture,
             previewTitleLayout = GUILayoutWithBackground.Create<GUILayoutX>(previewLayout, Builtin.WhiteTexture,

+ 4 - 4
Source/EditorManaged/Windows/Inspector/GenericInspector.cs

@@ -24,7 +24,7 @@ namespace bs.Editor
             if (InspectedObject == null)
             if (InspectedObject == null)
                 LoadResource();
                 LoadResource();
 
 
-            drawer = new GenericInspectorDrawer(InspectedObject, this, Layout);
+            drawer = new GenericInspectorDrawer(InspectedObject, new InspectableContext(Persistent), Layout);
 
 
             isEmpty = drawer.Fields.Count == 0;
             isEmpty = drawer.Fields.Count == 0;
             base.SetVisible(!isEmpty);
             base.SetVisible(!isEmpty);
@@ -58,7 +58,7 @@ namespace bs.Editor
         /// Creates new generic inspector field drawer for the specified object.
         /// Creates new generic inspector field drawer for the specified object.
         /// </summary>
         /// </summary>
         /// <param name="obj">Object whose fields to create the GUI for.</param>
         /// <param name="obj">Object whose fields to create the GUI for.</param>
-        /// <param name="parent">Parent Inspector to draw in.</param>
+        /// <param name="context">Context shared by all inspectable fields created by the same parent.</param>
         /// <param name="layout">Parent layout that all the field GUI elements will be added to.</param>
         /// <param name="layout">Parent layout that all the field GUI elements will be added to.</param>
         /// <param name="overrideCallback">
         /// <param name="overrideCallback">
         /// Optional callback that allows you to override the look of individual fields in the object. If non-null the
         /// Optional callback that allows you to override the look of individual fields in the object. If non-null the
@@ -66,14 +66,14 @@ namespace bs.Editor
         /// non-null that inspectable field will be used for drawing the GUI, otherwise the default inspector field type
         /// non-null that inspectable field will be used for drawing the GUI, otherwise the default inspector field type
         /// will be used.
         /// will be used.
         /// </param>
         /// </param>
-        public GenericInspectorDrawer(object obj, Inspector parent, GUILayoutY layout, 
+        public GenericInspectorDrawer(object obj, InspectableContext context, GUILayoutY layout, 
             InspectableField.FieldOverrideCallback overrideCallback = null)
             InspectableField.FieldOverrideCallback overrideCallback = null)
         {
         {
             if (obj == null)
             if (obj == null)
                 return;
                 return;
 
 
             SerializableObject serializableObject = new SerializableObject(obj.GetType(), obj);
             SerializableObject serializableObject = new SerializableObject(obj.GetType(), obj);
-            Fields = InspectableField.CreateFields(serializableObject, parent, "", 0, layout, overrideCallback);
+            Fields = InspectableField.CreateFields(serializableObject, context, "", 0, layout, overrideCallback);
         }
         }
 
 
         /// <summary>
         /// <summary>

+ 3 - 3
Source/EditorManaged/Windows/Inspector/InspectableAABox.cs

@@ -21,7 +21,7 @@ namespace bs.Editor
         /// <summary>
         /// <summary>
         /// Creates a new inspectable AABox GUI for the specified property.
         /// Creates a new inspectable AABox GUI for the specified property.
         /// </summary>
         /// </summary>
-        /// <param name="parent">Parent Inspector this field belongs to.</param>
+        /// <param name="context">Context shared by all inspectable fields created by the same parent.</param>
         /// <param name="title">Name of the property, or some other value to set as the title.</param>
         /// <param name="title">Name of the property, or some other value to set as the title.</param>
         /// <param name="path">Full path to this property (includes name of this property and all parent properties).</param>
         /// <param name="path">Full path to this property (includes name of this property and all parent properties).</param>
         /// <param name="depth">Determines how deep within the inspector nesting hierarchy is this field. Some fields may
         /// <param name="depth">Determines how deep within the inspector nesting hierarchy is this field. Some fields may
@@ -29,9 +29,9 @@ namespace bs.Editor
         /// <param name="layout">Parent layout that all the field elements will be added to.</param>
         /// <param name="layout">Parent layout that all the field elements will be added to.</param>
         /// <param name="property">Serializable property referencing the field whose contents to display.</param>
         /// <param name="property">Serializable property referencing the field whose contents to display.</param>
         /// <param name="style">Information that can be used for customizing field rendering and behaviour.</param>
         /// <param name="style">Information that can be used for customizing field rendering and behaviour.</param>
-        public InspectableAABox(Inspector parent, string title, string path, int depth, InspectableFieldLayout layout,
+        public InspectableAABox(InspectableContext context, string title, string path, int depth, InspectableFieldLayout layout,
             SerializableProperty property, InspectableFieldStyleInfo style)
             SerializableProperty property, InspectableFieldStyleInfo style)
-            : base(parent, title, path, SerializableProperty.FieldType.Object, depth, layout, property)
+            : base(context, title, path, SerializableProperty.FieldType.Object, depth, layout, property)
         { }
         { }
 
 
         /// <inheritoc/>
         /// <inheritoc/>

+ 17 - 17
Source/EditorManaged/Windows/Inspector/InspectableArray.cs

@@ -29,7 +29,7 @@ namespace bs.Editor
         /// <summary>
         /// <summary>
         /// Creates a new inspectable array GUI for the specified property.
         /// Creates a new inspectable array GUI for the specified property.
         /// </summary>
         /// </summary>
-        /// <param name="parent">Parent Inspector this field belongs to.</param>
+        /// <param name="context">Context shared by all inspectable fields created by the same parent.</param>
         /// <param name="title">Name of the property, or some other value to set as the title.</param>
         /// <param name="title">Name of the property, or some other value to set as the title.</param>
         /// <param name="path">Full path to this property (includes name of this property and all parent properties).</param>
         /// <param name="path">Full path to this property (includes name of this property and all parent properties).</param>
         /// <param name="depth">Determines how deep within the inspector nesting hierarchy is this field. Some fields may
         /// <param name="depth">Determines how deep within the inspector nesting hierarchy is this field. Some fields may
@@ -37,9 +37,9 @@ namespace bs.Editor
         /// <param name="layout">Parent layout that all the field elements will be added to.</param>
         /// <param name="layout">Parent layout that all the field elements will be added to.</param>
         /// <param name="property">Serializable property referencing the array whose contents to display.</param>
         /// <param name="property">Serializable property referencing the array whose contents to display.</param>
         /// <param name="style">Information that can be used for customizing field rendering and behaviour.</param>
         /// <param name="style">Information that can be used for customizing field rendering and behaviour.</param>
-        public InspectableArray(Inspector parent, string title, string path, int depth, InspectableFieldLayout layout, 
+        public InspectableArray(InspectableContext context, string title, string path, int depth, InspectableFieldLayout layout, 
             SerializableProperty property, InspectableFieldStyleInfo style)
             SerializableProperty property, InspectableFieldStyleInfo style)
-            : base(parent, title, path, SerializableProperty.FieldType.Array, depth, layout, property)
+            : base(context, title, path, SerializableProperty.FieldType.Array, depth, layout, property)
         {
         {
             this.style = style;
             this.style = style;
         }
         }
@@ -61,9 +61,9 @@ namespace bs.Editor
         {
         {
             GUILayout arrayLayout = layout.AddLayoutY(layoutIndex);
             GUILayout arrayLayout = layout.AddLayoutY(layoutIndex);
 
 
-            arrayGUIField = InspectableArrayGUI.Create(parent, title, path, property, arrayLayout, depth, style);
-            arrayGUIField.IsExpanded = parent.Persistent.GetBool(path + "_Expanded");
-            arrayGUIField.OnExpand += x => parent.Persistent.SetBool(path + "_Expanded", x);
+            arrayGUIField = InspectableArrayGUI.Create(context, title, path, property, arrayLayout, depth, style);
+            arrayGUIField.IsExpanded = context.Persistent.GetBool(path + "_Expanded");
+            arrayGUIField.OnExpand += x => context.Persistent.SetBool(path + "_Expanded", x);
         }
         }
 
 
         /// <summary>
         /// <summary>
@@ -73,17 +73,17 @@ namespace bs.Editor
         {
         {
             private Array array;
             private Array array;
             private int numElements;
             private int numElements;
-            private Inspector parent;
+            private InspectableContext context;
             private SerializableProperty property;
             private SerializableProperty property;
             private string path;
             private string path;
             private InspectableFieldStyleInfo style;
             private InspectableFieldStyleInfo style;
 
 
             /// <summary>
             /// <summary>
-            /// Returns the parent inspector the array GUI belongs to.
+            /// Context shared by all inspectable fields created by the same parent.
             /// </summary>
             /// </summary>
-            public Inspector Inspector
+            public InspectableContext Context
             {
             {
-                get { return parent; }
+                get { return context; }
             }
             }
 
 
             /// <summary>
             /// <summary>
@@ -105,7 +105,7 @@ namespace bs.Editor
             /// <summary>
             /// <summary>
             /// Constructs a new inspectable array GUI.
             /// Constructs a new inspectable array GUI.
             /// </summary>
             /// </summary>
-            /// <param name="parent">Parent Inspector this field belongs to.</param>
+            /// <param name="context">Context shared by all inspectable fields created by the same parent.</param>
             /// <param name="title">Label to display on the list GUI title.</param>
             /// <param name="title">Label to display on the list GUI title.</param>
             /// <param name="path">Full path to this property (includes name of this property and all parent properties).
             /// <param name="path">Full path to this property (includes name of this property and all parent properties).
             /// </param>
             /// </param>
@@ -115,12 +115,12 @@ namespace bs.Editor
             ///                     nested containers whose backgrounds are overlaping. Also determines background style,
             ///                     nested containers whose backgrounds are overlaping. Also determines background style,
             ///                     depths divisible by two will use an alternate style.</param>
             ///                     depths divisible by two will use an alternate style.</param>
             /// <param name="style">Information that can be used for customizing field rendering and behaviour.</param>
             /// <param name="style">Information that can be used for customizing field rendering and behaviour.</param>
-            public InspectableArrayGUI(Inspector parent, LocString title, string path, SerializableProperty property, 
+            public InspectableArrayGUI(InspectableContext context, LocString title, string path, SerializableProperty property, 
                 GUILayout layout, int depth, InspectableFieldStyleInfo style)
                 GUILayout layout, int depth, InspectableFieldStyleInfo style)
                 : base(title, layout, depth)
                 : base(title, layout, depth)
             {
             {
                 this.property = property;
                 this.property = property;
-                this.parent = parent;
+                this.context = context;
                 this.path = path;
                 this.path = path;
                 this.style = style;
                 this.style = style;
 
 
@@ -132,7 +132,7 @@ namespace bs.Editor
             /// <summary>
             /// <summary>
             /// Creates a new inspectable array GUI object that displays the contents of the provided serializable property.
             /// Creates a new inspectable array GUI object that displays the contents of the provided serializable property.
             /// </summary>
             /// </summary>
-            /// <param name="parent">Parent Inspector this field belongs to.</param>
+            /// <param name="context">Context shared by all inspectable fields created by the same parent.</param>
             /// <param name="title">Label to display on the list GUI title.</param>
             /// <param name="title">Label to display on the list GUI title.</param>
             /// <param name="path">Full path to this property (includes name of this property and all parent properties).
             /// <param name="path">Full path to this property (includes name of this property and all parent properties).
             /// </param>
             /// </param>
@@ -142,10 +142,10 @@ namespace bs.Editor
             ///                     nested containers whose backgrounds are overlaping. Also determines background style,
             ///                     nested containers whose backgrounds are overlaping. Also determines background style,
             ///                     depths divisible by two will use an alternate style.</param>
             ///                     depths divisible by two will use an alternate style.</param>
             /// <param name="style">Information that can be used for customizing field rendering and behaviour.</param>
             /// <param name="style">Information that can be used for customizing field rendering and behaviour.</param>
-            public static InspectableArrayGUI Create(Inspector parent, LocString title, string path, 
+            public static InspectableArrayGUI Create(InspectableContext context, LocString title, string path, 
                 SerializableProperty property, GUILayout layout, int depth, InspectableFieldStyleInfo style)
                 SerializableProperty property, GUILayout layout, int depth, InspectableFieldStyleInfo style)
             {
             {
-                InspectableArrayGUI guiArray = new InspectableArrayGUI(parent, title, path, property, layout, depth, style);
+                InspectableArrayGUI guiArray = new InspectableArrayGUI(context, title, path, property, layout, depth, style);
                 guiArray.BuildGUI();
                 guiArray.BuildGUI();
                 
                 
                 return guiArray;
                 return guiArray;
@@ -383,7 +383,7 @@ namespace bs.Editor
                 styleInfo.StyleFlags &= ~InspectableFieldStyleFlags.NativeWrapper;
                 styleInfo.StyleFlags &= ~InspectableFieldStyleFlags.NativeWrapper;
 
 
                 string entryPath = arrayParent.Path + "[" + SeqIndex + "]";
                 string entryPath = arrayParent.Path + "[" + SeqIndex + "]";
-                field = CreateField(arrayParent.Inspector, SeqIndex + ".", entryPath, 0, Depth + 1,
+                field = CreateField(arrayParent.Context, SeqIndex + ".", entryPath, 0, Depth + 1,
                     new InspectableFieldLayout(layout), property, styleInfo);
                     new InspectableFieldLayout(layout), property, styleInfo);
 
 
                 return field.GetTitleLayout();
                 return field.GetTitleLayout();

+ 3 - 3
Source/EditorManaged/Windows/Inspector/InspectableBool.cs

@@ -20,16 +20,16 @@ namespace bs.Editor
         /// <summary>
         /// <summary>
         /// Creates a new inspectable boolean GUI for the specified property.
         /// Creates a new inspectable boolean GUI for the specified property.
         /// </summary>
         /// </summary>
-        /// <param name="parent">Parent Inspector this field belongs to.</param>
+        /// <param name="context">Context shared by all inspectable fields created by the same parent.</param>
         /// <param name="title">Name of the property, or some other value to set as the title.</param>
         /// <param name="title">Name of the property, or some other value to set as the title.</param>
         /// <param name="path">Full path to this property (includes name of this property and all parent properties).</param>
         /// <param name="path">Full path to this property (includes name of this property and all parent properties).</param>
         /// <param name="depth">Determines how deep within the inspector nesting hierarchy is this field. Some fields may
         /// <param name="depth">Determines how deep within the inspector nesting hierarchy is this field. Some fields may
         ///                     contain other fields, in which case you should increase this value by one.</param>
         ///                     contain other fields, in which case you should increase this value by one.</param>
         /// <param name="layout">Parent layout that all the field elements will be added to.</param>
         /// <param name="layout">Parent layout that all the field elements will be added to.</param>
         /// <param name="property">Serializable property referencing the field whose contents to display.</param>
         /// <param name="property">Serializable property referencing the field whose contents to display.</param>
-        public InspectableBool(Inspector parent, string title, string path, int depth, InspectableFieldLayout layout, 
+        public InspectableBool(InspectableContext context, string title, string path, int depth, InspectableFieldLayout layout, 
             SerializableProperty property)
             SerializableProperty property)
-            : base(parent, title, path, SerializableProperty.FieldType.Bool, depth, layout, property)
+            : base(context, title, path, SerializableProperty.FieldType.Bool, depth, layout, property)
         {
         {
 
 
         }
         }

+ 5 - 5
Source/EditorManaged/Windows/Inspector/InspectableCategory.cs

@@ -30,16 +30,16 @@ namespace bs.Editor
         /// Creates a new inspectable category. The category is initially empty and children must be added by calling
         /// Creates a new inspectable category. The category is initially empty and children must be added by calling
         /// <see cref="AddChild"/>.
         /// <see cref="AddChild"/>.
         /// </summary>
         /// </summary>
-        /// <param name="parent">Parent Inspector this field belongs to.</param>
+        /// <param name="context">Context shared by all inspectable fields created by the same parent.</param>
         /// <param name="title">Name of the category.</param>
         /// <param name="title">Name of the category.</param>
         /// <param name="path">Full path to the category (includes name of the category and all parent properties).</param>
         /// <param name="path">Full path to the category (includes name of the category and all parent properties).</param>
         /// <param name="depth">Determines how deep within the inspector nesting hierarchy is this field. Some fields may
         /// <param name="depth">Determines how deep within the inspector nesting hierarchy is this field. Some fields may
         ///                     contain other fields, in which case you should increase this value by one.</param>
         ///                     contain other fields, in which case you should increase this value by one.</param>
         /// <param name="layout">Parent layout that all the field elements will be added to.</param>
         /// <param name="layout">Parent layout that all the field elements will be added to.</param>
-        public InspectableCategory(Inspector parent, string title, string path, int depth, InspectableFieldLayout layout)
-            : base(parent, title, "", SerializableProperty.FieldType.Object, depth, layout, null)
+        public InspectableCategory(InspectableContext context, string title, string path, int depth, InspectableFieldLayout layout)
+            : base(context, title, "", SerializableProperty.FieldType.Object, depth, layout, null)
         {
         {
-            isExpanded = parent.Persistent.GetBool(path + "_Expanded");
+            isExpanded = context.Persistent.GetBool(path + "_Expanded");
         }
         }
 
 
         /// <summary>
         /// <summary>
@@ -109,7 +109,7 @@ namespace bs.Editor
         /// <param name="expanded">Determines whether the contents were expanded or collapsed.</param>
         /// <param name="expanded">Determines whether the contents were expanded or collapsed.</param>
         private void OnFoldoutToggled(bool expanded)
         private void OnFoldoutToggled(bool expanded)
         {
         {
-            parent.Persistent.SetBool(path + "_Expanded", expanded);
+            context.Persistent.SetBool(path + "_Expanded", expanded);
             isExpanded = expanded;
             isExpanded = expanded;
             guiContentPanel.Active = expanded;
             guiContentPanel.Active = expanded;
         }
         }

+ 3 - 3
Source/EditorManaged/Windows/Inspector/InspectableColor.cs

@@ -20,16 +20,16 @@ namespace bs.Editor
         /// <summary>
         /// <summary>
         /// Creates a new inspectable color GUI for the specified property.
         /// Creates a new inspectable color GUI for the specified property.
         /// </summary>
         /// </summary>
-        /// <param name="parent">Parent Inspector this field belongs to.</param>
+        /// <param name="context">Context shared by all inspectable fields created by the same parent.</param>
         /// <param name="title">Name of the property, or some other value to set as the title.</param>
         /// <param name="title">Name of the property, or some other value to set as the title.</param>
         /// <param name="path">Full path to this property (includes name of this property and all parent properties).</param>
         /// <param name="path">Full path to this property (includes name of this property and all parent properties).</param>
         /// <param name="depth">Determines how deep within the inspector nesting hierarchy is this field. Some fields may
         /// <param name="depth">Determines how deep within the inspector nesting hierarchy is this field. Some fields may
         ///                     contain other fields, in which case you should increase this value by one.</param>
         ///                     contain other fields, in which case you should increase this value by one.</param>
         /// <param name="layout">Parent layout that all the field elements will be added to.</param>
         /// <param name="layout">Parent layout that all the field elements will be added to.</param>
         /// <param name="property">Serializable property referencing the field whose contents to display.</param>
         /// <param name="property">Serializable property referencing the field whose contents to display.</param>
-        public InspectableColor(Inspector parent, string title, string path, int depth, InspectableFieldLayout layout, 
+        public InspectableColor(InspectableContext context, string title, string path, int depth, InspectableFieldLayout layout, 
             SerializableProperty property)
             SerializableProperty property)
-            : base(parent, title, path, SerializableProperty.FieldType.Color, depth, layout, property)
+            : base(context, title, path, SerializableProperty.FieldType.Color, depth, layout, property)
         {
         {
 
 
         }
         }

+ 3 - 3
Source/EditorManaged/Windows/Inspector/InspectableColorDistribution.cs

@@ -20,16 +20,16 @@ namespace bs.Editor
         /// <summary>
         /// <summary>
         /// Creates a new inspectable color distribution GUI for the specified property.
         /// Creates a new inspectable color distribution GUI for the specified property.
         /// </summary>
         /// </summary>
-        /// <param name="parent">Parent Inspector this field belongs to.</param>
+        /// <param name="context">Context shared by all inspectable fields created by the same parent.</param>
         /// <param name="title">Name of the property, or some other value to set as the title.</param>
         /// <param name="title">Name of the property, or some other value to set as the title.</param>
         /// <param name="path">Full path to this property (includes name of this property and all parent properties).</param>
         /// <param name="path">Full path to this property (includes name of this property and all parent properties).</param>
         /// <param name="depth">Determines how deep within the inspector nesting hierarchy is this field. Some fields may
         /// <param name="depth">Determines how deep within the inspector nesting hierarchy is this field. Some fields may
         ///                     contain other fields, in which case you should increase this value by one.</param>
         ///                     contain other fields, in which case you should increase this value by one.</param>
         /// <param name="layout">Parent layout that all the field elements will be added to.</param>
         /// <param name="layout">Parent layout that all the field elements will be added to.</param>
         /// <param name="property">Serializable property referencing the field whose contents to display.</param>
         /// <param name="property">Serializable property referencing the field whose contents to display.</param>
-        public InspectableColorDistribution(Inspector parent, string title, string path, int depth,
+        public InspectableColorDistribution(InspectableContext context, string title, string path, int depth,
             InspectableFieldLayout layout, SerializableProperty property)
             InspectableFieldLayout layout, SerializableProperty property)
-            : base(parent, title, path, SerializableProperty.FieldType.ColorDistribution, depth, layout, property)
+            : base(context, title, path, SerializableProperty.FieldType.ColorDistribution, depth, layout, property)
         { }
         { }
 
 
         /// <inheritoc/>
         /// <inheritoc/>

+ 3 - 3
Source/EditorManaged/Windows/Inspector/InspectableColorGradient.cs

@@ -20,16 +20,16 @@ namespace bs.Editor
         /// <summary>
         /// <summary>
         /// Creates a new inspectable color gradient GUI for the specified property.
         /// Creates a new inspectable color gradient GUI for the specified property.
         /// </summary>
         /// </summary>
-        /// <param name="parent">Parent Inspector this field belongs to.</param>
+        /// <param name="context">Context shared by all inspectable fields created by the same parent.</param>
         /// <param name="title">Name of the property, or some other value to set as the title.</param>
         /// <param name="title">Name of the property, or some other value to set as the title.</param>
         /// <param name="path">Full path to this property (includes name of this property and all parent properties).</param>
         /// <param name="path">Full path to this property (includes name of this property and all parent properties).</param>
         /// <param name="depth">Determines how deep within the inspector nesting hierarchy is this field. Some fields may
         /// <param name="depth">Determines how deep within the inspector nesting hierarchy is this field. Some fields may
         ///                     contain other fields, in which case you should increase this value by one.</param>
         ///                     contain other fields, in which case you should increase this value by one.</param>
         /// <param name="layout">Parent layout that all the field elements will be added to.</param>
         /// <param name="layout">Parent layout that all the field elements will be added to.</param>
         /// <param name="property">Serializable property referencing the field whose contents to display.</param>
         /// <param name="property">Serializable property referencing the field whose contents to display.</param>
-        public InspectableColorGradient(Inspector parent, string title, string path, int depth, 
+        public InspectableColorGradient(InspectableContext context, string title, string path, int depth, 
             InspectableFieldLayout layout, SerializableProperty property)
             InspectableFieldLayout layout, SerializableProperty property)
-            : base(parent, title, path, SerializableProperty.FieldType.ColorGradient, depth, layout, property)
+            : base(context, title, path, SerializableProperty.FieldType.ColorGradient, depth, layout, property)
         { }
         { }
 
 
         /// <inheritoc/>
         /// <inheritoc/>

+ 3 - 3
Source/EditorManaged/Windows/Inspector/InspectableCurve.cs

@@ -20,16 +20,16 @@ namespace bs.Editor
         /// <summary>
         /// <summary>
         /// Creates a new inspectable curve GUI for the specified property.
         /// Creates a new inspectable curve GUI for the specified property.
         /// </summary>
         /// </summary>
-        /// <param name="parent">Parent Inspector this field belongs to.</param>
+        /// <param name="context">Context shared by all inspectable fields created by the same parent.</param>
         /// <param name="title">Name of the property, or some other value to set as the title.</param>
         /// <param name="title">Name of the property, or some other value to set as the title.</param>
         /// <param name="path">Full path to this property (includes name of this property and all parent properties).</param>
         /// <param name="path">Full path to this property (includes name of this property and all parent properties).</param>
         /// <param name="depth">Determines how deep within the inspector nesting hierarchy is this field. Some fields may
         /// <param name="depth">Determines how deep within the inspector nesting hierarchy is this field. Some fields may
         ///                     contain other fields, in which case you should increase this value by one.</param>
         ///                     contain other fields, in which case you should increase this value by one.</param>
         /// <param name="layout">Parent layout that all the field elements will be added to.</param>
         /// <param name="layout">Parent layout that all the field elements will be added to.</param>
         /// <param name="property">Serializable property referencing the field whose contents to display.</param>
         /// <param name="property">Serializable property referencing the field whose contents to display.</param>
-        public InspectableCurve(Inspector parent, string title, string path, int depth,
+        public InspectableCurve(InspectableContext context, string title, string path, int depth,
             InspectableFieldLayout layout, SerializableProperty property)
             InspectableFieldLayout layout, SerializableProperty property)
-            : base(parent, title, path, SerializableProperty.FieldType.Curve, depth, layout, property)
+            : base(context, title, path, SerializableProperty.FieldType.Curve, depth, layout, property)
         { }
         { }
 
 
         /// <inheritoc/>
         /// <inheritoc/>

+ 3 - 3
Source/EditorManaged/Windows/Inspector/InspectableDegree.cs

@@ -21,7 +21,7 @@ namespace bs.Editor
         /// <summary>
         /// <summary>
         /// Creates a new inspectable float GUI for the specified property.
         /// Creates a new inspectable float GUI for the specified property.
         /// </summary>
         /// </summary>
-        /// <param name="parent">Parent Inspector this field belongs to.</param>
+        /// <param name="context">Context shared by all inspectable fields created by the same parent.</param>
         /// <param name="title">Name of the property, or some other value to set as the title.</param>
         /// <param name="title">Name of the property, or some other value to set as the title.</param>
         /// <param name="path">Full path to this property (includes name of this property and all parent properties).</param>
         /// <param name="path">Full path to this property (includes name of this property and all parent properties).</param>
         /// <param name="depth">Determines how deep within the inspector nesting hierarchy is this field. Some fields may
         /// <param name="depth">Determines how deep within the inspector nesting hierarchy is this field. Some fields may
@@ -29,9 +29,9 @@ namespace bs.Editor
         /// <param name="layout">Parent layout that all the field elements will be added to.</param>
         /// <param name="layout">Parent layout that all the field elements will be added to.</param>
         /// <param name="property">Serializable property referencing the field whose contents to display.</param>
         /// <param name="property">Serializable property referencing the field whose contents to display.</param>
         /// <param name="style">Information that can be used for customizing field rendering and behaviour.</param>
         /// <param name="style">Information that can be used for customizing field rendering and behaviour.</param>
-        public InspectableDegree(Inspector parent, string title, string path, int depth, InspectableFieldLayout layout,
+        public InspectableDegree(InspectableContext context, string title, string path, int depth, InspectableFieldLayout layout,
             SerializableProperty property, InspectableFieldStyleInfo style)
             SerializableProperty property, InspectableFieldStyleInfo style)
-            : base(parent, title, path, SerializableProperty.FieldType.Object, depth, layout, property)
+            : base(context, title, path, SerializableProperty.FieldType.Object, depth, layout, property)
         {
         {
             this.style = style;
             this.style = style;
         }
         }

+ 18 - 18
Source/EditorManaged/Windows/Inspector/InspectableDictionary.cs

@@ -22,16 +22,16 @@ namespace bs.Editor
         /// <summary>
         /// <summary>
         /// Creates a new inspectable dictionary GUI for the specified property.
         /// Creates a new inspectable dictionary GUI for the specified property.
         /// </summary>
         /// </summary>
-        /// <param name="parent">Parent Inspector this field belongs to.</param>
+        /// <param name="context">Context shared by all inspectable fields created by the same parent.</param>
         /// <param name="title">Name of the property, or some other value to set as the title.</param>
         /// <param name="title">Name of the property, or some other value to set as the title.</param>
         /// <param name="path">Full path to this property (includes name of this property and all parent properties).</param>
         /// <param name="path">Full path to this property (includes name of this property and all parent properties).</param>
         /// <param name="depth">Determines how deep within the inspector nesting hierarchy is this field. Some fields may
         /// <param name="depth">Determines how deep within the inspector nesting hierarchy is this field. Some fields may
         ///                     contain other fields, in which case you should increase this value by one.</param>
         ///                     contain other fields, in which case you should increase this value by one.</param>
         /// <param name="layout">Parent layout that all the field elements will be added to.</param>
         /// <param name="layout">Parent layout that all the field elements will be added to.</param>
         /// <param name="property">Serializable property referencing the dictionary whose contents to display.</param>
         /// <param name="property">Serializable property referencing the dictionary whose contents to display.</param>
-        public InspectableDictionary(Inspector parent, string title, string path, int depth, InspectableFieldLayout layout, 
+        public InspectableDictionary(InspectableContext context, string title, string path, int depth, InspectableFieldLayout layout, 
             SerializableProperty property)
             SerializableProperty property)
-            : base(parent, title, path, SerializableProperty.FieldType.Dictionary, depth, layout, property)
+            : base(context, title, path, SerializableProperty.FieldType.Dictionary, depth, layout, property)
         {
         {
 
 
         }
         }
@@ -53,9 +53,9 @@ namespace bs.Editor
         {
         {
             GUILayout dictionaryLayout = layout.AddLayoutY(layoutIndex);
             GUILayout dictionaryLayout = layout.AddLayoutY(layoutIndex);
 
 
-            dictionaryGUIField = InspectableDictionaryGUI.Create(parent, title, path, property, dictionaryLayout, depth);
-            dictionaryGUIField.IsExpanded = parent.Persistent.GetBool(path + "_Expanded");
-            dictionaryGUIField.OnExpand += x => parent.Persistent.SetBool(path + "_Expanded", x);
+            dictionaryGUIField = InspectableDictionaryGUI.Create(context, title, path, property, dictionaryLayout, depth);
+            dictionaryGUIField.IsExpanded = context.Persistent.GetBool(path + "_Expanded");
+            dictionaryGUIField.OnExpand += x => context.Persistent.SetBool(path + "_Expanded", x);
         }
         }
 
 
         /// <summary>
         /// <summary>
@@ -67,17 +67,17 @@ namespace bs.Editor
             private SerializableProperty property;
             private SerializableProperty property;
             private IDictionary dictionary;
             private IDictionary dictionary;
             private int numElements;
             private int numElements;
-            private Inspector parent;
+            private InspectableContext context;
             private string path;
             private string path;
 
 
             private List<SerializableProperty> orderedKeys = new List<SerializableProperty>();
             private List<SerializableProperty> orderedKeys = new List<SerializableProperty>();
 
 
             /// <summary>
             /// <summary>
-            /// Returns the parent inspector the array GUI belongs to.
+            /// Context shared by all inspectable fields created by the same parent.
             /// </summary>
             /// </summary>
-            public Inspector Inspector
+            public InspectableContext Context
             {
             {
-                get { return parent; }
+                get { return context; }
             }
             }
 
 
             /// <summary>
             /// <summary>
@@ -91,7 +91,7 @@ namespace bs.Editor
             /// <summary>
             /// <summary>
             /// Constructs a new dictionary GUI.
             /// Constructs a new dictionary GUI.
             /// </summary>
             /// </summary>
-            /// <param name="parent">Parent Inspector this field belongs to.</param>
+            /// <param name="context">Context shared by all inspectable fields created by the same parent.</param>
             /// <param name="title">Label to display on the list GUI title.</param>
             /// <param name="title">Label to display on the list GUI title.</param>
             /// <param name="path">Full path to this property (includes name of this property and all parent properties).
             /// <param name="path">Full path to this property (includes name of this property and all parent properties).
             /// </param>
             /// </param>
@@ -100,12 +100,12 @@ namespace bs.Editor
             /// <param name="depth">Determines at which depth to render the background. Useful when you have multiple
             /// <param name="depth">Determines at which depth to render the background. Useful when you have multiple
             ///                     nested containers whose backgrounds are overlaping. Also determines background style,
             ///                     nested containers whose backgrounds are overlaping. Also determines background style,
             ///                     depths divisible by two will use an alternate style.</param>
             ///                     depths divisible by two will use an alternate style.</param>
-            protected InspectableDictionaryGUI(Inspector parent, LocString title, string path, SerializableProperty property, 
+            protected InspectableDictionaryGUI(InspectableContext context, LocString title, string path, SerializableProperty property, 
                 GUILayout layout, int depth = 0)
                 GUILayout layout, int depth = 0)
             : base(title, layout, depth)
             : base(title, layout, depth)
             {
             {
                 this.property = property;
                 this.property = property;
-                this.parent = parent;
+                this.context = context;
                 this.path = path;
                 this.path = path;
 
 
                 dictionary = property.GetValue<IDictionary>();
                 dictionary = property.GetValue<IDictionary>();
@@ -119,7 +119,7 @@ namespace bs.Editor
             /// Builds the inspectable dictionary GUI elements. Must be called at least once in order for the contents to 
             /// Builds the inspectable dictionary GUI elements. Must be called at least once in order for the contents to 
             /// be populated.
             /// be populated.
             /// </summary>
             /// </summary>
-            /// <param name="parent">Parent Inspector this field belongs to.</param>
+            /// <param name="context">Context shared by all inspectable fields created by the same parent.</param>
             /// <param name="title">Label to display on the list GUI title.</param>
             /// <param name="title">Label to display on the list GUI title.</param>
             /// <param name="path">Full path to this property (includes name of this property and all parent properties).
             /// <param name="path">Full path to this property (includes name of this property and all parent properties).
             /// </param>
             /// </param>
@@ -128,10 +128,10 @@ namespace bs.Editor
             /// <param name="depth">Determines at which depth to render the background. Useful when you have multiple
             /// <param name="depth">Determines at which depth to render the background. Useful when you have multiple
             ///                     nested containers whose backgrounds are overlaping. Also determines background style,
             ///                     nested containers whose backgrounds are overlaping. Also determines background style,
             ///                     depths divisible by two will use an alternate style.</param>
             ///                     depths divisible by two will use an alternate style.</param>
-            public static InspectableDictionaryGUI Create(Inspector parent, LocString title, string path, 
+            public static InspectableDictionaryGUI Create(InspectableContext context, LocString title, string path, 
                 SerializableProperty property, GUILayout layout, int depth = 0)
                 SerializableProperty property, GUILayout layout, int depth = 0)
             {
             {
-                InspectableDictionaryGUI guiDictionary = new InspectableDictionaryGUI(parent, title, path, property, 
+                InspectableDictionaryGUI guiDictionary = new InspectableDictionaryGUI(context, title, path, property, 
                     layout, depth);
                     layout, depth);
                 guiDictionary.BuildGUI();
                 guiDictionary.BuildGUI();
 
 
@@ -374,7 +374,7 @@ namespace bs.Editor
                 SerializableProperty property = GetKey<SerializableProperty>();
                 SerializableProperty property = GetKey<SerializableProperty>();
 
 
                 string entryPath = dictParent.Path + "Key[" + RowIdx + "]";
                 string entryPath = dictParent.Path + "Key[" + RowIdx + "]";
-                fieldKey = CreateField(dictParent.Inspector, "Key", entryPath, 0, Depth + 1,
+                fieldKey = CreateField(dictParent.Context, "Key", entryPath, 0, Depth + 1,
                     new InspectableFieldLayout(layout), property);
                     new InspectableFieldLayout(layout), property);
 
 
                 return fieldKey.GetTitleLayout();
                 return fieldKey.GetTitleLayout();
@@ -387,7 +387,7 @@ namespace bs.Editor
                 SerializableProperty property = GetValue<SerializableProperty>();
                 SerializableProperty property = GetValue<SerializableProperty>();
 
 
                 string entryPath = dictParent.Path + "Value[" + RowIdx + "]";
                 string entryPath = dictParent.Path + "Value[" + RowIdx + "]";
-                fieldValue = CreateField(dictParent.Inspector, "Value", entryPath, 0, Depth + 1,
+                fieldValue = CreateField(dictParent.Context, "Value", entryPath, 0, Depth + 1,
                     new InspectableFieldLayout(layout), property);
                     new InspectableFieldLayout(layout), property);
             }
             }
 
 

+ 3 - 3
Source/EditorManaged/Windows/Inspector/InspectableEnum.cs

@@ -20,16 +20,16 @@ namespace bs.Editor
         /// <summary>
         /// <summary>
         /// Creates a new inspectable enum GUI for the specified property.
         /// Creates a new inspectable enum GUI for the specified property.
         /// </summary>
         /// </summary>
-        /// <param name="parent">Parent Inspector this field belongs to.</param>
+        /// <param name="context">Context shared by all inspectable fields created by the same parent.</param>
         /// <param name="title">Name of the property, or some other value to set as the title.</param>
         /// <param name="title">Name of the property, or some other value to set as the title.</param>
         /// <param name="path">Full path to this property (includes name of this property and all parent properties).</param>
         /// <param name="path">Full path to this property (includes name of this property and all parent properties).</param>
         /// <param name="depth">Determines how deep within the inspector nesting hierarchy is this field. Some fields may
         /// <param name="depth">Determines how deep within the inspector nesting hierarchy is this field. Some fields may
         ///                     contain other fields, in which case you should increase this value by one.</param>
         ///                     contain other fields, in which case you should increase this value by one.</param>
         /// <param name="layout">Parent layout that all the field elements will be added to.</param>
         /// <param name="layout">Parent layout that all the field elements will be added to.</param>
         /// <param name="property">Serializable property referencing the field whose contents to display.</param>
         /// <param name="property">Serializable property referencing the field whose contents to display.</param>
-        public InspectableEnum(Inspector parent, string title, string path, int depth, InspectableFieldLayout layout,
+        public InspectableEnum(InspectableContext context, string title, string path, int depth, InspectableFieldLayout layout,
             SerializableProperty property)
             SerializableProperty property)
-            : base(parent, title, path, SerializableProperty.FieldType.Enum, depth, layout, property)
+            : base(context, title, path, SerializableProperty.FieldType.Enum, depth, layout, property)
         { }
         { }
 
 
         /// <inheritoc/>
         /// <inheritoc/>

+ 3 - 3
Source/EditorManaged/Windows/Inspector/InspectableEuler.cs

@@ -21,16 +21,16 @@ namespace bs.Editor
         /// <summary>
         /// <summary>
         /// Creates a new inspectable euler angle GUI for the specified property.
         /// Creates a new inspectable euler angle GUI for the specified property.
         /// </summary>
         /// </summary>
-        /// <param name="parent">Parent Inspector this field belongs to.</param>
+        /// <param name="context">Context shared by all inspectable fields created by the same parent.</param>
         /// <param name="title">Name of the property, or some other value to set as the title.</param>
         /// <param name="title">Name of the property, or some other value to set as the title.</param>
         /// <param name="path">Full path to this property (includes name of this property and all parent properties).</param>
         /// <param name="path">Full path to this property (includes name of this property and all parent properties).</param>
         /// <param name="depth">Determines how deep within the inspector nesting hierarchy is this field. Some fields may
         /// <param name="depth">Determines how deep within the inspector nesting hierarchy is this field. Some fields may
         ///                     contain other fields, in which case you should increase this value by one.</param>
         ///                     contain other fields, in which case you should increase this value by one.</param>
         /// <param name="layout">Parent layout that all the field elements will be added to.</param>
         /// <param name="layout">Parent layout that all the field elements will be added to.</param>
         /// <param name="property">Serializable property referencing the field whose contents to display.</param>
         /// <param name="property">Serializable property referencing the field whose contents to display.</param>
-        public InspectableEuler(Inspector parent, string title, string path, int depth, InspectableFieldLayout layout,
+        public InspectableEuler(InspectableContext context, string title, string path, int depth, InspectableFieldLayout layout,
             SerializableProperty property)
             SerializableProperty property)
-            : base(parent, title, path, SerializableProperty.FieldType.Quaternion, depth, layout, property)
+            : base(context, title, path, SerializableProperty.FieldType.Quaternion, depth, layout, property)
         {
         {
 
 
         }
         }

+ 72 - 41
Source/EditorManaged/Windows/Inspector/InspectableField.cs

@@ -21,7 +21,7 @@ namespace bs.Editor
     {
     {
         private const int IndentAmount = 5;
         private const int IndentAmount = 5;
 
 
-        protected Inspector parent;
+        protected InspectableContext context;
         protected InspectableFieldLayout layout;
         protected InspectableFieldLayout layout;
         protected SerializableProperty property;
         protected SerializableProperty property;
         protected string title;
         protected string title;
@@ -50,7 +50,7 @@ namespace bs.Editor
         /// <summary>
         /// <summary>
         /// Creates a new inspectable field GUI for the specified property.
         /// Creates a new inspectable field GUI for the specified property.
         /// </summary>
         /// </summary>
-        /// <param name="parent">Parent Inspector this field belongs to.</param>
+        /// <param name="context">Context shared by all inspectable fields created by the same parent.</param>
         /// <param name="title">Name of the property, or some other value to set as the title.</param>
         /// <param name="title">Name of the property, or some other value to set as the title.</param>
         /// <param name="path">Full path to this property (includes name of this property and all parent properties).</param>
         /// <param name="path">Full path to this property (includes name of this property and all parent properties).</param>
         /// <param name="type">Type of property this field will be used for displaying.</param>
         /// <param name="type">Type of property this field will be used for displaying.</param>
@@ -58,10 +58,10 @@ namespace bs.Editor
         ///                     contain other fields, in which case you should increase this value by one.</param>
         ///                     contain other fields, in which case you should increase this value by one.</param>
         /// <param name="layout">Parent layout that all the field elements will be added to.</param>
         /// <param name="layout">Parent layout that all the field elements will be added to.</param>
         /// <param name="property">Serializable property referencing the array whose contents to display.</param>
         /// <param name="property">Serializable property referencing the array whose contents to display.</param>
-        public InspectableField(Inspector parent, string title, string path, SerializableProperty.FieldType type, 
+        public InspectableField(InspectableContext context, string title, string path, SerializableProperty.FieldType type, 
             int depth, InspectableFieldLayout layout, SerializableProperty property)
             int depth, InspectableFieldLayout layout, SerializableProperty property)
         {
         {
-            this.parent = parent;
+            this.context = context;
             this.layout = layout;
             this.layout = layout;
             this.title = title;
             this.title = title;
             this.path = path;
             this.path = path;
@@ -121,7 +121,7 @@ namespace bs.Editor
         /// returns null the default field will be used instead.
         /// returns null the default field will be used instead.
         /// </summary>
         /// </summary>
         /// <param name="field">Field to generate inspector GUI for.</param>
         /// <param name="field">Field to generate inspector GUI for.</param>
-        /// <param name="parent">Parent Inspector the GUI will be rendered on.</param>
+        /// <param name="context">Context shared by all inspectable fields created by the same parent.</param>
         /// <param name="path">Full path to the provided field (includes name of this field and all parent fields).</param>
         /// <param name="path">Full path to the provided field (includes name of this field and all parent fields).</param>
         /// <param name="layout">Parent layout that all the field elements will be added to.</param>
         /// <param name="layout">Parent layout that all the field elements will be added to.</param>
         /// <param name="layoutIndex">Index into the parent layout at which to insert the GUI elements for the field .</param>
         /// <param name="layoutIndex">Index into the parent layout at which to insert the GUI elements for the field .</param>
@@ -133,14 +133,14 @@ namespace bs.Editor
         /// Inspectable field implementation that can be used for displaying the GUI for the provided field. Or null if
         /// Inspectable field implementation that can be used for displaying the GUI for the provided field. Or null if
         /// default field GUI should be used instead.
         /// default field GUI should be used instead.
         /// </returns>
         /// </returns>
-        public delegate InspectableField FieldOverrideCallback(SerializableField field, Inspector parent, string path,
+        public delegate InspectableField FieldOverrideCallback(SerializableField field, InspectableContext context, string path,
             InspectableFieldLayout layout, int layoutIndex, int depth);
             InspectableFieldLayout layout, int layoutIndex, int depth);
 
 
         /// <summary>
         /// <summary>
         /// Creates inspectable fields all the fields/properties of the specified object.
         /// Creates inspectable fields all the fields/properties of the specified object.
         /// </summary>
         /// </summary>
         /// <param name="obj">Object whose fields the GUI will be drawn for.</param>
         /// <param name="obj">Object whose fields the GUI will be drawn for.</param>
-        /// <param name="parent">Parent Inspector to draw in.</param>
+        /// <param name="context">Context shared by all inspectable fields created by the same parent.</param>
         /// <param name="path">Full path to the field this provided object was retrieved from.</param>
         /// <param name="path">Full path to the field this provided object was retrieved from.</param>
         /// <param name="depth">
         /// <param name="depth">
         /// Determines how deep within the inspector nesting hierarchy is this objects. Some fields may contain other
         /// Determines how deep within the inspector nesting hierarchy is this objects. Some fields may contain other
@@ -153,7 +153,7 @@ namespace bs.Editor
         /// non-null that inspectable field will be used for drawing the GUI, otherwise the default inspector field type
         /// non-null that inspectable field will be used for drawing the GUI, otherwise the default inspector field type
         /// will be used.
         /// will be used.
         /// </param>
         /// </param>
-        public static List<InspectableField> CreateFields(SerializableObject obj, Inspector parent, string path, 
+        public static List<InspectableField> CreateFields(SerializableObject obj, InspectableContext context, string path, 
             int depth, GUILayoutY layout, FieldOverrideCallback overrideCallback = null)
             int depth, GUILayoutY layout, FieldOverrideCallback overrideCallback = null)
         {
         {
             // Retrieve fields and sort by order
             // Retrieve fields and sort by order
@@ -185,7 +185,8 @@ namespace bs.Editor
                     if (!string.IsNullOrEmpty(newCategory) && categoryName != newCategory)
                     if (!string.IsNullOrEmpty(newCategory) && categoryName != newCategory)
                     {
                     {
                         string categoryPath = path + "/[" + newCategory + "]";
                         string categoryPath = path + "/[" + newCategory + "]";
-                        category = new InspectableCategory(parent, newCategory, categoryPath, depth, new InspectableFieldLayout(layout));
+                        category = new InspectableCategory(context, newCategory, categoryPath, depth, 
+                            new InspectableFieldLayout(layout));
 
 
                         category.Initialize(rootIndex);
                         category.Initialize(rootIndex);
                         category.Refresh(rootIndex);
                         category.Refresh(rootIndex);
@@ -222,12 +223,12 @@ namespace bs.Editor
                 InspectableField inspectableField = null;
                 InspectableField inspectableField = null;
 
 
                 if(overrideCallback != null)
                 if(overrideCallback != null)
-                    inspectableField = overrideCallback(field, parent, path, new InspectableFieldLayout(parentLayout), 
+                    inspectableField = overrideCallback(field, context, path, new InspectableFieldLayout(parentLayout), 
                         currentIndex, depth);
                         currentIndex, depth);
 
 
                 if (inspectableField == null)
                 if (inspectableField == null)
                 {
                 {
-                    inspectableField = CreateField(parent, fieldName, childPath,
+                    inspectableField = CreateField(context, fieldName, childPath,
                         currentIndex, depth, new InspectableFieldLayout(parentLayout), field.GetProperty(), 
                         currentIndex, depth, new InspectableFieldLayout(parentLayout), field.GetProperty(), 
                         InspectableFieldStyle.Create(field));
                         InspectableFieldStyle.Create(field));
                 }
                 }
@@ -254,7 +255,7 @@ namespace bs.Editor
         /// (like ones for primitives like int or bool), or a user defined implementation defined with a 
         /// (like ones for primitives like int or bool), or a user defined implementation defined with a 
         /// <see cref="CustomInspector"/> attribute.
         /// <see cref="CustomInspector"/> attribute.
         /// </summary>
         /// </summary>
-        /// <param name="parent">Parent Inspector this field belongs to.</param>
+        /// <param name="context">Context shared by all inspectable fields created by the same parent.</param>
         /// <param name="title">Name of the property, or some other value to set as the title.</param>
         /// <param name="title">Name of the property, or some other value to set as the title.</param>
         /// <param name="path">Full path to this property (includes name of this property and all parent properties).</param>
         /// <param name="path">Full path to this property (includes name of this property and all parent properties).</param>
         /// <param name="layoutIndex">Index into the parent layout at which to insert the GUI elements for the field .</param>
         /// <param name="layoutIndex">Index into the parent layout at which to insert the GUI elements for the field .</param>
@@ -265,7 +266,7 @@ namespace bs.Editor
         /// <param name="style">Information that can be used for customizing field rendering and behaviour.</param>
         /// <param name="style">Information that can be used for customizing field rendering and behaviour.</param>
         /// <returns>Inspectable field implementation that can be used for displaying the GUI for a serializable property
         /// <returns>Inspectable field implementation that can be used for displaying the GUI for a serializable property
         ///          of the provided type.</returns>
         ///          of the provided type.</returns>
-        public static InspectableField CreateField(Inspector parent, string title, string path, int layoutIndex, 
+        public static InspectableField CreateField(InspectableContext context, string title, string path, int layoutIndex, 
             int depth, InspectableFieldLayout layout, SerializableProperty property, InspectableFieldStyleInfo style = null)
             int depth, InspectableFieldLayout layout, SerializableProperty property, InspectableFieldStyleInfo style = null)
         {
         {
             InspectableField field = null;
             InspectableField field = null;
@@ -277,7 +278,7 @@ namespace bs.Editor
             Type customInspectable = InspectorUtility.GetCustomInspectable(type);
             Type customInspectable = InspectorUtility.GetCustomInspectable(type);
             if (customInspectable != null)
             if (customInspectable != null)
             {
             {
-                field = (InspectableField) Activator.CreateInstance(customInspectable, parent, title, path, depth, layout, 
+                field = (InspectableField) Activator.CreateInstance(customInspectable, context, title, path, depth, layout, 
                     property, style);
                     property, style);
             }
             }
             else
             else
@@ -286,87 +287,87 @@ namespace bs.Editor
                 {
                 {
                     case SerializableProperty.FieldType.Int:
                     case SerializableProperty.FieldType.Int:
                         if (style != null && style.StyleFlags.HasFlag(InspectableFieldStyleFlags.AsLayerMask))
                         if (style != null && style.StyleFlags.HasFlag(InspectableFieldStyleFlags.AsLayerMask))
-                            field = new InspectableLayerMask(parent, title, path, depth, layout, property);
+                            field = new InspectableLayerMask(context, title, path, depth, layout, property);
                         else
                         else
                         {
                         {
                             if (style?.RangeStyle == null || !style.RangeStyle.Slider)
                             if (style?.RangeStyle == null || !style.RangeStyle.Slider)
-                                field = new InspectableInt(parent, title, path, depth, layout, property, style);
+                                field = new InspectableInt(context, title, path, depth, layout, property, style);
                             else
                             else
-                                field = new InspectableRangedInt(parent, title, path, depth, layout, property, style);
+                                field = new InspectableRangedInt(context, title, path, depth, layout, property, style);
                         }
                         }
 
 
                         break;
                         break;
                     case SerializableProperty.FieldType.Float:
                     case SerializableProperty.FieldType.Float:
                         if (style?.RangeStyle == null || !style.RangeStyle.Slider)
                         if (style?.RangeStyle == null || !style.RangeStyle.Slider)
-                            field = new InspectableFloat(parent, title, path, depth, layout, property, style);
+                            field = new InspectableFloat(context, title, path, depth, layout, property, style);
                         else
                         else
-                            field = new InspectableRangedFloat(parent, title, path, depth, layout, property, style);
+                            field = new InspectableRangedFloat(context, title, path, depth, layout, property, style);
                         break;
                         break;
                     case SerializableProperty.FieldType.Bool:
                     case SerializableProperty.FieldType.Bool:
-                        field = new InspectableBool(parent, title, path, depth, layout, property);
+                        field = new InspectableBool(context, title, path, depth, layout, property);
                         break;
                         break;
                     case SerializableProperty.FieldType.Color:
                     case SerializableProperty.FieldType.Color:
-                        field = new InspectableColor(parent, title, path, depth, layout, property);
+                        field = new InspectableColor(context, title, path, depth, layout, property);
                         break;
                         break;
                     case SerializableProperty.FieldType.ColorGradient:
                     case SerializableProperty.FieldType.ColorGradient:
-                        field = new InspectableColorGradient(parent, title, path, depth, layout, property);
+                        field = new InspectableColorGradient(context, title, path, depth, layout, property);
                         break;
                         break;
                     case SerializableProperty.FieldType.Curve:
                     case SerializableProperty.FieldType.Curve:
-                        field = new InspectableCurve(parent, title, path, depth, layout, property);
+                        field = new InspectableCurve(context, title, path, depth, layout, property);
                         break;
                         break;
                     case SerializableProperty.FieldType.FloatDistribution:
                     case SerializableProperty.FieldType.FloatDistribution:
-                        field = new InspectableFloatDistribution(parent, title, path, depth, layout, property);
+                        field = new InspectableFloatDistribution(context, title, path, depth, layout, property);
                         break;
                         break;
                     case SerializableProperty.FieldType.Vector2Distribution:
                     case SerializableProperty.FieldType.Vector2Distribution:
-                        field = new InspectableVector2Distribution(parent, title, path, depth, layout, property);
+                        field = new InspectableVector2Distribution(context, title, path, depth, layout, property);
                         break;
                         break;
                     case SerializableProperty.FieldType.Vector3Distribution:
                     case SerializableProperty.FieldType.Vector3Distribution:
-                        field = new InspectableVector3Distribution(parent, title, path, depth, layout, property);
+                        field = new InspectableVector3Distribution(context, title, path, depth, layout, property);
                         break;
                         break;
                     case SerializableProperty.FieldType.ColorDistribution:
                     case SerializableProperty.FieldType.ColorDistribution:
-                        field = new InspectableColorDistribution(parent, title, path, depth, layout, property);
+                        field = new InspectableColorDistribution(context, title, path, depth, layout, property);
                         break;
                         break;
                     case SerializableProperty.FieldType.String:
                     case SerializableProperty.FieldType.String:
-                        field = new InspectableString(parent, title, path, depth, layout, property);
+                        field = new InspectableString(context, title, path, depth, layout, property);
                         break;
                         break;
                     case SerializableProperty.FieldType.Vector2:
                     case SerializableProperty.FieldType.Vector2:
-                        field = new InspectableVector2(parent, title, path, depth, layout, property);
+                        field = new InspectableVector2(context, title, path, depth, layout, property);
                         break;
                         break;
                     case SerializableProperty.FieldType.Vector3:
                     case SerializableProperty.FieldType.Vector3:
-                        field = new InspectableVector3(parent, title, path, depth, layout, property);
+                        field = new InspectableVector3(context, title, path, depth, layout, property);
                         break;
                         break;
                     case SerializableProperty.FieldType.Vector4:
                     case SerializableProperty.FieldType.Vector4:
-                        field = new InspectableVector4(parent, title, path, depth, layout, property);
+                        field = new InspectableVector4(context, title, path, depth, layout, property);
                         break;
                         break;
                     case SerializableProperty.FieldType.Quaternion:
                     case SerializableProperty.FieldType.Quaternion:
                         if (style != null && style.StyleFlags.HasFlag(InspectableFieldStyleFlags.AsQuaternion))
                         if (style != null && style.StyleFlags.HasFlag(InspectableFieldStyleFlags.AsQuaternion))
-                            field = new InspectableQuaternion(parent, title, path, depth, layout, property);
+                            field = new InspectableQuaternion(context, title, path, depth, layout, property);
                         else
                         else
-                            field = new InspectableEuler(parent, title, path, depth, layout, property);
+                            field = new InspectableEuler(context, title, path, depth, layout, property);
                         break;
                         break;
                     case SerializableProperty.FieldType.Resource:
                     case SerializableProperty.FieldType.Resource:
-                        field = new InspectableResource(parent, title, path, depth, layout, property);
+                        field = new InspectableResource(context, title, path, depth, layout, property);
                         break;
                         break;
                     case SerializableProperty.FieldType.RRef:
                     case SerializableProperty.FieldType.RRef:
-                        field = new InspectableRRef(parent, title, path, depth, layout, property);
+                        field = new InspectableRRef(context, title, path, depth, layout, property);
                         break;
                         break;
                     case SerializableProperty.FieldType.GameObjectRef:
                     case SerializableProperty.FieldType.GameObjectRef:
-                        field = new InspectableGameObjectRef(parent, title, path, depth, layout, property);
+                        field = new InspectableGameObjectRef(context, title, path, depth, layout, property);
                         break;
                         break;
                     case SerializableProperty.FieldType.Object:
                     case SerializableProperty.FieldType.Object:
-                        field = new InspectableObject(parent, title, path, depth, layout, property, style);
+                        field = new InspectableObject(context, title, path, depth, layout, property, style);
                         break;
                         break;
                     case SerializableProperty.FieldType.Array:
                     case SerializableProperty.FieldType.Array:
-                        field = new InspectableArray(parent, title, path, depth, layout, property, style);
+                        field = new InspectableArray(context, title, path, depth, layout, property, style);
                         break;
                         break;
                     case SerializableProperty.FieldType.List:
                     case SerializableProperty.FieldType.List:
-                        field = new InspectableList(parent, title, path, depth, layout, property);
+                        field = new InspectableList(context, title, path, depth, layout, property);
                         break;
                         break;
                     case SerializableProperty.FieldType.Dictionary:
                     case SerializableProperty.FieldType.Dictionary:
-                        field = new InspectableDictionary(parent, title, path, depth, layout, property);
+                        field = new InspectableDictionary(context, title, path, depth, layout, property);
                         break;
                         break;
                     case SerializableProperty.FieldType.Enum:
                     case SerializableProperty.FieldType.Enum:
-                        field = new InspectableEnum(parent, title, path, depth, layout, property);
+                        field = new InspectableEnum(context, title, path, depth, layout, property);
                         break;
                         break;
                 }
                 }
             }
             }
@@ -444,5 +445,35 @@ namespace bs.Editor
         }
         }
     }
     }
 
 
+    /// <summary>
+    /// Contains information shared between multiple inspector fields.
+    /// </summary>
+    public class InspectableContext
+    {
+        /// <summary>
+        /// Creates a new context.
+        /// </summary>
+        public InspectableContext()
+        {
+            Persistent = new SerializableProperties();
+        }
+
+
+        /// <summary>
+        /// Creates a new context with user-provided peristent property storage.
+        /// </summary>
+        /// <param name="persistent">Existing object into which to inspectable fields can store persistent data.</param>
+        public InspectableContext(SerializableProperties persistent)
+        {
+            Persistent = persistent;
+        }
+
+        /// <summary>
+        /// A set of properties that the inspector can read/write. They will be persisted even after the inspector is closed
+        /// and restored when it is re-opened.
+        /// </summary>
+        public SerializableProperties Persistent { get; }
+    }
+
     /** @} */
     /** @} */
 }
 }

+ 3 - 3
Source/EditorManaged/Windows/Inspector/InspectableFloat.cs

@@ -20,7 +20,7 @@ namespace bs.Editor
         /// <summary>
         /// <summary>
         /// Creates a new inspectable float GUI for the specified property.
         /// Creates a new inspectable float GUI for the specified property.
         /// </summary>
         /// </summary>
-        /// <param name="parent">Parent Inspector this field belongs to.</param>
+        /// <param name="context">Context shared by all inspectable fields created by the same parent.</param>
         /// <param name="title">Name of the property, or some other value to set as the title.</param>
         /// <param name="title">Name of the property, or some other value to set as the title.</param>
         /// <param name="path">Full path to this property (includes name of this property and all parent properties).</param>
         /// <param name="path">Full path to this property (includes name of this property and all parent properties).</param>
         /// <param name="depth">Determines how deep within the inspector nesting hierarchy is this field. Some fields may
         /// <param name="depth">Determines how deep within the inspector nesting hierarchy is this field. Some fields may
@@ -28,9 +28,9 @@ namespace bs.Editor
         /// <param name="layout">Parent layout that all the field elements will be added to.</param>
         /// <param name="layout">Parent layout that all the field elements will be added to.</param>
         /// <param name="property">Serializable property referencing the field whose contents to display.</param>
         /// <param name="property">Serializable property referencing the field whose contents to display.</param>
         /// <param name="style">Information that can be used for customizing field rendering and behaviour.</param>
         /// <param name="style">Information that can be used for customizing field rendering and behaviour.</param>
-        public InspectableFloat(Inspector parent, string title, string path, int depth, InspectableFieldLayout layout, 
+        public InspectableFloat(InspectableContext context, string title, string path, int depth, InspectableFieldLayout layout, 
             SerializableProperty property, InspectableFieldStyleInfo style)
             SerializableProperty property, InspectableFieldStyleInfo style)
-            : base(parent, title, path, SerializableProperty.FieldType.Float, depth, layout, property)
+            : base(context, title, path, SerializableProperty.FieldType.Float, depth, layout, property)
         {
         {
             this.style = style;
             this.style = style;
         }
         }

+ 3 - 3
Source/EditorManaged/Windows/Inspector/InspectableFloatDistribution.cs

@@ -20,16 +20,16 @@ namespace bs.Editor
         /// <summary>
         /// <summary>
         /// Creates a new inspectable float distribution GUI for the specified property.
         /// Creates a new inspectable float distribution GUI for the specified property.
         /// </summary>
         /// </summary>
-        /// <param name="parent">Parent Inspector this field belongs to.</param>
+        /// <param name="context">Context shared by all inspectable fields created by the same parent.</param>
         /// <param name="title">Name of the property, or some other value to set as the title.</param>
         /// <param name="title">Name of the property, or some other value to set as the title.</param>
         /// <param name="path">Full path to this property (includes name of this property and all parent properties).</param>
         /// <param name="path">Full path to this property (includes name of this property and all parent properties).</param>
         /// <param name="depth">Determines how deep within the inspector nesting hierarchy is this field. Some fields may
         /// <param name="depth">Determines how deep within the inspector nesting hierarchy is this field. Some fields may
         ///                     contain other fields, in which case you should increase this value by one.</param>
         ///                     contain other fields, in which case you should increase this value by one.</param>
         /// <param name="layout">Parent layout that all the field elements will be added to.</param>
         /// <param name="layout">Parent layout that all the field elements will be added to.</param>
         /// <param name="property">Serializable property referencing the field whose contents to display.</param>
         /// <param name="property">Serializable property referencing the field whose contents to display.</param>
-        public InspectableFloatDistribution(Inspector parent, string title, string path, int depth, 
+        public InspectableFloatDistribution(InspectableContext context, string title, string path, int depth, 
             InspectableFieldLayout layout, SerializableProperty property)
             InspectableFieldLayout layout, SerializableProperty property)
-            : base(parent, title, path, SerializableProperty.FieldType.FloatDistribution, depth, layout, property)
+            : base(context, title, path, SerializableProperty.FieldType.FloatDistribution, depth, layout, property)
         { }
         { }
 
 
         /// <inheritoc/>
         /// <inheritoc/>

+ 3 - 3
Source/EditorManaged/Windows/Inspector/InspectableGameObjectRef.cs

@@ -19,16 +19,16 @@ namespace bs.Editor
         /// <summary>
         /// <summary>
         /// Creates a new inspectable game object reference GUI for the specified property.
         /// Creates a new inspectable game object reference GUI for the specified property.
         /// </summary>
         /// </summary>
-        /// <param name="parent">Parent Inspector this field belongs to.</param>
+        /// <param name="context">Context shared by all inspectable fields created by the same parent.</param>
         /// <param name="title">Name of the property, or some other value to set as the title.</param>
         /// <param name="title">Name of the property, or some other value to set as the title.</param>
         /// <param name="path">Full path to this property (includes name of this property and all parent properties).</param>
         /// <param name="path">Full path to this property (includes name of this property and all parent properties).</param>
         /// <param name="depth">Determines how deep within the inspector nesting hierarchy is this field. Some fields may
         /// <param name="depth">Determines how deep within the inspector nesting hierarchy is this field. Some fields may
         ///                     contain other fields, in which case you should increase this value by one.</param>
         ///                     contain other fields, in which case you should increase this value by one.</param>
         /// <param name="layout">Parent layout that all the field elements will be added to.</param>
         /// <param name="layout">Parent layout that all the field elements will be added to.</param>
         /// <param name="property">Serializable property referencing the field whose contents to display.</param>
         /// <param name="property">Serializable property referencing the field whose contents to display.</param>
-        public InspectableGameObjectRef(Inspector parent, string title, string path, int depth, InspectableFieldLayout layout,
+        public InspectableGameObjectRef(InspectableContext context, string title, string path, int depth, InspectableFieldLayout layout,
             SerializableProperty property)
             SerializableProperty property)
-            : base(parent, title, path, SerializableProperty.FieldType.GameObjectRef, depth, layout, property)
+            : base(context, title, path, SerializableProperty.FieldType.GameObjectRef, depth, layout, property)
         {
         {
 
 
         }
         }

+ 3 - 3
Source/EditorManaged/Windows/Inspector/InspectableInt.cs

@@ -21,7 +21,7 @@ namespace bs.Editor
         /// <summary>
         /// <summary>
         /// Creates a new inspectable integer GUI for the specified property.
         /// Creates a new inspectable integer GUI for the specified property.
         /// </summary>
         /// </summary>
-        /// <param name="parent">Parent Inspector this field belongs to.</param>
+        /// <param name="context">Context shared by all inspectable fields created by the same parent.</param>
         /// <param name="title">Name of the property, or some other value to set as the title.</param>
         /// <param name="title">Name of the property, or some other value to set as the title.</param>
         /// <param name="path">Full path to this property (includes name of this property and all parent properties).</param>
         /// <param name="path">Full path to this property (includes name of this property and all parent properties).</param>
         /// <param name="depth">Determines how deep within the inspector nesting hierarchy is this field. Some fields may
         /// <param name="depth">Determines how deep within the inspector nesting hierarchy is this field. Some fields may
@@ -29,9 +29,9 @@ namespace bs.Editor
         /// <param name="layout">Parent layout that all the field elements will be added to.</param>
         /// <param name="layout">Parent layout that all the field elements will be added to.</param>
         /// <param name="property">Serializable property referencing the field whose contents to display.</param>
         /// <param name="property">Serializable property referencing the field whose contents to display.</param>
         /// <param name="style">Information that can be used for customizing field rendering and behaviour.</param>
         /// <param name="style">Information that can be used for customizing field rendering and behaviour.</param>
-        public InspectableInt(Inspector parent, string title, string path, int depth, InspectableFieldLayout layout, 
+        public InspectableInt(InspectableContext context, string title, string path, int depth, InspectableFieldLayout layout, 
             SerializableProperty property, InspectableFieldStyleInfo style)
             SerializableProperty property, InspectableFieldStyleInfo style)
-            : base(parent, title, path, SerializableProperty.FieldType.Int, depth, layout, property)
+            : base(context, title, path, SerializableProperty.FieldType.Int, depth, layout, property)
         {
         {
             this.style = style;
             this.style = style;
         }
         }

+ 3 - 3
Source/EditorManaged/Windows/Inspector/InspectableLayerMask.cs

@@ -21,16 +21,16 @@ namespace bs.Editor
         /// <summary>
         /// <summary>
         /// Creates a new inspectable layer mask GUI for the specified property.
         /// Creates a new inspectable layer mask GUI for the specified property.
         /// </summary>
         /// </summary>
-        /// <param name="parent">Parent Inspector this field belongs to.</param>
+        /// <param name="context">Context shared by all inspectable fields created by the same parent.</param>
         /// <param name="title">Name of the property, or some other value to set as the title.</param>
         /// <param name="title">Name of the property, or some other value to set as the title.</param>
         /// <param name="path">Full path to this property (includes name of this property and all parent properties).</param>
         /// <param name="path">Full path to this property (includes name of this property and all parent properties).</param>
         /// <param name="depth">Determines how deep within the inspector nesting hierarchy is this field. Some fields may
         /// <param name="depth">Determines how deep within the inspector nesting hierarchy is this field. Some fields may
         ///                     contain other fields, in which case you should increase this value by one.</param>
         ///                     contain other fields, in which case you should increase this value by one.</param>
         /// <param name="layout">Parent layout that all the field elements will be added to.</param>
         /// <param name="layout">Parent layout that all the field elements will be added to.</param>
         /// <param name="property">Serializable property referencing the field whose contents to display.</param>
         /// <param name="property">Serializable property referencing the field whose contents to display.</param>
-        public InspectableLayerMask(Inspector parent, string title, string path, int depth, InspectableFieldLayout layout,
+        public InspectableLayerMask(InspectableContext context, string title, string path, int depth, InspectableFieldLayout layout,
             SerializableProperty property)
             SerializableProperty property)
-            : base(parent, title, path, SerializableProperty.FieldType.Int, depth, layout, property)
+            : base(context, title, path, SerializableProperty.FieldType.Int, depth, layout, property)
         {
         {
         }
         }
 
 

+ 18 - 18
Source/EditorManaged/Windows/Inspector/InspectableList.cs

@@ -22,16 +22,16 @@ namespace bs.Editor
         /// <summary>
         /// <summary>
         /// Creates a new inspectable list GUI for the specified property.
         /// Creates a new inspectable list GUI for the specified property.
         /// </summary>
         /// </summary>
-        /// <param name="parent">Parent Inspector this field belongs to.</param>
+        /// <param name="context">Context shared by all inspectable fields created by the same parent.</param>
         /// <param name="title">Name of the property, or some other value to set as the title.</param>
         /// <param name="title">Name of the property, or some other value to set as the title.</param>
         /// <param name="path">Full path to this property (includes name of this property and all parent properties).</param>
         /// <param name="path">Full path to this property (includes name of this property and all parent properties).</param>
         /// <param name="depth">Determines how deep within the inspector nesting hierarchy is this field. Some fields may
         /// <param name="depth">Determines how deep within the inspector nesting hierarchy is this field. Some fields may
         ///                     contain other fields, in which case you should increase this value by one.</param>
         ///                     contain other fields, in which case you should increase this value by one.</param>
         /// <param name="layout">Parent layout that all the field elements will be added to.</param>
         /// <param name="layout">Parent layout that all the field elements will be added to.</param>
         /// <param name="property">Serializable property referencing the list whose contents to display.</param>
         /// <param name="property">Serializable property referencing the list whose contents to display.</param>
-        public InspectableList(Inspector parent, string title, string path, int depth, InspectableFieldLayout layout,
+        public InspectableList(InspectableContext context, string title, string path, int depth, InspectableFieldLayout layout,
             SerializableProperty property)
             SerializableProperty property)
-            : base(parent, title, path, SerializableProperty.FieldType.List, depth, layout, property)
+            : base(context, title, path, SerializableProperty.FieldType.List, depth, layout, property)
         {
         {
 
 
         }
         }
@@ -53,9 +53,9 @@ namespace bs.Editor
         {
         {
             GUILayout arrayLayout = layout.AddLayoutY(layoutIndex);
             GUILayout arrayLayout = layout.AddLayoutY(layoutIndex);
 
 
-            listGUIField = InspectableListGUI.Create(parent, title, path, property, arrayLayout, depth);
-            listGUIField.IsExpanded = parent.Persistent.GetBool(path + "_Expanded");
-            listGUIField.OnExpand += x => parent.Persistent.SetBool(path + "_Expanded", x);
+            listGUIField = InspectableListGUI.Create(context, title, path, property, arrayLayout, depth);
+            listGUIField.IsExpanded = context.Persistent.GetBool(path + "_Expanded");
+            listGUIField.OnExpand += x => context.Persistent.SetBool(path + "_Expanded", x);
         }
         }
 
 
         /// <summary>
         /// <summary>
@@ -65,16 +65,16 @@ namespace bs.Editor
         {
         {
             private IList list;
             private IList list;
             private int numElements;
             private int numElements;
-            private Inspector parent;
+            private InspectableContext context;
             private SerializableProperty property;
             private SerializableProperty property;
             private string path;
             private string path;
 
 
             /// <summary>
             /// <summary>
-            /// Returns the parent inspector the array GUI belongs to.
+            /// Context shared by all inspectable fields created by the same parent.
             /// </summary>
             /// </summary>
-            public Inspector Inspector
+            public InspectableContext Context
             {
             {
-                get { return parent; }
+                get { return context; }
             }
             }
 
 
             /// <summary>
             /// <summary>
@@ -88,7 +88,7 @@ namespace bs.Editor
             /// <summary>
             /// <summary>
             /// Constructs a new empty inspectable list GUI.
             /// Constructs a new empty inspectable list GUI.
             /// </summary>
             /// </summary>
-            /// <param name="parent">Parent Inspector this field belongs to.</param>
+            /// <param name="context">Context shared by all inspectable fields created by the same parent.</param>
             /// <param name="title">Label to display on the list GUI title.</param>
             /// <param name="title">Label to display on the list GUI title.</param>
             /// <param name="path">Full path to this property (includes name of this property and all parent properties).
             /// <param name="path">Full path to this property (includes name of this property and all parent properties).
             /// </param>
             /// </param>
@@ -97,12 +97,12 @@ namespace bs.Editor
             /// <param name="depth">Determines at which depth to render the background. Useful when you have multiple
             /// <param name="depth">Determines at which depth to render the background. Useful when you have multiple
             ///                     nested containers whose backgrounds are overlaping. Also determines background style,
             ///                     nested containers whose backgrounds are overlaping. Also determines background style,
             ///                     depths divisible by two will use an alternate style.</param>
             ///                     depths divisible by two will use an alternate style.</param>
-            public InspectableListGUI(Inspector parent, LocString title, string path, SerializableProperty property, 
-                GUILayout layout, int depth)
+            public InspectableListGUI(InspectableContext context, LocString title, string path, 
+                SerializableProperty property, GUILayout layout, int depth)
                 : base(title, layout, depth)
                 : base(title, layout, depth)
             {
             {
                 this.property = property;
                 this.property = property;
-                this.parent = parent;
+                this.context = context;
                 this.path = path;
                 this.path = path;
 
 
                 list = property.GetValue<IList>();
                 list = property.GetValue<IList>();
@@ -113,7 +113,7 @@ namespace bs.Editor
             /// <summary>
             /// <summary>
             /// Creates a new inspectable list GUI object that displays the contents of the provided serializable property.
             /// Creates a new inspectable list GUI object that displays the contents of the provided serializable property.
             /// </summary>
             /// </summary>
-            /// <param name="parent">Parent Inspector this field belongs to.</param>
+            /// <param name="context">Context shared by all inspectable fields created by the same parent.</param>
             /// <param name="title">Label to display on the list GUI title.</param>
             /// <param name="title">Label to display on the list GUI title.</param>
             /// <param name="path">Full path to this property (includes name of this property and all parent properties).
             /// <param name="path">Full path to this property (includes name of this property and all parent properties).
             /// </param>
             /// </param>
@@ -122,10 +122,10 @@ namespace bs.Editor
             /// <param name="depth">Determines at which depth to render the background. Useful when you have multiple
             /// <param name="depth">Determines at which depth to render the background. Useful when you have multiple
             ///                     nested containers whose backgrounds are overlaping. Also determines background style,
             ///                     nested containers whose backgrounds are overlaping. Also determines background style,
             ///                     depths divisible by two will use an alternate style.</param>
             ///                     depths divisible by two will use an alternate style.</param>
-            public static InspectableListGUI Create(Inspector parent, LocString title, string path, 
+            public static InspectableListGUI Create(InspectableContext context, LocString title, string path, 
                 SerializableProperty property, GUILayout layout, int depth)
                 SerializableProperty property, GUILayout layout, int depth)
             {
             {
-                InspectableListGUI listGUI = new InspectableListGUI(parent, title, path, property, layout, depth);
+                InspectableListGUI listGUI = new InspectableListGUI(context, title, path, property, layout, depth);
                 listGUI.BuildGUI();
                 listGUI.BuildGUI();
 
 
                 return listGUI;
                 return listGUI;
@@ -290,7 +290,7 @@ namespace bs.Editor
                 SerializableProperty property = GetValue<SerializableProperty>();
                 SerializableProperty property = GetValue<SerializableProperty>();
 
 
                 string entryPath = listParent.Path + "[" + SeqIndex + "]";
                 string entryPath = listParent.Path + "[" + SeqIndex + "]";
-                field = CreateField(listParent.Inspector, SeqIndex + ".", entryPath, 0, Depth + 1,
+                field = CreateField(listParent.Context, SeqIndex + ".", entryPath, 0, Depth + 1,
                     new InspectableFieldLayout(layout), property, new InspectableFieldStyleInfo());
                     new InspectableFieldLayout(layout), property, new InspectableFieldStyleInfo());
 
 
                 return field.GetTitleLayout();
                 return field.GetTitleLayout();

+ 6 - 6
Source/EditorManaged/Windows/Inspector/InspectableObject.cs

@@ -38,7 +38,7 @@ namespace bs.Editor
         /// <summary>
         /// <summary>
         /// Creates a new inspectable object GUI for the specified property.
         /// Creates a new inspectable object GUI for the specified property.
         /// </summary>
         /// </summary>
-        /// <param name="parent">Parent Inspector this field belongs to.</param>
+        /// <param name="context">Context shared by all inspectable fields created by the same parent.</param>
         /// <param name="title">Name of the property, or some other value to set as the title.</param>
         /// <param name="title">Name of the property, or some other value to set as the title.</param>
         /// <param name="path">Full path to this property (includes name of this property and all parent properties).</param>
         /// <param name="path">Full path to this property (includes name of this property and all parent properties).</param>
         /// <param name="depth">Determines how deep within the inspector nesting hierarchy is this field. Some fields may
         /// <param name="depth">Determines how deep within the inspector nesting hierarchy is this field. Some fields may
@@ -46,12 +46,12 @@ namespace bs.Editor
         /// <param name="layout">Parent layout that all the field elements will be added to.</param>
         /// <param name="layout">Parent layout that all the field elements will be added to.</param>
         /// <param name="property">Serializable property referencing the object whose contents to display.</param>
         /// <param name="property">Serializable property referencing the object whose contents to display.</param>
         /// <param name="style">Information that can be used for customizing field rendering and behaviour.</param>
         /// <param name="style">Information that can be used for customizing field rendering and behaviour.</param>
-        public InspectableObject(Inspector parent, string title, string path, int depth, InspectableFieldLayout layout, 
+        public InspectableObject(InspectableContext context, string title, string path, int depth, InspectableFieldLayout layout, 
             SerializableProperty property, InspectableFieldStyleInfo style)
             SerializableProperty property, InspectableFieldStyleInfo style)
-            : base(parent, title, path, SerializableProperty.FieldType.Object, depth, layout, property)
+            : base(context, title, path, SerializableProperty.FieldType.Object, depth, layout, property)
         {
         {
             this.style = style;
             this.style = style;
-            isExpanded = parent.Persistent.GetBool(path + "_Expanded");
+            isExpanded = context.Persistent.GetBool(path + "_Expanded");
             isInline = style != null && style.StyleFlags.HasFlag(InspectableFieldStyleFlags.Inline);
             isInline = style != null && style.StyleFlags.HasFlag(InspectableFieldStyleFlags.Inline);
 
 
             // Builds a context menu that lets the user create objects to assign to this field.
             // Builds a context menu that lets the user create objects to assign to this field.
@@ -213,7 +213,7 @@ namespace bs.Editor
                         else
                         else
                             guiContentLayout = guiLayout;
                             guiContentLayout = guiLayout;
 
 
-                        children = CreateFields(serializableObject, parent, path, depth + 1, guiContentLayout);
+                        children = CreateFields(serializableObject, context, path, depth + 1, guiContentLayout);
                     }
                     }
                 }
                 }
                 else
                 else
@@ -293,7 +293,7 @@ namespace bs.Editor
         /// <param name="expanded">Determines whether the contents were expanded or collapsed.</param>
         /// <param name="expanded">Determines whether the contents were expanded or collapsed.</param>
         private void OnFoldoutToggled(bool expanded)
         private void OnFoldoutToggled(bool expanded)
         {
         {
-            parent.Persistent.SetBool(path + "_Expanded", expanded);
+            context.Persistent.SetBool(path + "_Expanded", expanded);
 
 
             isExpanded = expanded;
             isExpanded = expanded;
             forceUpdate = true;
             forceUpdate = true;

+ 3 - 3
Source/EditorManaged/Windows/Inspector/InspectableQuaternion.cs

@@ -19,16 +19,16 @@ namespace bs.Editor
         /// <summary>
         /// <summary>
         /// Creates a new inspectable quaternion GUI for the specified property.
         /// Creates a new inspectable quaternion GUI for the specified property.
         /// </summary>
         /// </summary>
-        /// <param name="parent">Parent Inspector this field belongs to.</param>
+        /// <param name="context">Context shared by all inspectable fields created by the same parent.</param>
         /// <param name="title">Name of the property, or some other value to set as the title.</param>
         /// <param name="title">Name of the property, or some other value to set as the title.</param>
         /// <param name="path">Full path to this property (includes name of this property and all parent properties).</param>
         /// <param name="path">Full path to this property (includes name of this property and all parent properties).</param>
         /// <param name="depth">Determines how deep within the inspector nesting hierarchy is this field. Some fields may
         /// <param name="depth">Determines how deep within the inspector nesting hierarchy is this field. Some fields may
         ///                     contain other fields, in which case you should increase this value by one.</param>
         ///                     contain other fields, in which case you should increase this value by one.</param>
         /// <param name="layout">Parent layout that all the field elements will be added to.</param>
         /// <param name="layout">Parent layout that all the field elements will be added to.</param>
         /// <param name="property">Serializable property referencing the field whose contents to display.</param>
         /// <param name="property">Serializable property referencing the field whose contents to display.</param>
-        public InspectableQuaternion(Inspector parent, string title, string path, int depth, InspectableFieldLayout layout,
+        public InspectableQuaternion(InspectableContext context, string title, string path, int depth, InspectableFieldLayout layout,
             SerializableProperty property)
             SerializableProperty property)
-            : base(parent, title, path, SerializableProperty.FieldType.Quaternion, depth, layout, property)
+            : base(context, title, path, SerializableProperty.FieldType.Quaternion, depth, layout, property)
         {
         {
 
 
         }
         }

+ 3 - 3
Source/EditorManaged/Windows/Inspector/InspectableRRef.cs

@@ -19,16 +19,16 @@ namespace bs.Editor
         /// <summary>
         /// <summary>
         /// Creates a new inspectable resource reference GUI for the specified property.
         /// Creates a new inspectable resource reference GUI for the specified property.
         /// </summary>
         /// </summary>
-        /// <param name="parent">Parent Inspector this field belongs to.</param>
+        /// <param name="context">Context shared by all inspectable fields created by the same parent.</param>
         /// <param name="title">Name of the property, or some other value to set as the title.</param>
         /// <param name="title">Name of the property, or some other value to set as the title.</param>
         /// <param name="path">Full path to this property (includes name of this property and all parent properties).</param>
         /// <param name="path">Full path to this property (includes name of this property and all parent properties).</param>
         /// <param name="depth">Determines how deep within the inspector nesting hierarchy is this field. Some fields may
         /// <param name="depth">Determines how deep within the inspector nesting hierarchy is this field. Some fields may
         ///                     contain other fields, in which case you should increase this value by one.</param>
         ///                     contain other fields, in which case you should increase this value by one.</param>
         /// <param name="layout">Parent layout that all the field elements will be added to.</param>
         /// <param name="layout">Parent layout that all the field elements will be added to.</param>
         /// <param name="property">Serializable property referencing the field whose contents to display.</param>
         /// <param name="property">Serializable property referencing the field whose contents to display.</param>
-        public InspectableRRef(Inspector parent, string title, string path, int depth, InspectableFieldLayout layout,
+        public InspectableRRef(InspectableContext context, string title, string path, int depth, InspectableFieldLayout layout,
             SerializableProperty property)
             SerializableProperty property)
-            : base(parent, title, path, SerializableProperty.FieldType.RRef, depth, layout, property)
+            : base(context, title, path, SerializableProperty.FieldType.RRef, depth, layout, property)
         {
         {
 
 
         }
         }

+ 3 - 3
Source/EditorManaged/Windows/Inspector/InspectableRadian.cs

@@ -21,7 +21,7 @@ namespace bs.Editor
         /// <summary>
         /// <summary>
         /// Creates a new inspectable float GUI for the specified property.
         /// Creates a new inspectable float GUI for the specified property.
         /// </summary>
         /// </summary>
-        /// <param name="parent">Parent Inspector this field belongs to.</param>
+        /// <param name="context">Context shared by all inspectable fields created by the same parent.</param>
         /// <param name="title">Name of the property, or some other value to set as the title.</param>
         /// <param name="title">Name of the property, or some other value to set as the title.</param>
         /// <param name="path">Full path to this property (includes name of this property and all parent properties).</param>
         /// <param name="path">Full path to this property (includes name of this property and all parent properties).</param>
         /// <param name="depth">Determines how deep within the inspector nesting hierarchy is this field. Some fields may
         /// <param name="depth">Determines how deep within the inspector nesting hierarchy is this field. Some fields may
@@ -29,9 +29,9 @@ namespace bs.Editor
         /// <param name="layout">Parent layout that all the field elements will be added to.</param>
         /// <param name="layout">Parent layout that all the field elements will be added to.</param>
         /// <param name="property">Serializable property referencing the field whose contents to display.</param>
         /// <param name="property">Serializable property referencing the field whose contents to display.</param>
         /// <param name="style">Information that can be used for customizing field rendering and behaviour.</param>
         /// <param name="style">Information that can be used for customizing field rendering and behaviour.</param>
-        public InspectableRadian(Inspector parent, string title, string path, int depth, InspectableFieldLayout layout,
+        public InspectableRadian(InspectableContext context, string title, string path, int depth, InspectableFieldLayout layout,
             SerializableProperty property, InspectableFieldStyleInfo style)
             SerializableProperty property, InspectableFieldStyleInfo style)
-            : base(parent, title, path, SerializableProperty.FieldType.Object, depth, layout, property)
+            : base(context, title, path, SerializableProperty.FieldType.Object, depth, layout, property)
         {
         {
             this.style = style;
             this.style = style;
         }
         }

+ 4 - 3
Source/EditorManaged/Windows/Inspector/InspectableRangedField.cs

@@ -17,7 +17,7 @@ namespace bs.Editor
         /// <summary>
         /// <summary>
         /// Creates a new inspectable ranged field GUI for the specified property.
         /// Creates a new inspectable ranged field GUI for the specified property.
         /// </summary>
         /// </summary>
-        /// <param name="parent">Parent Inspector this field belongs to.</param>
+        /// <param name="context">Context shared by all inspectable fields created by the same parent.</param>
         /// <param name="title">Name of the property, or some other value to set as the title.</param>
         /// <param name="title">Name of the property, or some other value to set as the title.</param>
         /// <param name="path">Full path to this property (includes name of this property and all parent properties).</param>
         /// <param name="path">Full path to this property (includes name of this property and all parent properties).</param>
         /// <param name="type">Type of property this field will be used for displaying.</param>
         /// <param name="type">Type of property this field will be used for displaying.</param>
@@ -26,8 +26,9 @@ namespace bs.Editor
         /// <param name="layout">Parent layout that all the field elements will be added to.</param>
         /// <param name="layout">Parent layout that all the field elements will be added to.</param>
         /// <param name="property">Serializable property referencing the field whose contents to display.</param>
         /// <param name="property">Serializable property referencing the field whose contents to display.</param>
         /// <param name="style">Contains information about the field style</param>
         /// <param name="style">Contains information about the field style</param>
-        public InspectableRangedField(Inspector parent, string title, string path, SerializableProperty.FieldType type,
-            int depth, InspectableFieldLayout layout, SerializableProperty property, InspectableFieldStyleInfo style) : base(parent, title, path, type, depth, layout, property)
+        public InspectableRangedField(InspectableContext context, string title, string path, SerializableProperty.FieldType type,
+            int depth, InspectableFieldLayout layout, SerializableProperty property, InspectableFieldStyleInfo style) 
+            : base(context, title, path, type, depth, layout, property)
         {
         {
             this.style = style;
             this.style = style;
         }
         }

+ 3 - 3
Source/EditorManaged/Windows/Inspector/InspectableRangedFloat.cs

@@ -19,7 +19,7 @@ namespace bs.Editor
         /// <summary>
         /// <summary>
         /// Creates a new inspectable float GUI for the specified property with a range.
         /// Creates a new inspectable float GUI for the specified property with a range.
         /// </summary>
         /// </summary>
-        /// <param name="parent">Parent Inspector this field belongs to.</param>
+        /// <param name="context">Context shared by all inspectable fields created by the same parent.</param>
         /// <param name="title">Name of the property, or some other value to set as the title.</param>
         /// <param name="title">Name of the property, or some other value to set as the title.</param>
         /// <param name="path">Full path to this property (includes name of this property and all parent properties).</param>
         /// <param name="path">Full path to this property (includes name of this property and all parent properties).</param>
         /// <param name="depth">Determines how deep within the inspector nesting hierarchy is this field. Some fields may
         /// <param name="depth">Determines how deep within the inspector nesting hierarchy is this field. Some fields may
@@ -27,9 +27,9 @@ namespace bs.Editor
         /// <param name="layout">Parent layout that all the field elements will be added to.</param>
         /// <param name="layout">Parent layout that all the field elements will be added to.</param>
         /// <param name="property">Serializable property referencing the field whose contents to display.</param>
         /// <param name="property">Serializable property referencing the field whose contents to display.</param>
         /// <param name="style">Contains information about the field style.</param>
         /// <param name="style">Contains information about the field style.</param>
-        public InspectableRangedFloat(Inspector parent, string title, string path, int depth, InspectableFieldLayout layout,
+        public InspectableRangedFloat(InspectableContext context, string title, string path, int depth, InspectableFieldLayout layout,
             SerializableProperty property, InspectableFieldStyleInfo style)
             SerializableProperty property, InspectableFieldStyleInfo style)
-            : base(parent, title, path, SerializableProperty.FieldType.Float, depth, layout, property, style)
+            : base(context, title, path, SerializableProperty.FieldType.Float, depth, layout, property, style)
         {
         {
 
 
         }
         }

+ 3 - 3
Source/EditorManaged/Windows/Inspector/InspectableRangedInt.cs

@@ -19,7 +19,7 @@ namespace bs.Editor
         /// <summary>
         /// <summary>
         /// Creates a new inspectable float GUI for the specified property with a range.
         /// Creates a new inspectable float GUI for the specified property with a range.
         /// </summary>
         /// </summary>
-        /// <param name="parent">Parent Inspector this field belongs to.</param>
+        /// <param name="context">Context shared by all inspectable fields created by the same parent.</param>
         /// <param name="title">Name of the property, or some other value to set as the title.</param>
         /// <param name="title">Name of the property, or some other value to set as the title.</param>
         /// <param name="path">Full path to this property (includes name of this property and all parent properties).</param>
         /// <param name="path">Full path to this property (includes name of this property and all parent properties).</param>
         /// <param name="depth">Determines how deep within the inspector nesting hierarchy is this field. Some fields may
         /// <param name="depth">Determines how deep within the inspector nesting hierarchy is this field. Some fields may
@@ -27,9 +27,9 @@ namespace bs.Editor
         /// <param name="layout">Parent layout that all the field elements will be added to.</param>
         /// <param name="layout">Parent layout that all the field elements will be added to.</param>
         /// <param name="property">Serializable property referencing the field whose contents to display.</param>
         /// <param name="property">Serializable property referencing the field whose contents to display.</param>
         /// <param name="style">Information about the range of the field.</param>
         /// <param name="style">Information about the range of the field.</param>
-        public InspectableRangedInt(Inspector parent, string title, string path, int depth, InspectableFieldLayout layout,
+        public InspectableRangedInt(InspectableContext context, string title, string path, int depth, InspectableFieldLayout layout,
             SerializableProperty property, InspectableFieldStyleInfo style)
             SerializableProperty property, InspectableFieldStyleInfo style)
-            : base(parent, title, path, SerializableProperty.FieldType.Int, depth, layout, property, style)
+            : base(context, title, path, SerializableProperty.FieldType.Int, depth, layout, property, style)
         {
         {
 
 
         }
         }

+ 3 - 3
Source/EditorManaged/Windows/Inspector/InspectableResource.cs

@@ -19,16 +19,16 @@ namespace bs.Editor
         /// <summary>
         /// <summary>
         /// Creates a new inspectable resource reference GUI for the specified property.
         /// Creates a new inspectable resource reference GUI for the specified property.
         /// </summary>
         /// </summary>
-        /// <param name="parent">Parent Inspector this field belongs to.</param>
+        /// <param name="context">Context shared by all inspectable fields created by the same parent.</param>
         /// <param name="title">Name of the property, or some other value to set as the title.</param>
         /// <param name="title">Name of the property, or some other value to set as the title.</param>
         /// <param name="path">Full path to this property (includes name of this property and all parent properties).</param>
         /// <param name="path">Full path to this property (includes name of this property and all parent properties).</param>
         /// <param name="depth">Determines how deep within the inspector nesting hierarchy is this field. Some fields may
         /// <param name="depth">Determines how deep within the inspector nesting hierarchy is this field. Some fields may
         ///                     contain other fields, in which case you should increase this value by one.</param>
         ///                     contain other fields, in which case you should increase this value by one.</param>
         /// <param name="layout">Parent layout that all the field elements will be added to.</param>
         /// <param name="layout">Parent layout that all the field elements will be added to.</param>
         /// <param name="property">Serializable property referencing the field whose contents to display.</param>
         /// <param name="property">Serializable property referencing the field whose contents to display.</param>
-        public InspectableResource(Inspector parent, string title, string path, int depth, InspectableFieldLayout layout,
+        public InspectableResource(InspectableContext context, string title, string path, int depth, InspectableFieldLayout layout,
             SerializableProperty property)
             SerializableProperty property)
-            : base(parent, title, path, SerializableProperty.FieldType.Resource, depth, layout, property)
+            : base(context, title, path, SerializableProperty.FieldType.Resource, depth, layout, property)
         { }
         { }
 
 
         /// <inheritoc/>
         /// <inheritoc/>

+ 3 - 3
Source/EditorManaged/Windows/Inspector/InspectableString.cs

@@ -19,16 +19,16 @@ namespace bs.Editor
         /// <summary>
         /// <summary>
         /// Creates a new inspectable string GUI for the specified property.
         /// Creates a new inspectable string GUI for the specified property.
         /// </summary>
         /// </summary>
-        /// <param name="parent">Parent Inspector this field belongs to.</param>
+        /// <param name="context">Context shared by all inspectable fields created by the same parent.</param>
         /// <param name="title">Name of the property, or some other value to set as the title.</param>
         /// <param name="title">Name of the property, or some other value to set as the title.</param>
         /// <param name="path">Full path to this property (includes name of this property and all parent properties).</param>
         /// <param name="path">Full path to this property (includes name of this property and all parent properties).</param>
         /// <param name="depth">Determines how deep within the inspector nesting hierarchy is this field. Some fields may
         /// <param name="depth">Determines how deep within the inspector nesting hierarchy is this field. Some fields may
         ///                     contain other fields, in which case you should increase this value by one.</param>
         ///                     contain other fields, in which case you should increase this value by one.</param>
         /// <param name="layout">Parent layout that all the field elements will be added to.</param>
         /// <param name="layout">Parent layout that all the field elements will be added to.</param>
         /// <param name="property">Serializable property referencing the field whose contents to display.</param>
         /// <param name="property">Serializable property referencing the field whose contents to display.</param>
-        public InspectableString(Inspector parent, string title, string path, int depth, InspectableFieldLayout layout,
+        public InspectableString(InspectableContext context, string title, string path, int depth, InspectableFieldLayout layout,
             SerializableProperty property)
             SerializableProperty property)
-            : base(parent, title, path, SerializableProperty.FieldType.String, depth, layout, property)
+            : base(context, title, path, SerializableProperty.FieldType.String, depth, layout, property)
         {
         {
 
 
         }
         }

+ 3 - 3
Source/EditorManaged/Windows/Inspector/InspectableTexture.cs

@@ -18,16 +18,16 @@ namespace bs.Editor
         /// <summary>
         /// <summary>
         /// Creates a new inspectable texture reference GUI for the specified property.
         /// Creates a new inspectable texture reference GUI for the specified property.
         /// </summary>
         /// </summary>
-        /// <param name="parent">Parent Inspector this field belongs to.</param>
+        /// <param name="context">Context shared by all inspectable fields created by the same parent.</param>
         /// <param name="title">Name of the property, or some other value to set as the title.</param>
         /// <param name="title">Name of the property, or some other value to set as the title.</param>
         /// <param name="path">Full path to this property (includes name of this property and all parent properties).</param>
         /// <param name="path">Full path to this property (includes name of this property and all parent properties).</param>
         /// <param name="depth">Determines how deep within the inspector nesting hierarchy is this field. Some fields may
         /// <param name="depth">Determines how deep within the inspector nesting hierarchy is this field. Some fields may
         ///                     contain other fields, in which case you should increase this value by one.</param>
         ///                     contain other fields, in which case you should increase this value by one.</param>
         /// <param name="layout">Parent layout that all the field elements will be added to.</param>
         /// <param name="layout">Parent layout that all the field elements will be added to.</param>
         /// <param name="property">Serializable property referencing the field whose contents to display.</param>
         /// <param name="property">Serializable property referencing the field whose contents to display.</param>
-        public InspectableTexture(Inspector parent, string title, string path, int depth, InspectableFieldLayout layout,
+        public InspectableTexture(InspectableContext context, string title, string path, int depth, InspectableFieldLayout layout,
             SerializableProperty property, InspectableFieldStyleInfo style)
             SerializableProperty property, InspectableFieldStyleInfo style)
-            : base(parent, title, path, property.Type, depth, layout, property)
+            : base(context, title, path, property.Type, depth, layout, property)
         { }
         { }
 
 
         /// <inheritoc/>
         /// <inheritoc/>

+ 3 - 3
Source/EditorManaged/Windows/Inspector/InspectableVector2.cs

@@ -19,16 +19,16 @@ namespace bs.Editor
         /// <summary>
         /// <summary>
         /// Creates a new inspectable 2D vector GUI for the specified property.
         /// Creates a new inspectable 2D vector GUI for the specified property.
         /// </summary>
         /// </summary>
-        /// <param name="parent">Parent Inspector this field belongs to.</param>
+        /// <param name="context">Context shared by all inspectable fields created by the same parent.</param>
         /// <param name="title">Name of the property, or some other value to set as the title.</param>
         /// <param name="title">Name of the property, or some other value to set as the title.</param>
         /// <param name="path">Full path to this property (includes name of this property and all parent properties).</param>
         /// <param name="path">Full path to this property (includes name of this property and all parent properties).</param>
         /// <param name="depth">Determines how deep within the inspector nesting hierarchy is this field. Some fields may
         /// <param name="depth">Determines how deep within the inspector nesting hierarchy is this field. Some fields may
         ///                     contain other fields, in which case you should increase this value by one.</param>
         ///                     contain other fields, in which case you should increase this value by one.</param>
         /// <param name="layout">Parent layout that all the field elements will be added to.</param>
         /// <param name="layout">Parent layout that all the field elements will be added to.</param>
         /// <param name="property">Serializable property referencing the field whose contents to display.</param>
         /// <param name="property">Serializable property referencing the field whose contents to display.</param>
-        public InspectableVector2(Inspector parent, string title, string path, int depth, InspectableFieldLayout layout, 
+        public InspectableVector2(InspectableContext context, string title, string path, int depth, InspectableFieldLayout layout, 
             SerializableProperty property)
             SerializableProperty property)
-            : base(parent, title, path, SerializableProperty.FieldType.Vector2, depth, layout, property)
+            : base(context, title, path, SerializableProperty.FieldType.Vector2, depth, layout, property)
         {
         {
 
 
         }
         }

+ 3 - 3
Source/EditorManaged/Windows/Inspector/InspectableVector2Distribution.cs

@@ -20,16 +20,16 @@ namespace bs.Editor
         /// <summary>
         /// <summary>
         /// Creates a new inspectable 2D vector distribution GUI for the specified property.
         /// Creates a new inspectable 2D vector distribution GUI for the specified property.
         /// </summary>
         /// </summary>
-        /// <param name="parent">Parent Inspector this field belongs to.</param>
+        /// <param name="context">Context shared by all inspectable fields created by the same parent.</param>
         /// <param name="title">Name of the property, or some other value to set as the title.</param>
         /// <param name="title">Name of the property, or some other value to set as the title.</param>
         /// <param name="path">Full path to this property (includes name of this property and all parent properties).</param>
         /// <param name="path">Full path to this property (includes name of this property and all parent properties).</param>
         /// <param name="depth">Determines how deep within the inspector nesting hierarchy is this field. Some fields may
         /// <param name="depth">Determines how deep within the inspector nesting hierarchy is this field. Some fields may
         ///                     contain other fields, in which case you should increase this value by one.</param>
         ///                     contain other fields, in which case you should increase this value by one.</param>
         /// <param name="layout">Parent layout that all the field elements will be added to.</param>
         /// <param name="layout">Parent layout that all the field elements will be added to.</param>
         /// <param name="property">Serializable property referencing the field whose contents to display.</param>
         /// <param name="property">Serializable property referencing the field whose contents to display.</param>
-        public InspectableVector2Distribution(Inspector parent, string title, string path, int depth, 
+        public InspectableVector2Distribution(InspectableContext context, string title, string path, int depth, 
             InspectableFieldLayout layout, SerializableProperty property)
             InspectableFieldLayout layout, SerializableProperty property)
-            : base(parent, title, path, SerializableProperty.FieldType.Vector2Distribution, depth, layout, property)
+            : base(context, title, path, SerializableProperty.FieldType.Vector2Distribution, depth, layout, property)
         { }
         { }
 
 
         /// <inheritoc/>
         /// <inheritoc/>

+ 3 - 3
Source/EditorManaged/Windows/Inspector/InspectableVector3.cs

@@ -19,16 +19,16 @@ namespace bs.Editor
         /// <summary>
         /// <summary>
         /// Creates a new inspectable 3D vector GUI for the specified property.
         /// Creates a new inspectable 3D vector GUI for the specified property.
         /// </summary>
         /// </summary>
-        /// <param name="parent">Parent Inspector this field belongs to.</param>
+        /// <param name="context">Context shared by all inspectable fields created by the same parent.</param>
         /// <param name="title">Name of the property, or some other value to set as the title.</param>
         /// <param name="title">Name of the property, or some other value to set as the title.</param>
         /// <param name="path">Full path to this property (includes name of this property and all parent properties).</param>
         /// <param name="path">Full path to this property (includes name of this property and all parent properties).</param>
         /// <param name="depth">Determines how deep within the inspector nesting hierarchy is this field. Some fields may
         /// <param name="depth">Determines how deep within the inspector nesting hierarchy is this field. Some fields may
         ///                     contain other fields, in which case you should increase this value by one.</param>
         ///                     contain other fields, in which case you should increase this value by one.</param>
         /// <param name="layout">Parent layout that all the field elements will be added to.</param>
         /// <param name="layout">Parent layout that all the field elements will be added to.</param>
         /// <param name="property">Serializable property referencing the field whose contents to display.</param>
         /// <param name="property">Serializable property referencing the field whose contents to display.</param>
-        public InspectableVector3(Inspector parent, string title, string path, int depth, InspectableFieldLayout layout, 
+        public InspectableVector3(InspectableContext context, string title, string path, int depth, InspectableFieldLayout layout, 
             SerializableProperty property)
             SerializableProperty property)
-            : base(parent, title, path, SerializableProperty.FieldType.Vector3, depth, layout, property)
+            : base(context, title, path, SerializableProperty.FieldType.Vector3, depth, layout, property)
         {
         {
 
 
         }
         }

+ 3 - 3
Source/EditorManaged/Windows/Inspector/InspectableVector3Distribution.cs

@@ -20,16 +20,16 @@ namespace bs.Editor
         /// <summary>
         /// <summary>
         /// Creates a new inspectable 3D vector distribution GUI for the specified property.
         /// Creates a new inspectable 3D vector distribution GUI for the specified property.
         /// </summary>
         /// </summary>
-        /// <param name="parent">Parent Inspector this field belongs to.</param>
+        /// <param name="context">Context shared by all inspectable fields created by the same parent.</param>
         /// <param name="title">Name of the property, or some other value to set as the title.</param>
         /// <param name="title">Name of the property, or some other value to set as the title.</param>
         /// <param name="path">Full path to this property (includes name of this property and all parent properties).</param>
         /// <param name="path">Full path to this property (includes name of this property and all parent properties).</param>
         /// <param name="depth">Determines how deep within the inspector nesting hierarchy is this field. Some fields may
         /// <param name="depth">Determines how deep within the inspector nesting hierarchy is this field. Some fields may
         ///                     contain other fields, in which case you should increase this value by one.</param>
         ///                     contain other fields, in which case you should increase this value by one.</param>
         /// <param name="layout">Parent layout that all the field elements will be added to.</param>
         /// <param name="layout">Parent layout that all the field elements will be added to.</param>
         /// <param name="property">Serializable property referencing the field whose contents to display.</param>
         /// <param name="property">Serializable property referencing the field whose contents to display.</param>
-        public InspectableVector3Distribution(Inspector parent, string title, string path, int depth, 
+        public InspectableVector3Distribution(InspectableContext context, string title, string path, int depth, 
             InspectableFieldLayout layout, SerializableProperty property)
             InspectableFieldLayout layout, SerializableProperty property)
-            : base(parent, title, path, SerializableProperty.FieldType.Vector3Distribution, depth, layout, property)
+            : base(context, title, path, SerializableProperty.FieldType.Vector3Distribution, depth, layout, property)
         { }
         { }
 
 
         /// <inheritoc/>
         /// <inheritoc/>

+ 3 - 3
Source/EditorManaged/Windows/Inspector/InspectableVector4.cs

@@ -19,16 +19,16 @@ namespace bs.Editor
         /// <summary>
         /// <summary>
         /// Creates a new inspectable 4D vector GUI for the specified property.
         /// Creates a new inspectable 4D vector GUI for the specified property.
         /// </summary>
         /// </summary>
-        /// <param name="parent">Parent Inspector this field belongs to.</param>
+        /// <param name="context">Context shared by all inspectable fields created by the same parent.</param>
         /// <param name="title">Name of the property, or some other value to set as the title.</param>
         /// <param name="title">Name of the property, or some other value to set as the title.</param>
         /// <param name="path">Full path to this property (includes name of this property and all parent properties).</param>
         /// <param name="path">Full path to this property (includes name of this property and all parent properties).</param>
         /// <param name="depth">Determines how deep within the inspector nesting hierarchy is this field. Some fields may
         /// <param name="depth">Determines how deep within the inspector nesting hierarchy is this field. Some fields may
         ///                     contain other fields, in which case you should increase this value by one.</param>
         ///                     contain other fields, in which case you should increase this value by one.</param>
         /// <param name="layout">Parent layout that all the field elements will be added to.</param>
         /// <param name="layout">Parent layout that all the field elements will be added to.</param>
         /// <param name="property">Serializable property referencing the field whose contents to display.</param>
         /// <param name="property">Serializable property referencing the field whose contents to display.</param>
-        public InspectableVector4(Inspector parent, string title, string path, int depth, InspectableFieldLayout layout, 
+        public InspectableVector4(InspectableContext context, string title, string path, int depth, InspectableFieldLayout layout, 
             SerializableProperty property)
             SerializableProperty property)
-            : base(parent, title, path, SerializableProperty.FieldType.Vector4, depth, layout, property)
+            : base(context, title, path, SerializableProperty.FieldType.Vector4, depth, layout, property)
         {
         {
 
 
         }
         }