Legacy Documentation: Version 4.5.0

Script language:

  • JS
  • C#
  • Boo
Script language

Select your preferred scripting language. All code snippets will be displayed in this language.

SerializedObject

Namespace: UnityEditor

Description

SerializedObject and SerializedProperty are classes for editing properties on objects in a completely generic way that automatically handles undo and styling UI for prefabs.

SerializedObject is used in conjunction with SerializedProperty and Editor classes.

See Also: SerializedProperty class, Editor class.

Variables

isEditingMultipleObjectsDoes the serialized object represents multiple objects due to multi-object editing? (Read Only)
targetObjectThe inspected object (Read Only).
targetObjectsThe inspected objects (Read Only).

Constructors

SerializedObjectCreate SerializedObject for inspected object.

Functions

ApplyModifiedPropertiesApply property modifications.
CopyFromSerializedPropertyCopies a value from a SerializedProperty to the same serialized property on this serialized object.
FindPropertyFind serialized property by name.
GetIteratorGet the first serialized property.
SetIsDifferentCacheDirtyUpdate hasMultipleDifferentValues cache on the next /Update()/ call.
UpdateUpdate serialized object's representation.
UpdateIfDirtyOrScriptUpdate serialized object's representation, only if the object has been modified since the last call to Update or if it is a script.