Stride

OPEN / CLOSE
  • Features
  • Blog
  • Documentation
  • Community
(icon) Download

  • Discord
  • Facebook
  • Twitter
  • YouTube

LANGUAGE

OPEN / CLOSE
  • English
  • 日本語
    Show / Hide Table of Contents

    AssetReference Class

    Namespace: Stride.Core.Assets
    Assembly: Stride.Core.Assets.dll

    An asset reference.

    System.Object → AssetReference
    Derived from AssetReference:

    [DataContract("aref")]
    [DataStyle(DataStyle.Compact)]
    [DataSerializer(typeof(AssetReferenceDataSerializer))]
    public sealed class AssetReference : IReference, IEquatable<AssetReference>
    Name Description
    Constructors
    AssetReference(AssetId, UFile)

    Initializes a new instance of the AssetReference class.

    Properties
    Id

    Gets or sets the unique identifier of the reference asset.

    Location

    Gets or sets the location of the asset.

    Methods
    Equals(AssetReference)
    Equals(Object)
    GetHashCode()
    New(AssetId, UFile)

    Tries to parse an asset reference in the format "GUID:Location".

    ToString()
    TryParse(String, out AssetId, out UFile)

    Tries to parse an asset reference in the format "[GUID/]GUID:Location". The first GUID is optional and is used to store the ID of the reference.

    TryParse(String, out AssetReference)

    Tries to parse an asset reference in the format "GUID:Location".

    Operators
    Equality(AssetReference, AssetReference)

    Implements the ==.

    Inequality(AssetReference, AssetReference)

    Implements the !=.

    | Improve this Doc View Source

    Constructors


    AssetReference(AssetId, UFile)

    Initializes a new instance of the AssetReference class.

    public AssetReference(AssetId id, UFile location)
    Parameters
    Type Name Description
    AssetId id

    The unique identifier of the asset.

    Stride.Core.IO.UFile location

    The location.

    | Improve this Doc View Source

    Properties


    Id

    Gets or sets the unique identifier of the reference asset.

    [DataMember(10)]
    public AssetId Id { get; }
    Property Value
    Type Description
    AssetId

    The unique identifier of the reference asset..


    Location

    Gets or sets the location of the asset.

    [DataMember(20)]
    public string Location { get; }
    Property Value
    Type Description
    System.String

    The location.

    | Improve this Doc View Source

    Methods


    Equals(AssetReference)

    public bool Equals(AssetReference other)
    Parameters
    Type Name Description
    AssetReference other
    Returns
    Type Description
    System.Boolean

    Equals(Object)

    public override bool Equals(object obj)
    Parameters
    Type Name Description
    System.Object obj
    Returns
    Type Description
    System.Boolean
    Overrides
    System.Object.Equals(System.Object)

    GetHashCode()

    public override int GetHashCode()
    Returns
    Type Description
    System.Int32
    Overrides
    System.Object.GetHashCode()

    New(AssetId, UFile)

    Tries to parse an asset reference in the format "GUID:Location".

    public static AssetReference New(AssetId id, UFile location)
    Parameters
    Type Name Description
    AssetId id

    The identifier.

    Stride.Core.IO.UFile location

    The location.

    Returns
    Type Description
    AssetReference

    true if parsing was successful, false otherwise.


    ToString()

    public override string ToString()
    Returns
    Type Description
    System.String
    Overrides
    System.Object.ToString()

    TryParse(String, out AssetId, out UFile)

    Tries to parse an asset reference in the format "[GUID/]GUID:Location". The first GUID is optional and is used to store the ID of the reference.

    public static bool TryParse(string assetReferenceText, out AssetId id, out UFile location)
    Parameters
    Type Name Description
    System.String assetReferenceText

    The asset reference.

    AssetId id

    The unique identifier of asset pointed by this reference.

    Stride.Core.IO.UFile location

    The location.

    Returns
    Type Description
    System.Boolean

    true if parsing was successful, false otherwise.

    Exceptions
    Type Condition
    System.ArgumentNullException

    assetReferenceText


    TryParse(String, out AssetReference)

    Tries to parse an asset reference in the format "GUID:Location".

    public static bool TryParse(string assetReferenceText, out AssetReference assetReference)
    Parameters
    Type Name Description
    System.String assetReferenceText

    The asset reference.

    AssetReference assetReference

    The reference.

    Returns
    Type Description
    System.Boolean

    true if parsing was successful, false otherwise.

    | Improve this Doc View Source

    Operators


    Equality(AssetReference, AssetReference)

    Implements the ==.

    public static bool operator ==(AssetReference left, AssetReference right)
    Parameters
    Type Name Description
    AssetReference left

    The left.

    AssetReference right

    The right.

    Returns
    Type Description
    System.Boolean

    The result of the operator.


    Inequality(AssetReference, AssetReference)

    Implements the !=.

    public static bool operator !=(AssetReference left, AssetReference right)
    Parameters
    Type Name Description
    AssetReference left

    The left.

    AssetReference right

    The right.

    Returns
    Type Description
    System.Boolean

    The result of the operator.


    Extension Methods

    ComponentBaseExtensions.DisposeBy<T>(T, ICollectorHolder)
    ComponentBaseExtensions.RemoveDisposeBy<T>(T, ICollectorHolder)
    AssetReferenceExtensions.HasLocation(AssetReference)
    • Improve this Doc
    • View Source
    In This Article

    Back to top

    Copyright © 2019-2021 .NET Foundation and Contributors
    Supported by the .NET Foundation