Class InspectorFieldsExample
Example of using InspectorFields attributes in a class to create custom inspectors
This is on approach for building complex inspectors that need to be customized or the need to overcome lack of polymorphism support
They provide a way to create one inspector for multiple classes
Example: Create a MonoBehaviour or scriptable object with a custom inspector.
The functionality or settings can be changed by assigning a custom script to the object
Use InspectorFields to render the custom properties inside the custom script in the inspector
When the app launches, copy the properties to the new instance of the script
An example of this can be found in Interactables Receivers.
Each Receiver is a custom class that renders their properties in the Interactables custom inspector
Inheritance
InspectorFieldsExample
Assembly: cs.temp.dll.dll
public class InspectorFieldsExample : MonoBehaviour
Fields
Declaration
public int ComponentIndex
Field Value
Declaration
public string ComponentName
Field Value
Declaration
public string ComponentOption
Field Value
Declaration
Field Value
A holder for the InpsectorFields as a list
The inspector will update these settings while in the editor
Declaration
public List<InspectorPropertySetting> Settings
Field Value