Legacy Documentation: Version 4.6.2
Language: English
  • C#
  • JS
  • Boo

Script language

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

SerializedObject

Namespace: UnityEditor

Suggest a change

Success!

Thank you for helping us improve the quality of Unity Documentation. Although we cannot accept all submissions, we do read each suggested change from our users and will make updates where applicable.

Close

Sumbission failed

For some reason your suggested change could not be submitted. Please try again in a few minutes. And thank you for taking the time to help us improve the quality of Unity Documentation.

Close

Cancel

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

isEditingMultipleObjects Does the serialized object represents multiple objects due to multi-object editing? (Read Only)
targetObject The inspected object (Read Only).
targetObjects The inspected objects (Read Only).

Constructors

SerializedObject Create SerializedObject for inspected object.

Functions

ApplyModifiedProperties Apply property modifications.
CopyFromSerializedProperty Copies a value from a SerializedProperty to the same serialized property on this serialized object.
FindProperty Find serialized property by name.
GetIterator Get the first serialized property.
SetIsDifferentCacheDirty Update hasMultipleDifferentValues cache on the next /Update()/ call.
Update Update serialized object's representation.
UpdateIfDirtyOrScript Update serialized object's representation, only if the object has been modified since the last call to Update or if it is a script.