Class JsonAssetReference<T>
Json asset reference utility. References resource with a typed data type.
Inheritance
Implements
Namespace: FlaxEngine
Assembly: FlaxEngine.CSharp.dll
Syntax
[CustomEditor]
public sealed class JsonAssetReference<T> : ValueType, IComparable, IComparable<JsonAssetReference<T>>, IEquatable<JsonAssetReference<T>>
Type Parameters
T
Type of the asset instance type. |
Constructors
JsonAssetReference(JsonAsset)
Initializes a new instance of the JsonAssetReference<T> structure.
Declaration
public JsonAssetReference(JsonAsset asset)
Parameters
JsonAsset
asset
The Json Asset. |
Fields
Asset
Properties
Instance
Gets the instance of the serialized object from the json asset data. Cached internally.
Declaration
public T Instance { get; }
Property Value
T
|
Methods
CompareTo(JsonAssetReference<T>)
Declaration
public int CompareTo(JsonAssetReference<T> other)
Parameters
JsonAssetReference<T>
other
|
Returns
System.Int32
|
CompareTo(Object)
Declaration
public int CompareTo(object obj)
Parameters
System.Object
obj
|
Returns
System.Int32
|
Equals(JsonAssetReference<T>)
Declaration
public bool Equals(JsonAssetReference<T> other)
Parameters
JsonAssetReference<T>
other
|
Returns
System.Boolean
|
Equals(Object)
Declaration
public override bool Equals(object obj)
Parameters
System.Object
obj
|
Returns
System.Boolean
|
GetHashCode()
Declaration
public override int GetHashCode()
Returns
System.Int32
|
GetInstance<U>()
Gets the deserialized native object instance of the given type. Returns null if asset is not loaded or loaded object has different type.
Declaration
public U GetInstance<U>()
Returns
U
The asset instance object or null. |
Type Parameters
U
|
ToString()
Declaration
public override string ToString()
Returns
System.String
|
Operators
Equality(JsonAssetReference<T>, JsonAssetReference<T>)
Checks whether the two objects are equal.
Declaration
public static bool operator ==(JsonAssetReference<T> left, JsonAssetReference<T> right)
Parameters
JsonAssetReference<T>
left
|
JsonAssetReference<T>
right
|
Returns
System.Boolean
|
Implicit(JsonAsset to JsonAssetReference<T>)
Implicit cast operator.
Declaration
public static implicit operator JsonAssetReference<T>(JsonAsset value)
Parameters
JsonAsset
value
|
Returns
JsonAssetReference<T>
|
Implicit(JsonAssetReference<T> to JsonAsset)
Implicit cast operator.
Declaration
public static implicit operator JsonAsset(JsonAssetReference<T> value)
Parameters
JsonAssetReference<T>
value
|
Returns
JsonAsset
|
Implicit(JsonAssetReference<T> to Boolean)
Checks if the object exists (reference is not null and the unmanaged object pointer is valid).
Declaration
public static implicit operator bool (JsonAssetReference<T> obj)
Parameters
JsonAssetReference<T>
obj
The object to check. |
Returns
System.Boolean
True if object is valid, otherwise false. |
Implicit(JsonAssetReference<T> to IntPtr)
Implicit cast operator.
Declaration
public static implicit operator IntPtr(JsonAssetReference<T> value)
Parameters
JsonAssetReference<T>
value
|
Returns
System.IntPtr
|
Implicit(IntPtr to JsonAssetReference<T>)
Implicit cast operator.
Declaration
public static implicit operator JsonAssetReference<T>(IntPtr valuePtr)
Parameters
System.IntPtr
valuePtr
|
Returns
JsonAssetReference<T>
|
Inequality(JsonAssetReference<T>, JsonAssetReference<T>)
Checks whether the two objects are not equal.
Declaration
public static bool operator !=(JsonAssetReference<T> left, JsonAssetReference<T> right)
Parameters
JsonAssetReference<T>
left
|
JsonAssetReference<T>
right
|
Returns
System.Boolean
|