ModifySerializedField Struct

Summary

[Editor-Only] A wrapper for modifying a serialized field to allow it to be properly saved and undone.
Assembly
Animancer.dll
Namespace
Animancer.Editor
Interfaces
  • IDisposable
Base Types
  • ValueType
graph BT Type-->Base0["ValueType"] Type-.->Interface0["IDisposable"] Type["ModifySerializedField"] class Type type-node

Syntax

public readonly struct ModifySerializedField : ValueType, IDisposable

Remarks

Example:
using (new ModifySerializedField(target))// Undo gets captured.
{
    // Modify values on the target.
}// Target gets flagged for saving.

Constructors

Name Summary
ModifySerializedField(Object, string, bool) Captures the state of the target as an undo step.

Fields

Name Constant Value Summary
MightBePrefab
Prefab modifications are more complicated to track due to the possibility of nested prefabs.
Target
The object being modified.

Methods

Name Value Summary
Dispose() void
Flags the target as modified so that it will get saved by Unity.