docs.unity3d.com
Search Results for

    Show / Hide Table of Contents

    Struct MetricId

    Wrapper around an enum with the MetricTypeEnumAttribute. The struct provide a way to create metric that can be used with multiplayer tools.

    Implements
    IEquatable<MetricId>
    Inherited Members
    object.Equals(object, object)
    object.GetType()
    object.ReferenceEquals(object, object)
    Namespace: Unity.Multiplayer.Tools.NetStats
    Assembly: Unity.Multiplayer.Tools.NetStats.dll
    Syntax
    [Serializable]
    public struct MetricId : IEquatable<MetricId>

    Methods

    Create<T>(T)

    Static function to create a MetricId.

    Declaration
    public static MetricId Create<T>(T value) where T : unmanaged, Enum
    Parameters
    Type Name Description
    T value

    Enum value for the metric.

    Returns
    Type Description
    MetricId
    Type Parameters
    Name Description
    T

    An enum with the MetricTypeEnumAttribute

    Equals(object)

    Determines whether the specified object is equal to the current object.

    Declaration
    public override bool Equals(object obj)
    Parameters
    Type Name Description
    object obj

    The object to compare with the current object..

    Returns
    Type Description
    bool

    true if the specified object is equal to the current object; otherwise, false.

    Overrides
    ValueType.Equals(object)

    Equals(MetricId)

    Determines whether the specified MetricId is equal to the current MetricId.

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

    The MetricId to compare with the current MetricId.

    Returns
    Type Description
    bool

    true if the specified MetricId is equal to the current MetricId; otherwise, false.

    GetHashCode()

    Serves as the default hash function.

    Declaration
    public override int GetHashCode()
    Returns
    Type Description
    int

    A hash code for the current MetricId.

    Overrides
    ValueType.GetHashCode()

    ToString()

    Returns a string that represents the current MetricId.

    Declaration
    public override string ToString()
    Returns
    Type Description
    string

    A string that represents the current MetricId.

    Overrides
    ValueType.ToString()

    Operators

    implicit operator string(MetricId)

    Implicit operator to convert to string.

    Declaration
    public static implicit operator string(MetricId metricId)
    Parameters
    Type Name Description
    MetricId metricId

    The MetricId to convert to string.

    Returns
    Type Description
    string

    The name of the MetricId.

    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)