編輯

共用方式為


SerializedObjectUtils.CopySerializedObjectToStruct<T> Method

Definition

Iterates through a serialized object's fields and sets any accompanying fields in the supplied struct.

public static T CopySerializedObjectToStruct<T> (UnityEditor.SerializedObject source, T target, string propNamePrefixFilter = default, bool errorOnFieldNotFound = false) where T : struct;
static member CopySerializedObjectToStruct : UnityEditor.SerializedObject * 'T * string * bool -> 'T (requires 'T : struct)
Public Shared Function CopySerializedObjectToStruct(Of T As Structure) (source As SerializedObject, target As T, Optional propNamePrefixFilter As String = Nothing, Optional errorOnFieldNotFound As Boolean = false) As T

Type Parameters

T

Parameters

source
UnityEditor.SerializedObject
target
T
propNamePrefixFilter
String

Prefix to remove from serialized object field name before searching for match in struct

errorOnFieldNotFound
Boolean

Returns

T

Applies to