Struct SerializableGuid
A Guid
that can be serialized by Unity. The 128-bit Guid
is stored as two 64-bit ulong
s. See also the creation utility at
UnityEditor.XR.ARSubsystems.SerializableGuidUtil
.
Implements
Inherited Members
Namespace: UnityEngine.XR.ARSubsystems
Assembly: Unity.XR.ARSubsystems.dll
Syntax
[Serializable]
public struct SerializableGuid : IEquatable<SerializableGuid>
Constructors
SerializableGuid(Guid)
Constructs a SerializableGuid from a Guid.
Declaration
public SerializableGuid(Guid guid)
Parameters
Type | Name | Description |
---|---|---|
Guid | guid | The |
SerializableGuid(ulong, ulong)
Constructs a SerializableGuid from two 64-bit ulong
s.
Declaration
public SerializableGuid(ulong guidLow, ulong guidHigh)
Parameters
Type | Name | Description |
---|---|---|
ulong | guidLow | The low 8 bytes of the |
ulong | guidHigh | The high 8 bytes of the |
Properties
empty
Used to represent System.Guid.Empty
(that is, a GUID whose values are all zeros).
Declaration
public static SerializableGuid empty { get; }
Property Value
Type | Description |
---|---|
SerializableGuid |
guid
Reconstructs the Guid
from the serialized data.
Declaration
public Guid guid { get; }
Property Value
Type | Description |
---|---|
Guid |
Methods
Equals(object)
Tests for equality.
Declaration
public override bool Equals(object obj)
Parameters
Type | Name | Description |
---|---|---|
object | obj | The |
Returns
Type | Description |
---|---|
bool |
|
Overrides
Equals(SerializableGuid)
Tests for equality.
Declaration
public bool Equals(SerializableGuid other)
Parameters
Type | Name | Description |
---|---|---|
SerializableGuid | other | The other SerializableGuid to compare against. |
Returns
Type | Description |
---|---|
bool |
|
GetHashCode()
Generates a hash suitable for use with containers like HashSet
and Dictionary
.
Declaration
public override int GetHashCode()
Returns
Type | Description |
---|---|
int | A hash code generated from this object's fields. |
Overrides
ToString()
Generates a string representation of the Guid
. Same as guid.ToString()
.
See Microsoft's documentation
for more details.
Declaration
public override string ToString()
Returns
Type | Description |
---|---|
string | A string representation of the |
Overrides
ToString(string)
Generates a string representation of the Guid
. Same as guid.ToString(format)
.
Declaration
public string ToString(string format)
Parameters
Type | Name | Description |
---|---|---|
string | format | A single format specifier that indicates how to format the value of the |
Returns
Type | Description |
---|---|
string | A string representation of the |
ToString(string, IFormatProvider)
Generates a string representation of the Guid
. Same as guid.ToString(format, provider)
.
Declaration
public string ToString(string format, IFormatProvider provider)
Parameters
Type | Name | Description |
---|---|---|
string | format | A single format specifier that indicates how to format the value of the |
IFormatProvider | provider | An object that supplies culture-specific formatting information. |
Returns
Type | Description |
---|---|
string | A string representation of the |
Operators
operator ==(SerializableGuid, SerializableGuid)
Tests for equality. Same as Equals(SerializableGuid).
Declaration
public static bool operator ==(SerializableGuid lhs, SerializableGuid rhs)
Parameters
Type | Name | Description |
---|---|---|
SerializableGuid | lhs | The left-hand side of the comparison. |
SerializableGuid | rhs | The right-hand side of the comparison. |
Returns
Type | Description |
---|---|
bool |
|
implicit operator SerializableGuid(TrackableId)
Convert from TrackableId to SerializableGuid
using the SerializableGuid(ulong, ulong) constructor.
Declaration
public static implicit operator SerializableGuid(TrackableId trackableId)
Parameters
Type | Name | Description |
---|---|---|
TrackableId | trackableId | The TrackableId to convert. |
Returns
Type | Description |
---|---|
SerializableGuid | The SerializableGuid. |
operator !=(SerializableGuid, SerializableGuid)
Tests for inequality. Same as !
Equals(SerializableGuid).
Declaration
public static bool operator !=(SerializableGuid lhs, SerializableGuid rhs)
Parameters
Type | Name | Description |
---|---|---|
SerializableGuid | lhs | The left-hand side of the comparison. |
SerializableGuid | rhs | The right-hand side of the comparison. |
Returns
Type | Description |
---|---|
bool |
|