# SerializedProperty

> SerializedProperty and SerializedObject are classes for editing properties on objects in a completely generic way that automatically handles undo, multi-object editing and Prefab overrides.

## Definition

* **Type:** Class
* **Namespace:** [UnityEditor](/engine/6000.5/script-reference/unityeditor.md)
* **Assembly:** UnityEditor.CoreModule
* **Implements:** [IDisposable](https://learn.microsoft.com/dotnet/api/system.idisposable)

```csharp
public class SerializedProperty : IDisposable
```

## Remarks

SerializedProperty is primarily used to read or change the value of a property.  It can also navigate through the property hierarchy: use [SerializedProperty.Next](/engine/6000.5/script-reference/unityeditor/serializedproperty/next.md) to descend into child properties and [SerializedProperty.Parent](/engine/6000.5/script-reference/unityeditor/serializedproperty/parent.md) to navigate back to parent properties. Use this to explore nested structures, arrays, and complex objects and maintain the ability to traverse the hierarchy. Additional Resources: [SerializedObject](/engine/6000.5/script-reference/unityeditor/serializedobject.md) class, [Editor](/engine/6000.5/script-reference/unityeditor/editor.md) class.

## Examples

```csharp
using UnityEngine;
using UnityEditor;

public class MyObject : ScriptableObject
{
    public int myInt = 42;
}

public class SerializedPropertyTest : MonoBehaviour
{
    void Start()
    {
        MyObject obj = ScriptableObject.CreateInstance<MyObject>();
        SerializedObject serializedObject = new UnityEditor.SerializedObject(obj);

        SerializedProperty serializedPropertyMyInt = serializedObject.FindProperty("myInt");

        Debug.Log("myInt " + serializedPropertyMyInt.intValue);
    }
}
```

## Properties

| Property                                                                                                                         | Description                                                                                                                                      |
| -------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------ |
| [animationCurveValue](/engine/6000.5/script-reference/unityeditor/serializedproperty/animationcurvevalue.md)                     | Value of a animation curve property.                                                                                                             |
| [arrayElementType](/engine/6000.5/script-reference/unityeditor/serializedproperty/arrayelementtype.md)                           | Type name of the element in an array property. (Read Only)                                                                                       |
| [arraySize](/engine/6000.5/script-reference/unityeditor/serializedproperty/arraysize.md)                                         | The number of elements in the array.                                                                                                             |
| [boolValue](/engine/6000.5/script-reference/unityeditor/serializedproperty/boolvalue.md)                                         | Value of a boolean property.                                                                                                                     |
| [boundsIntValue](/engine/6000.5/script-reference/unityeditor/serializedproperty/boundsintvalue.md)                               | Value of bounds with integer values property.                                                                                                    |
| [boundsValue](/engine/6000.5/script-reference/unityeditor/serializedproperty/boundsvalue.md)                                     | Value of bounds property.                                                                                                                        |
| [boxedValue](/engine/6000.5/script-reference/unityeditor/serializedproperty/boxedvalue.md)                                       | Value of the SerializedProperty, boxed as a System.Object.                                                                                       |
| [colorValue](/engine/6000.5/script-reference/unityeditor/serializedproperty/colorvalue.md)                                       | Value of a color property.                                                                                                                       |
| [contentHash](/engine/6000.5/script-reference/unityeditor/serializedproperty/contenthash.md)                                     | Provides the hash value for the property. (Read Only)                                                                                            |
| [depth](/engine/6000.5/script-reference/unityeditor/serializedproperty/depth.md)                                                 | Nesting depth of the property. (Read Only)                                                                                                       |
| [displayName](/engine/6000.5/script-reference/unityeditor/serializedproperty/displayname.md)                                     | Nice display name of the property. (Read Only)                                                                                                   |
| [doubleValue](/engine/6000.5/script-reference/unityeditor/serializedproperty/doublevalue.md)                                     | Value of a float property as a double.                                                                                                           |
| [editable](/engine/6000.5/script-reference/unityeditor/serializedproperty/editable.md)                                           | Is this property editable? (Read Only)                                                                                                           |
| [entityIdValue](/engine/6000.5/script-reference/unityeditor/serializedproperty/entityidvalue.md)                                 | Value of an EntityId property.                                                                                                                   |
| [enumDisplayNames](/engine/6000.5/script-reference/unityeditor/serializedproperty/enumdisplaynames.md)                           | Display-friendly names of enumeration of an enum property.                                                                                       |
| [enumNames](/engine/6000.5/script-reference/unityeditor/serializedproperty/enumnames.md)                                         | Names of enumeration of an enum property.                                                                                                        |
| [enumValueFlag](/engine/6000.5/script-reference/unityeditor/serializedproperty/enumvalueflag.md)                                 | Int32 representation of an enum property with Mixed Values.                                                                                      |
| [enumValueIndex](/engine/6000.5/script-reference/unityeditor/serializedproperty/enumvalueindex.md)                               | Enum index of an enum property.                                                                                                                  |
| [exposedReferenceValue](/engine/6000.5/script-reference/unityeditor/serializedproperty/exposedreferencevalue.md)                 | A reference to another Object in the Scene. This reference is resolved in the context of the SerializedObject containing the SerializedProperty. |
| [fixedBufferSize](/engine/6000.5/script-reference/unityeditor/serializedproperty/fixedbuffersize.md)                             | The number of elements in the fixed buffer. (Read Only)                                                                                          |
| [floatValue](/engine/6000.5/script-reference/unityeditor/serializedproperty/floatvalue.md)                                       | Value of a float property.                                                                                                                       |
| [gradientValue](/engine/6000.5/script-reference/unityeditor/serializedproperty/gradientvalue.md)                                 | Value of a gradient property.                                                                                                                    |
| [guidValue](/engine/6000.5/script-reference/unityeditor/serializedproperty/guidvalue.md)                                         | The value of a GUID property.                                                                                                                    |
| [hasChildren](/engine/6000.5/script-reference/unityeditor/serializedproperty/haschildren.md)                                     | Does it have child properties? (Read Only)                                                                                                       |
| [hash128Value](/engine/6000.5/script-reference/unityeditor/serializedproperty/hash128value.md)                                   | The value of a Hash128 property.                                                                                                                 |
| [hasMultipleDifferentValues](/engine/6000.5/script-reference/unityeditor/serializedproperty/hasmultipledifferentvalues.md)       | Does this property represent multiple different values due to multi-object editing? (Read Only)                                                  |
| [hasVisibleChildren](/engine/6000.5/script-reference/unityeditor/serializedproperty/hasvisiblechildren.md)                       | Does it have visible child properties? (Read Only)                                                                                               |
| [intValue](/engine/6000.5/script-reference/unityeditor/serializedproperty/intvalue.md)                                           | Value of an integer property.                                                                                                                    |
| [isArray](/engine/6000.5/script-reference/unityeditor/serializedproperty/isarray.md)                                             | Is this property an array? (Read Only)                                                                                                           |
| [isDefaultOverride](/engine/6000.5/script-reference/unityeditor/serializedproperty/isdefaultoverride.md)                         | Allows you to check whether his property is a default override.                                                                                  |
| [isExpanded](/engine/6000.5/script-reference/unityeditor/serializedproperty/isexpanded.md)                                       | Is this property expanded in the inspector?                                                                                                      |
| [isFixedBuffer](/engine/6000.5/script-reference/unityeditor/serializedproperty/isfixedbuffer.md)                                 | Is this property a fixed buffer? (Read Only)                                                                                                     |
| [isInstantiatedPrefab](/engine/6000.5/script-reference/unityeditor/serializedproperty/isinstantiatedprefab.md)                   | Is property part of a Prefab instance? (Read Only)                                                                                               |
| [longValue](/engine/6000.5/script-reference/unityeditor/serializedproperty/longvalue.md)                                         | Value of an integer property as a long.                                                                                                          |
| [managedReferenceFieldTypename](/engine/6000.5/script-reference/unityeditor/serializedproperty/managedreferencefieldtypename.md) | String corresponding to the value of the managed reference field full type string.                                                               |
| [managedReferenceFullTypename](/engine/6000.5/script-reference/unityeditor/serializedproperty/managedreferencefulltypename.md)   | String corresponding to the value of the managed reference object (dynamic) full type string.                                                    |
| [managedReferenceId](/engine/6000.5/script-reference/unityeditor/serializedproperty/managedreferenceid.md)                       | Id associated with a managed reference.                                                                                                          |
| [managedReferenceValue](/engine/6000.5/script-reference/unityeditor/serializedproperty/managedreferencevalue.md)                 | The object assigned to a field with [SerializeReference](/engine/6000.5/script-reference/unityengine/serializereference.md) attribute.           |
| [minArraySize](/engine/6000.5/script-reference/unityeditor/serializedproperty/minarraysize.md)                                   | The smallest number of elements in the array across all target objects. (Read Only)                                                              |
| [name](/engine/6000.5/script-reference/unityeditor/serializedproperty/name.md)                                                   | Name of the property. (Read Only)                                                                                                                |
| [numericType](/engine/6000.5/script-reference/unityeditor/serializedproperty/numerictype.md)                                     | Return the precise type for Integer and Floating point properties. (Read Only)                                                                   |
| [objectReferenceValue](/engine/6000.5/script-reference/unityeditor/serializedproperty/objectreferencevalue.md)                   | Value of an object reference property.                                                                                                           |
| [prefabOverride](/engine/6000.5/script-reference/unityeditor/serializedproperty/prefaboverride.md)                               | Allows you to check whether a property's value is overriden (i.e. different to the Prefab it belongs to).                                        |
| [propertyPath](/engine/6000.5/script-reference/unityeditor/serializedproperty/propertypath.md)                                   | Full path of the property. (Read Only)                                                                                                           |
| [propertyType](/engine/6000.5/script-reference/unityeditor/serializedproperty/propertytype.md)                                   | Type of this property (Read Only).                                                                                                               |
| [quaternionValue](/engine/6000.5/script-reference/unityeditor/serializedproperty/quaternionvalue.md)                             | Value of a quaternion property.                                                                                                                  |
| [rectIntValue](/engine/6000.5/script-reference/unityeditor/serializedproperty/rectintvalue.md)                                   | Value of a rectangle with integer values property.                                                                                               |
| [rectValue](/engine/6000.5/script-reference/unityeditor/serializedproperty/rectvalue.md)                                         | Value of a rectangle property.                                                                                                                   |
| [serializedObject](/engine/6000.5/script-reference/unityeditor/serializedproperty/serializedobject.md)                           | [SerializedObject](/engine/6000.5/script-reference/unityeditor/serializedobject.md) this property belongs to (Read Only).                        |
| [stringValue](/engine/6000.5/script-reference/unityeditor/serializedproperty/stringvalue.md)                                     | Value of a string property.                                                                                                                      |
| [tooltip](/engine/6000.5/script-reference/unityeditor/serializedproperty/tooltip.md)                                             | Tooltip of the property. (Read Only)                                                                                                             |
| [type](/engine/6000.5/script-reference/unityeditor/serializedproperty/type.md)                                                   | Type name of the property. (Read Only)                                                                                                           |
| [uintValue](/engine/6000.5/script-reference/unityeditor/serializedproperty/uintvalue.md)                                         | Value of an integer property as an unsigned int.                                                                                                 |
| [ulongValue](/engine/6000.5/script-reference/unityeditor/serializedproperty/ulongvalue.md)                                       | Value of an integer property as an unsigned long.                                                                                                |
| [vector2IntValue](/engine/6000.5/script-reference/unityeditor/serializedproperty/vector2intvalue.md)                             | Value of a 2D integer vector property.                                                                                                           |
| [vector2Value](/engine/6000.5/script-reference/unityeditor/serializedproperty/vector2value.md)                                   | Value of a 2D vector property.                                                                                                                   |
| [vector3IntValue](/engine/6000.5/script-reference/unityeditor/serializedproperty/vector3intvalue.md)                             | Value of a 3D integer vector property.                                                                                                           |
| [vector3Value](/engine/6000.5/script-reference/unityeditor/serializedproperty/vector3value.md)                                   | Value of a 3D vector property.                                                                                                                   |
| [vector4Value](/engine/6000.5/script-reference/unityeditor/serializedproperty/vector4value.md)                                   | Value of a 4D vector property.                                                                                                                   |

## Methods

| Method                                                                                                                         | Description                                                                                                                                                              |
| ------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------ |
| [ClearArray](/engine/6000.5/script-reference/unityeditor/serializedproperty/cleararray.md)                                     | Remove all elements from the array.                                                                                                                                      |
| [Copy](/engine/6000.5/script-reference/unityeditor/serializedproperty/copy.md)                                                 | Returns a copy of the SerializedProperty iterator in its current state.                                                                                                  |
| [CountInProperty](/engine/6000.5/script-reference/unityeditor/serializedproperty/countinproperty.md)                           | Count visible children of this property, including this property itself.                                                                                                 |
| [CountRemaining](/engine/6000.5/script-reference/unityeditor/serializedproperty/countremaining.md)                             | Count remaining visible properties.                                                                                                                                      |
| [DeleteArrayElementAtIndex](/engine/6000.5/script-reference/unityeditor/serializedproperty/deletearrayelementatindex.md)       | Delete the element at the specified index in the array.                                                                                                                  |
| [DeleteCommand](/engine/6000.5/script-reference/unityeditor/serializedproperty/deletecommand.md)                               | Deletes the array element referenced by the SerializedProperty.                                                                                                          |
| [DuplicateCommand](/engine/6000.5/script-reference/unityeditor/serializedproperty/duplicatecommand.md)                         | Duplicates the array element referenced by the SerializedProperty.                                                                                                       |
| [FindPropertyRelative](/engine/6000.5/script-reference/unityeditor/serializedproperty/findpropertyrelative.md)                 | Retrieves the SerializedProperty at a relative path to the current property.                                                                                             |
| [GetArrayElementAtIndex](/engine/6000.5/script-reference/unityeditor/serializedproperty/getarrayelementatindex.md)             | Returns the element at the specified index in the array.                                                                                                                 |
| [GetEndProperty](/engine/6000.5/script-reference/unityeditor/serializedproperty/getendproperty.md)                             | Retrieves the SerializedProperty that defines the end range of this property.                                                                                            |
| [GetEnumerator](/engine/6000.5/script-reference/unityeditor/serializedproperty/getenumerator.md)                               | Retrieves an iterator for enumerating over the visible child properties of the current property.  If the property is an array it will enumerate over the array elements. |
| [GetFixedBufferElementAtIndex](/engine/6000.5/script-reference/unityeditor/serializedproperty/getfixedbufferelementatindex.md) | Returns the element at the specified index in the fixed buffer.                                                                                                          |
| [InsertArrayElementAtIndex](/engine/6000.5/script-reference/unityeditor/serializedproperty/insertarrayelementatindex.md)       | Insert an new element at the specified index in the array.                                                                                                               |
| [MoveArrayElement](/engine/6000.5/script-reference/unityeditor/serializedproperty/movearrayelement.md)                         | Move an array element from srcIndex to dstIndex.                                                                                                                         |
| [Next](/engine/6000.5/script-reference/unityeditor/serializedproperty/next.md)                                                 | Move to next property.                                                                                                                                                   |
| [NextVisible](/engine/6000.5/script-reference/unityeditor/serializedproperty/nextvisible.md)                                   | Move to next visible property.                                                                                                                                           |
| [Parent](/engine/6000.5/script-reference/unityeditor/serializedproperty/parent.md)                                             | Moves to the parent property.                                                                                                                                            |
| [Reset](/engine/6000.5/script-reference/unityeditor/serializedproperty/reset.md)                                               | Move to first property of the object.                                                                                                                                    |

## Static Methods

| Method                                                                                           | Description                                                                                      |
| ------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------ |
| [DataEquals](/engine/6000.5/script-reference/unityeditor/serializedproperty/dataequals.md)       | Compares the data for two SerializedProperties. This method ignores paths and SerializedObjects. |
| [EqualContents](/engine/6000.5/script-reference/unityeditor/serializedproperty/equalcontents.md) | See if contained serialized properties are equal.                                                |
