17 ? type.FullName +
", " + type.Assembly.GetName().Name
32 Type = !
string.IsNullOrEmpty(assemblyQualifiedClassName)
33 ?
Type.GetType(assemblyQualifiedClassName)
49 private string _classRef;
51 #region ISerializationCallbackReceiver Members
53 void ISerializationCallbackReceiver.OnAfterDeserialize() {
54 if (!
string.IsNullOrEmpty(_classRef)) {
55 _type = System.Type.GetType(_classRef);
58 Debug.LogWarning(
string.Format(
"'{0}' was referenced but class type was not found.", _classRef));
65 void ISerializationCallbackReceiver.OnBeforeSerialize() {
81 if (value !=
null && !value.IsClass)
82 throw new ArgumentException(
string.Format(
"'{0}' is not a class type.", value.FullName),
"value");
90 return typeReference._classRef;
94 return typeReference.
Type;
102 return Type !=
null ?
Type.FullName :
"(None)";
Reference to a class System.Type with support for Unity serialization.
ClassTypeReference(string assemblyQualifiedClassName)
Initializes a new instance of the ClassTypeReference class.
ClassTypeReference(Type type)
Initializes a new instance of the ClassTypeReference class.
ClassTypeReference()
Initializes a new instance of the ClassTypeReference class.
override string ToString()
Type Type
Gets or sets type of class reference.
static string GetClassRef(Type type)