docs.unity3d.com
Search Results for

    Show / Hide Table of Contents

    Struct CollectionPath

    Represents a path to an element.

    Implements
    IEquatable<CollectionPath>
    IEquatable<string>
    Inherited Members
    object.Equals(object, object)
    object.GetType()
    object.ReferenceEquals(object, object)
    Namespace: Unity.Cloud.Assets
    Assembly: Unity.Cloud.Assets.dll
    Syntax
    public readonly struct CollectionPath : IEquatable<CollectionPath>, IEquatable<string>

    Constructors

    CollectionPath(string)

    Initializes and returns an instance of CollectionPath

    Declaration
    public CollectionPath(string path)
    Parameters
    Type Name Description
    string path

    A path.

    Properties

    IsEmpty

    Returns whether the path is empty.

    Declaration
    public bool IsEmpty { get; }
    Property Value
    Type Description
    bool

    Length

    Returns the length of the path.

    Declaration
    public int Length { get; }
    Property Value
    Type Description
    int

    Methods

    BuildPath(params string[])

    Creates a string path in the format of a CollectionPath from the given inputs.

    Declaration
    public static string BuildPath(params string[] components)
    Parameters
    Type Name Description
    string[] components

    The individual elements of the path.

    Returns
    Type Description
    string

    A string path combining all inputs.

    CombinePaths(CollectionPath, CollectionPath)

    Creates a new path from the given paths.

    Declaration
    public static CollectionPath CombinePaths(CollectionPath startPath, CollectionPath relativePath)
    Parameters
    Type Name Description
    CollectionPath startPath

    The beginning of the new path.

    CollectionPath relativePath

    The end of the new path.

    Returns
    Type Description
    CollectionPath

    A new CollectionPath that is the combination of the inputs.

    Contains(string)

    Checks whether the path contains the given string.

    Declaration
    public bool Contains(string str)
    Parameters
    Type Name Description
    string str

    A string to verify.

    Returns
    Type Description
    bool

    True if the parameter string is contained within the path.

    EndsWith(string)

    Checks whether the path ends with the given string.

    Declaration
    public bool EndsWith(string str)
    Parameters
    Type Name Description
    string str

    A string to verify.

    Returns
    Type Description
    bool

    True if the parameter string matches the end of the path.

    Equals(object)

    Declaration
    public override bool Equals(object obj)
    Parameters
    Type Name Description
    object obj
    Returns
    Type Description
    bool
    Overrides
    ValueType.Equals(object)

    Equals(string)

    Declaration
    public bool Equals(string str)
    Parameters
    Type Name Description
    string str
    Returns
    Type Description
    bool

    Equals(CollectionPath)

    Declaration
    public bool Equals(CollectionPath other)
    Parameters
    Type Name Description
    CollectionPath other
    Returns
    Type Description
    bool

    GetHashCode()

    Declaration
    public override int GetHashCode()
    Returns
    Type Description
    int
    Overrides
    ValueType.GetHashCode()

    GetPathComponents()

    Returns the components of the path.

    Declaration
    public string[] GetPathComponents()
    Returns
    Type Description
    string[]

    An array of string representing every element in the path.

    StartsWith(string)

    Checks whether the path starts with the given string.

    Declaration
    public bool StartsWith(string str)
    Parameters
    Type Name Description
    string str

    A string to verify.

    Returns
    Type Description
    bool

    True if the parameter string matches the beginning of the path.

    ToString()

    Declaration
    public override string ToString()
    Returns
    Type Description
    string
    Overrides
    ValueType.ToString()

    Operators

    operator ==(CollectionPath, CollectionPath)

    Declaration
    public static bool operator ==(CollectionPath a, CollectionPath b)
    Parameters
    Type Name Description
    CollectionPath a
    CollectionPath b
    Returns
    Type Description
    bool

    implicit operator CollectionPath(string)

    Declaration
    public static implicit operator CollectionPath(string a)
    Parameters
    Type Name Description
    string a
    Returns
    Type Description
    CollectionPath

    implicit operator string(CollectionPath)

    Declaration
    public static implicit operator string(CollectionPath a)
    Parameters
    Type Name Description
    CollectionPath a
    Returns
    Type Description
    string

    operator !=(CollectionPath, CollectionPath)

    Declaration
    public static bool operator !=(CollectionPath a, CollectionPath b)
    Parameters
    Type Name Description
    CollectionPath a
    CollectionPath b
    Returns
    Type Description
    bool

    Implements

    IEquatable<T>
    IEquatable<T>

    Extension Methods

    CollectionPathUtilities.GetLastComponentOfPath(CollectionPath)
    CollectionPathUtilities.GetParentPath(CollectionPath, int)
    In This Article
    Back to top
    Copyright © 2025 Unity Technologies — Trademarks and terms of use
    • Legal
    • Privacy Policy
    • Cookie Policy
    • Do Not Sell or Share My Personal Information
    • Your Privacy Choices (Cookie Settings)