This class extracts upon creation, and then buffers, all the exposedProperties of a given object.
This buffer can then be easily accessed via the FindProperty function, and Drawn with the various ExposePropertyFunctions.
Or, one can choose to draw all the object's exposed-properties in this buffer at once, using the appropriate ExposeAllProperties function. In total, this class is little more than a convenient wrapper and buffer for the more generic MemberExposerFunctions class.
Public Member Functions | |
ExposedObjectMembers (object objectToExpose) | |
Constructor | |
ExposedObjectMembers (object objectToExpose, UnityEngine.Object conextOfExposedObject) | |
Constructor takes the params needed to instantiate a new ExposedObjectMembers. | |
void | ExposeAllProperties (Rect drawRect, GUIStyle guiStyle=null) |
Shortcut function to MemberExposerFunctions.ExposeAllProperties, passing the appropriate parameters from this exposedObject. | |
float | ExposeAllPropertiesHeight () |
Shortcut function to MemberExposerFunctions.ExposeAllPropertiesHeight that passes the appropriate data from this ExposedObject. | |
void | ExposeAllPropertiesLayout () |
Shortcut function to MemberExposerFunctions.ExposeAllPropertiesLayout, that passes all the appropriate parameters from this exposedObject. | |
bool | ExposeProperty (Rect drawRect, string name, GUIContent overrideLabel=null, GUIStyle guiStyle=null, bool useGroups=true) |
Rect based variant of the ExposeProperty function. Function used lookup the exposed-property with the specified name, and draw it in the specified Rect. Note this function is slightly less efficient than calling FindProperty, and recording/using the result yourself, since it also must perform a Dictionary lookup by the name-string. Still, useful during development. | |
float | ExposePropertyHeight (string name, bool useGroups=true) |
Gets the hight of the control. Function used lookup the exposed-property with the specified name, determine it's drawn height, and return that value. | |
bool | ExposePropertyLayout (string name, GUIContent overrideLabel=null, GUILayoutOption[] guiOptions=null, bool useGroups=true) |
Layout variant of the ExposeProperty function This function looks-up the exposed-property with the specified name, and draws it using standard EditorGUILayout. Note this function is slightly less efficient than calling FindProperty, and recording/using the result yourself, since it also must perform a Dictionary lookup by the name-string. Still, useful during development. | |
ExposedMember | FindProperty (string name) |
Function used to find the named ExposedMember buffered in this object. | |
object | GetPropertyValue (string propertyName) |
Finds the exposed property with the provided name, and returns it's value as a generic object reference | |
Public Attributes | |
object | exposedObject |
reference to the exposed object that contains the fields to be exposed. | |
Dictionary< string, List< ExposedMember > > | exposedPropertiesByGroup |
Stores multiple lists of all the ExposedMember in the exposedObject. Each list contains only ExposedMember that are in a particular "group". The dictionary stores each group name as the keys, and the lists as the value under each key. | |
Dictionary< string, ExposedMember > | groupEnableControlMembers |
Stores the exposed members (of boolean type) that control the display state of groups. The key contains the name of the group that is controlled, and the value reference the exposed member that controls it. | |
bool | recordUndoOnChanges |
Specifies if the exposed object should be recorded, for potential UNDO, every time a change is made to a field's value by the user. | |