Class Artifact<T>
Syntax
[Serializable]
public abstract class Artifact<T> : Artifact, IEquatable<Artifact>
Type Parameters
Constructors
Artifact(String, UInt32)
Declaration
protected Artifact(string guid, uint seed)
Parameters
Properties
FileExtension
Declaration
public abstract string FileExtension { get; }
Property Value
IsCached
Declaration
public bool IsCached { get; }
Property Value
Methods
ConstructFromData(Byte[])
Declaration
public abstract T ConstructFromData(byte[] data)
Parameters
Type |
Name |
Description |
Byte[] |
data |
|
Returns
CreateFromData(Byte[], Boolean)
Takes binary data and will attempt to deserialize it into its concrete Unity representation. Concrete implementations will throw exceptions or handle malformed incoming data
Declaration
protected abstract T CreateFromData(byte[] data, bool updateCache)
Parameters
Type |
Name |
Description |
Byte[] |
data |
Binary data from backend, file, etc, to be deserialized
|
Boolean |
updateCache |
When true update the local system's cached state of the artifact. false skips the update
|
Returns
GetArtifact(Artifact<T>.ArtifactCreationDelegate, Boolean)
Will download the artifact, or load it from the cache on your current machine, if it exists.
Declaration
public virtual void GetArtifact(Artifact<T>.ArtifactCreationDelegate onReceived, bool useCache)
Parameters
Type |
Name |
Description |
Artifact.ArtifactCreationDelegate<> |
onReceived |
Callback for when the artifact was successfully loaded and created. T will be default on error, and the error message will be in the 2nd parameter detailing the reason
|
Boolean |
useCache |
When true will attempt to load the cached representation of this artifact from the local machine's , and if not found will download it from the client. false will always reach out to the client and update the cache
|
GetArtifactData()
Declaration
public ArtifactData GetArtifactData()
Returns
ReadFromCache(out Byte[])
Will return the deserialized Unity representation of the cached artifact from the local machine.
Declaration
protected abstract T ReadFromCache(out byte[] rawData)
Parameters
Type |
Name |
Description |
Byte[] |
rawData |
|
Returns
Type |
Description |
T |
A fully constructed artifact of type T, default(T) otherwise.
|
ReadFromCacheRaw()
Declaration
protected abstract byte[] ReadFromCacheRaw()
Returns
SetArtifactData(ArtifactData)
Declaration
public void SetArtifactData(ArtifactData data)
Parameters
WriteToCache(Byte[])
Writes the serialized Unity representation of this artifact to the
Declaration
protected abstract void WriteToCache(byte[] value)
Parameters
Type |
Name |
Description |
Byte[] |
value |
|
Extension Methods