docs.unity3d.com
Search Results for

    Show / Hide Table of Contents

    Struct DescriptorId

    An unique identifier for an Issue Descriptor. IDs must have exactly 3 upper case characters, followed by 4 digits.

    Implements
    IEquatable<DescriptorId>
    Inherited Members
    ValueType.Equals(object)
    ValueType.GetHashCode()
    object.Equals(object, object)
    object.GetType()
    object.ReferenceEquals(object, object)
    Namespace: Unity.ProjectAuditor.Editor
    Assembly: Unity.ProjectAuditor.Editor.dll
    Syntax
    [Serializable]
    public struct DescriptorId : IEquatable<DescriptorId>
    Remarks

    ReportItems representing Issues (as opposed to Insights: purely informational ProjectIssues) all contain a DescriptorId. The DescriptorId is used to reference the information about a particular issue (for example, "PAC2002" is the code for "Object allocation"), and the ReportItem simply contains the file:line location in code where the allocation occurs and a "PAC2002" DescriptorId. The descriptor can generally be treated as a string, but for efficient descriptor lookups the string is converted to an int in the struct's constructor.

    Constructors

    DescriptorId(string)

    Constructor

    Declaration
    public DescriptorId(string id)
    Parameters
    Type Name Description
    string id

    String representing a valid and unique Descriptor ID. IDs must have exactly 3 upper case characters, followed by 4 digits.

    Methods

    AsInt()

    Get the hashed integer representation of the ID

    Declaration
    public int AsInt()
    Returns
    Type Description
    int

    The ID as an int

    AsString()

    Get the string representation of the ID

    Declaration
    public string AsString()
    Returns
    Type Description
    string

    The ID as a string

    Equals(string)

    Checks whether two DescriptorIDs contain the same ID.

    Declaration
    public bool Equals(string other)
    Parameters
    Type Name Description
    string other

    A string representing a descriptor ID to compare to.

    Returns
    Type Description
    bool

    True if the descriptors are the same, false if they are different.

    Equals(DescriptorId)

    Checks whether two DescriptorIDs contain the same ID.

    Declaration
    public bool Equals(DescriptorId other)
    Parameters
    Type Name Description
    DescriptorId other

    A DescriptorId to compare to.

    Returns
    Type Description
    bool

    True if the descriptors are the same, false if they are different.

    GetDescriptor()

    Get the Descriptor which corresponds to this ID.

    Declaration
    public Descriptor GetDescriptor()
    Returns
    Type Description
    Descriptor

    The Descriptor which corresponds to this ID. If the ID is invalid, throws an exception.

    IsValid()

    Checks whether the ID has been successfully constructed from a correctly-formatted string.

    Declaration
    public bool IsValid()
    Returns
    Type Description
    bool

    True if the ID is valid

    ToString()

    Returns the string representation of the ID

    Declaration
    public override string ToString()
    Returns
    Type Description
    string

    The DescriptorId in string form.

    Overrides
    ValueType.ToString()

    Operators

    implicit operator DescriptorId(string)

    Implicit conversion of string to DescriptorId.

    Declaration
    public static implicit operator DescriptorId(string id)
    Parameters
    Type Name Description
    string id

    A string to convert

    Returns
    Type Description
    DescriptorId

    A DescriptorId constructed using the string ID

    implicit operator int(DescriptorId)

    Implicit conversion of DescriptorId to int.

    Declaration
    public static implicit operator int(DescriptorId d)
    Parameters
    Type Name Description
    DescriptorId d

    A DescriptorId to convert

    Returns
    Type Description
    int

    The integer hash of the ID

    implicit operator string(DescriptorId)

    Implicit conversion of DescriptorId to string.

    Declaration
    public static implicit operator string(DescriptorId d)
    Parameters
    Type Name Description
    DescriptorId d

    A DescriptorId to convert

    Returns
    Type Description
    string

    A string representation of the ID

    Implements

    IEquatable<T>
    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)