docs.unity3d.com
Search Results for

    Show / Hide Table of Contents

    Struct EnumOrRawValue<TEnum>

    Wrapper for glTF string properties that the specification has a limited set of valid values for. If the value is unknown (may have been introduced by a glTF extension), Value will have the default value and RawValue will hold the original UTF-8 encoded string value.

    Implements
    IEquatable<TEnum>
    IEquatable<EnumOrRawValue<TEnum>>
    Inherited Members
    object.Equals(object, object)
    object.GetType()
    object.ReferenceEquals(object, object)
    Namespace: Unity.Cloud.Gltfast.Objects
    Assembly: Unity.Cloud.Gltfast.dll
    Syntax
    public readonly struct EnumOrRawValue<TEnum> : IEquatable<TEnum>, IEquatable<EnumOrRawValue<TEnum>> where TEnum : struct, Enum
    Type Parameters
    Name Description
    TEnum

    Enum type the string is deserialized to.

    Constructors

    EnumOrRawValue(byte[])

    Construct from UTF-8 string value.

    Declaration
    public EnumOrRawValue(byte[] rawValue)
    Parameters
    Type Name Description
    byte[] rawValue

    UTF-8 string value

    EnumOrRawValue(TEnum)

    Construct from enum value.

    Declaration
    public EnumOrRawValue(TEnum value)
    Parameters
    Type Name Description
    TEnum value

    Enum value

    Properties

    RawValue

    UTF-8 encoded raw string value

    Declaration
    public byte[] RawValue { get; }
    Property Value
    Type Description
    byte[]

    Value

    Enum value

    Declaration
    public TEnum Value { get; }
    Property Value
    Type Description
    TEnum

    Methods

    Equals(object)

    Indicates whether the current instance is equal to the given object.

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

    Object to compare with this instance.

    Returns
    Type Description
    bool

    True if obj is an EnumOrRawValue<TEnum> equal to this instance; false otherwise.

    Overrides
    ValueType.Equals(object)

    Equals(EnumOrRawValue<TEnum>)

    Indicates whether the current instance is equal to another instance of the same type.

    Declaration
    public bool Equals(EnumOrRawValue<TEnum> other)
    Parameters
    Type Name Description
    EnumOrRawValue<TEnum> other

    An instance to compare with this instance.

    Returns
    Type Description
    bool

    True if both instances have equal Value and RawValue; false otherwise.

    Equals(TEnum)

    Indicates whether this instance represents the given enum value.

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

    Enum value to compare with this instance's Value.

    Returns
    Type Description
    bool

    True if RawValue is null and Value equals other; false otherwise.

    GetHashCode()

    Returns a hash code for this instance.

    Declaration
    public override int GetHashCode()
    Returns
    Type Description
    int

    Hash code derived from Value and RawValue.

    Overrides
    ValueType.GetHashCode()

    ToString()

    Returns a string representation of this instance.

    Declaration
    public override string ToString()
    Returns
    Type Description
    string

    The UTF-8 decoded RawValue when set; otherwise Value's string representation.

    Overrides
    ValueType.ToString()

    Operators

    operator ==(EnumOrRawValue<TEnum>, TEnum)

    Equality operator comparing an EnumOrRawValue<TEnum> to an enum value.

    Declaration
    public static bool operator ==(EnumOrRawValue<TEnum> lhs, TEnum rhs)
    Parameters
    Type Name Description
    EnumOrRawValue<TEnum> lhs

    Left-hand side instance.

    TEnum rhs

    Right-hand side enum value.

    Returns
    Type Description
    bool

    True if lhs represents rhs; false otherwise.

    implicit operator EnumOrRawValue<TEnum>(TEnum)

    Implicit conversion from an enum value, so call sites can assign a bare enum to a wrapped property.

    Declaration
    public static implicit operator EnumOrRawValue<TEnum>(TEnum value)
    Parameters
    Type Name Description
    TEnum value

    Enum value to wrap.

    Returns
    Type Description
    EnumOrRawValue<TEnum>

    EnumOrRawValue<TEnum> wrapper around enum value.

    operator !=(EnumOrRawValue<TEnum>, TEnum)

    Inequality operator comparing an EnumOrRawValue<TEnum> to an enum value.

    Declaration
    public static bool operator !=(EnumOrRawValue<TEnum> lhs, TEnum rhs)
    Parameters
    Type Name Description
    EnumOrRawValue<TEnum> lhs

    Left-hand side instance.

    TEnum rhs

    Right-hand side enum value.

    Returns
    Type Description
    bool

    True if lhs does not represent rhs; false otherwise.

    Implements

    IEquatable<T>
    IEquatable<T>
    In This Article
    Back to top
    Copyright © 2026 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)