Перейти к основному содержимому

Class SerializableType<T>

Namespace: Aspid.FastTools.Types
Assembly: Aspid.FastTools.dll

SerializableType constrained to types assignable to T.

[Serializable]
public sealed class SerializableType<T> : SerializableType, ISerializableType, IEquatable<SerializableTypeBase>, ISerializationCallbackReceiver

Type Parameters​

T

The base type that the picker and the constructor require.

Inheritance​

object ← SerializableTypeBase ← SerializableType ← SerializableType<T>

Implements​

ISerializableType, IEquatable<SerializableTypeBase>, ISerializationCallbackReceiver

Extension Methods​

ProfilerMarkerExtensionsForGenerator.Marker<SerializableType<T>>(SerializableType<T>, int)

Examples​

[SerializeField] private SerializableType<MonoBehaviour> _behaviorType;

Remarks​

Assigned to a field declared as SerializableType, it is reloaded without the constraint.

Constructors​

SerializableType(Type?)​

Creates a wrapper holding type.

public SerializableType(Type? type)

Parameters​

type Type?

The type to store, or null for an empty wrapper.

Exceptions​

ArgumentException

type is not assignable to T.

Properties​

BaseType​

Gets the base type that types offered by the picker are assignable to; Object when unconstrained.

public override Type BaseType { get; }

Property Value​

Type

Remarks​

A loaded type is not checked against it: a name stored before the constraint changed resolves as is.