Class ComponentInspector
Inspector for a single component inspector that can be drawn in a component list editor.
Namespace: UnityEditor.MARS
Syntax
public class ComponentInspector : object
Fields
activeProperty
The property that represents if the component is active.
Declaration
public SerializedProperty activeProperty
Field Value
Type | Description |
---|---|
SerializedProperty |
baseProperty
The serialized property that represents this component in the component list.
Declaration
public SerializedProperty baseProperty
Field Value
Type | Description |
---|---|
SerializedProperty |
isDirty
Has the serialization of the object changed in a way the inspector needs to be reconstructed.
Declaration
public bool isDirty
Field Value
Type | Description |
---|---|
Boolean |
Properties
EditorInspector
Parent unity editor of the object that contains the component list.
Declaration
public Editor EditorInspector { get; }
Property Value
Type | Description |
---|---|
Editor |
serializedObject
A SerializedObject representing the object or objects being inspected.
Declaration
public SerializedObject serializedObject { get; }
Property Value
Type | Description |
---|---|
SerializedObject |
target
The component being inspected.
Declaration
public UnityEngine.Object target { get; protected set; }
Property Value
Type | Description |
---|---|
UnityEngine.Object |
Methods
CleanUp()
Cleans up the component editor.
Declaration
protected virtual void CleanUp()
DrawDefaultInspector()
Draws the parameters with the default parameter property drawer in the inspector.
Declaration
public void DrawDefaultInspector()
GetDisplayTitle()
Gets the displayable name for the title.
Declaration
public virtual string GetDisplayTitle()
Returns
Type | Description |
---|---|
String | The displayable name |
GetParameters(Boolean)
Gets the serialized parameters of the component.
Declaration
public void GetParameters(bool inChildren = true)
Parameters
Type | Name | Description |
---|---|---|
Boolean | inChildren | Get the child properties of a property. |
GetToolTip()
Get the tooltip on the component from the ComponentTooltipAttribute
Declaration
public virtual string GetToolTip()
Returns
Type | Description |
---|---|
String | Returns the tooltip on the component if there is one otherwise it returns an empty string. |
HasDisplayProperties()
Does the component have properties to display.
Declaration
public virtual bool HasDisplayProperties()
Returns
Type | Description |
---|---|
Boolean | True if has properties to display |
Init(UnityEngine.Object, Editor)
Initializes the component editor. Called after creation.
Declaration
public virtual void Init(UnityEngine.Object targetObject, Editor inspector)
Parameters
Type | Name | Description |
---|---|---|
UnityEngine.Object | targetObject | The component being inspected. |
Editor | inspector | Parent Unity editor of the object that contains the component list. |
OnDisable()
This method is called when the scriptable object goes out of scope.
Declaration
public virtual void OnDisable()
OnEnable()
This method is called when the object is created. Called after Init.
Declaration
public virtual void OnEnable()
OnInspectorGUI()
This method is called to draw the inspector GUI
Declaration
public virtual void OnInspectorGUI()
OnInternalInspectorGUI()
Handles the extra logic for drawing the inspector inside a component list editor.
Declaration
public virtual void OnInternalInspectorGUI()
OnSceneGUI()
This method is called when drawing in the scene view.
Declaration
public virtual void OnSceneGUI()
Repaint()
Calls repaint on the parent editor.
Declaration
public virtual void Repaint()