![]() |
![]() |
|
![]() |
||||||||||
SerializedProperty and SerializedObject are classes for editing properties on objects in a completely generic way that automatically handles undo and styling UI for prefabs.
Note: This is an editor class. To use it you have to place your script in Assets/Editor inside your project folder. Editor classes are in the UnityEditor namespace so for C# scripts you need to add "using UnityEditor;" at the beginning of the script.
SerializedProperty is used in conjunction with SerializedObject and Editor classes.
| serializedObject |
SerializedObject this property belongs to (Read Only). |
| name |
Name of the property (Read Only) |
| type |
Type name of the property (Read Only) |
| tooltip |
Tooltip of the property (Read Only) |
| depth |
Nesting depth of the property (Read Only) |
| propertyPath |
Full path of the property (Read Only) |
| editable |
Is this property editable? (Read Only) |
| isExpanded |
Is this property expanded in the inspector? |
| hasChildren |
Does it have child properties? (Read Only) |
| hasVisibleChildren |
Does it have visible child properties? (Read Only) |
| isInstantiatedPrefab |
Is property part of a prefab instance? (Read Only) |
| prefabOverride |
Is property's value different from the prefab it belongs to? |
| propertyType |
Type of this property (Read Only). |
| intValue |
Value of an integer property. |
| boolValue |
Value of a boolean property. |
| floatValue |
Value of a float property. |
| stringValue |
Value of a string property. |
| colorValue |
Value of a color property. |
| animationCurveValue |
Value of a animation curve property. |
| objectReferenceValue |
Value of an object reference property. |
| enumValueIndex |
Enum index of an enum property. |
| enumNames |
Names of enumeration of an enum property. |
| vector2Value |
Value of a 2D vector property. |
| vector3Value |
Value of a 3D vector property. |
| rectValue |
Value of a rectangle property. |
| Next |
Move to next property. |
| NextVisible |
Move to next visible property. |
| Reset |
Move to first property of the object. |
| CountRemaining |
Count remaining visible properties. |
| Copy |
Duplicates the SerializedProperty. |
| DuplicateCommand |
|
| DeleteCommand |
|
| EqualContents |
See if contained serialized properties are equal. |