Class SerializableType
Namespace: Aspid.FastTools.Types
Assembly: Aspid.FastTools.dll
Unity-serializable wrapper around a Type, stored by its assembly-qualified name.
[Serializable]
public class SerializableType : SerializableTypeBase, ISerializableType, IEquatable<SerializableTypeBase>, ISerializationCallbackReceiver
Inheritance
object ← SerializableTypeBase ← SerializableType
Derived
Implements
ISerializableType, IEquatable<SerializableTypeBase>, ISerializationCallbackReceiver
Extension Methods
ProfilerMarkerExtensionsForGenerator.Marker<SerializableType>(SerializableType, int)
Examples
[SerializeField] private SerializableType _targetType;
Type type = _targetType; // implicit conversion
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.
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
Remarks
A loaded type is not checked against it: a name stored before the constraint changed resolves as is.
Operators
implicit operator Type?(SerializableType?)
Converts the wrapper to the type it holds.
public static implicit operator Type?(SerializableType? type)
Parameters
type SerializableType?
The wrapper to convert.
Returns
Type?
The wrapped type, or null when the wrapper is null or holds no resolvable type.