docs.unity3d.com
    Show / Hide Table of Contents

    Class Artifact<T>

    Inheritance
    Object
    Artifact
    Artifact<T>
    Inherited Members
    Artifact.k_InvalidGUID
    Artifact.Guid
    Artifact.Seed
    Artifact.m_Operators
    Artifact.history
    Artifact.GetPreview(Artifact.ArtifactPreviewDelegate, Boolean)
    Artifact.StartGenerate(Model)
    Artifact.Generate(Model)
    Artifact.CreateView()
    Artifact.CreateCanvasView()
    Artifact.OnGenerationDone
    Artifact.GetOperators()
    Artifact.UnregisterFromEvents(Model)
    Artifact.RegisterToEvents(Model)
    Artifact.Equals(Artifact)
    Artifact.Equals(Object)
    Artifact.GetHashCode()
    Artifact.SetOperators(IEnumerable<IOperator>)
    Artifact.CloneOperators(IEnumerable<IOperator>)
    Artifact.Clone(String)
    Artifact.Variate(List<IOperator>)
    Object.ToString()
    Object.Equals(Object, Object)
    Object.ReferenceEquals(Object, Object)
    Object.GetType()
    Object.MemberwiseClone()
    Namespace: Unity.Muse.Common
    Syntax
    [Serializable]
    public abstract class Artifact<T> : Artifact, IEquatable<Artifact>
    Type Parameters
    Name Description
    T

    Constructors

    Artifact(String, UInt32)

    Declaration
    protected Artifact(string guid, uint seed)
    Parameters
    Type Name Description
    String guid
    UInt32 seed

    Properties

    FileExtension

    Declaration
    public abstract string FileExtension { get; }
    Property Value
    Type Description
    String

    IsCached

    Declaration
    public bool IsCached { get; }
    Property Value
    Type Description
    Boolean

    Methods

    ConstructFromData(Byte[])

    Declaration
    public abstract T ConstructFromData(byte[] data)
    Parameters
    Type Name Description
    Byte[] data
    Returns
    Type Description
    T

    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
    Type Description
    T

    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
    Type Description
    ArtifactData

    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
    Type Description
    Byte[]

    SetArtifactData(ArtifactData)

    Declaration
    public void SetArtifactData(ArtifactData data)
    Parameters
    Type Name Description
    ArtifactData data

    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

    ArtifactExtensions.IsValid(Artifact)
    ArtifactExtension.GetOperator<T>(Artifact)
    Back to top
    Copyright © 2023 Unity Technologies — Terms of use
    • Legal
    • Privacy Policy
    • Cookies
    • Do Not Sell or Share My Personal Information
    • Your Privacy Choices (Cookie Settings)
    "Unity", Unity logos, and other Unity trademarks are trademarks or registered trademarks of Unity Technologies or its affiliates in the U.S. and elsewhere (more info here). Other names or brands are trademarks of their respective owners.
    Generated by DocFX on 18 October 2023