class
ManagedTypeUtility
Provides various utility methods for reflection-like operations on managed objects.
Public
Methods
staticGetTypeInfo
Retrieves information about the object's type.
Object must be a primitive type, scene object, component, resource, resource reference type, or a custom type marked with SerializeObject attribute in order for type information to be present. Type information can also be retrieved for arrays, lists or dictionaries of the above types.
staticGetSerializableObjectInfo
Retrieves detailed information about a serializable object.
Provided object's type must be marked with a SerializeObject attribute for this information to be available.
staticGetRTTITypeId
Deduces the RTTI ID of the native object that is wrapped by the provided object type.
Returns ~0u for types that do not wrap native types.
staticCreateSerializableObject
Creates a new instance of a serialized object of the provided type.
staticCreateArray
Creates a new instance of an array of the provided type and size.
Size array must have an element for each rank of the array type.
staticCreateList
Creates a new instance of a list of the provided type with the provided initial capacity.
staticCreateDictionary
Creates a new instance of a dictionary of the provided type.
staticCloneObject
Clones the specified object.
Non-serializable types and fields are ignored in clone. A deep copy is performed on all serializable elements except for resources or game objects.
- original
- Non-null reference to the object to clone. Object type must be serializable.
Returns: Deep copy of the original object
staticCreateObjectOfType
Creates an uninitialized object of the specified type.
- type
- Type of the object to create. Must be serializable
Returns: New instance of the specified type, or null if the type is not serializable.