Class EventInspectorUtils
Collection of editor tools for drawing and using EventInspectorData
Namespace: UnityEditor.MARS
Syntax
public static class EventInspectorUtils : object
Methods
GetEvents(Type, List<FieldInfo>)
Collect FieldInfo for fields marked with EventAttribute
Declaration
public static void GetEvents(Type type, List<FieldInfo> fields)
Parameters
Type | Name | Description |
---|---|---|
Type | type | The type from which fields will be collected |
List<FieldInfo> | fields | An empty list to which fields will be appended |
GetPersistentEventGreatestCount(UnityEventBase[])
Returns the largest persistent event count from events array.
Declaration
public static int GetPersistentEventGreatestCount(this UnityEventBase[] unityEvents)
Parameters
Type | Name | Description |
---|---|---|
UnityEventBase[] | unityEvents | UnityEvents we are getting the persistent count of. |
Returns
Type | Description |
---|---|
Int32 | Largest persistent event count from UnityEvents array. |
OnEventDrawerGUI(SerializedObject, Dictionary<FieldInfo, EventInspectorData>)
Draws the visible events area.
Declaration
public static void OnEventDrawerGUI(SerializedObject serializedObject, Dictionary<FieldInfo, EventInspectorData> eventInspectorData)
Parameters
Type | Name | Description |
---|---|---|
SerializedObject | serializedObject | Serialized Object from inspector. |
Dictionary<FieldInfo, EventInspectorData> | eventInspectorData | Collection of data needed to draw and manage custom event inspectors. |
SyncEventDrawers(SerializedObject, Dictionary<FieldInfo, EventInspectorData>)
Determines what events are displayed and when not displayed removes the listeners.
Declaration
public static void SyncEventDrawers(SerializedObject serializedObject, Dictionary<FieldInfo, EventInspectorData> eventInspectorData)
Parameters
Type | Name | Description |
---|---|---|
SerializedObject | serializedObject | Serialized Object from inspector. |
Dictionary<FieldInfo, EventInspectorData> | eventInspectorData | Collection of data needed to draw and manage custom event inspectors. |