SerializedProperty
public abstract class SerializedProperty Constructors
SerializedProperty() Properties
| Name | Type | Description |
|---|---|---|
Parent virtual | SerializedObject | |
IsProperty virtual | Boolean | |
IsField virtual | Boolean | |
IsMethod virtual | Boolean | |
Name virtual | String | |
DisplayName virtual | String | |
Description virtual | String | |
GroupName virtual | String | |
Order virtual | Int32 | |
IsEditable virtual | Boolean | |
IsPublic virtual | Boolean | |
PropertyType virtual | Type | |
IsValid virtual | Boolean | |
SourceFile virtual | String | The source filename, if available |
SourceLine virtual | Int32 | The line in the source file, if available |
HasChanges virtual | Boolean | Returns true if the current set value differs from the actual value |
OnPreChange | PropertyPreChangeDelegate | Called when the property value is about to change. |
OnChanged | PropertyChangedDelegate | Called when the property value has changed. |
OnStartEdit | PropertyStartEditDelegate | Called when the property is about to be edited (eg. in a ControlWidget). |
OnFinishEdit | PropertyFinishEditDelegate | Called when the property has finished being edited (eg. in a ControlWidget). |
As virtual | AsAccessor | |
IsMultipleValues virtual | Boolean | True if this holds multiple values. That might all be the same. |
IsMultipleDifferentValues virtual | Boolean | True if this holds multiple values, and they're all different. |
MultipleProperties virtual | IEnumerable<SerializedProperty> | Get all properties if this holds multiple values |
IsNullable | Boolean | Return true if this is a nullable value type |
NullableType | Type | If this is a nullable type, this will return the nullable target type |
IsNull | Boolean | True if the value is null |
Methods
virtual Void SetValue(T value) virtual Void SetValue(T value, SerializedProperty source) virtual T GetValue(T defaultValue = null) virtual Object GetDefault() Get the default value of a specific property type.
Boolean HasAttribute() Return true if the property has this attribute
Boolean HasAttribute(Type t) Return true if the property has this attribute
Boolean TryGetAttribute(T attribute) Try to get this attribute from the property. Return false on fail.
IEnumerable<T> GetAttributes() Get all of these attributes from the property.
IEnumerable<Attribute> GetAttributes(Type t) Get all of these attributes from the property.
virtual IEnumerable<Attribute> GetAttributes() Get all attributes from the property.
virtual Boolean TryGetAsObject(SerializedObject obj) Try to convert this property into a serialized object for further editing and exploration
obj virtual SerializedProperty GetKey() If this entry is a dictionary, we can get the key for it here
Boolean ShouldShow() Returns true if this property should be shown in the inspector
Void SetNullState(Boolean isnull) If this is a nullable type, you can use this to toggle between it being null or the default value type
virtual Void Invoke() If is method
static SerializedProperty Create(String title, Func<T> get, Action<T> set, Attribute[] attributes = null) CustomizableSerializedProperty GetCustomizable() Return a version of this property that can be customized for editor UI. You'll be able to change things like display name and tooltip, and add extra attributes that control how editor controls interact with it.