Documentation

Unity Engine


User Manual

Script Reference

Unity Engine


GetGlobalObjectIdSlow

Obtains the unique object identifiers based on an object reference.
Read time 1 minuteLast updated 4 days ago

Definition

  • Type: Method
  • Namespace: UnityEditor
  • Assembly: UnityEditor

GetGlobalObjectIdSlow(Object)

Obtains the unique object identifiers based on an object reference.
public static GlobalObjectId GetGlobalObjectIdSlow(Object targetObject)

Parameters

targetObject

The object to obtain the unique identifier for.

Returns

Type

Description

GlobalObjectIdThe
GlobalObjectId
for the object. If the conversion is unsuccessful, then the
GlobalObjectId
is set to the default null ID. The null ID has the string representation
GlobalObjectId_V1-0-00000000000000000000000000000000-0-0

Remarks

This method is slow. Use it sparingly. To get unique identifiers for multiple objects, it's recommended to use GlobalObjectId.GetGlobalObjectIdsSlow instead of making multiple calls to this method. If you use this method in a large project within other performance-sensitive contexts such as ISerializationCallbackReceiver.OnBeforeSerialize or ISerializationCallbackReceiver.OnAfterDeserialize, it's strongly recommended to profile the performance impact.

GetGlobalObjectIdSlow(int)

Obtains the unique object identifiers based on an instance ID.
public static GlobalObjectId GetGlobalObjectIdSlow(int instanceId)

Parameters

instanceId

The instance ID of the object to obtain the unique identifier for.

Returns

Type

Description

GlobalObjectIdThe
GlobalObjectId
for the object. If the conversion is unsuccessful, then the
GlobalObjectId
is set to the default null ID. The null ID has the string representation
GlobalObjectId_V1-0-00000000000000000000000000000000-0-0

Remarks

This method is slow. Use it sparingly. To get unique identifiers for multiple objects, it's recommended to use GlobalObjectId.GetGlobalObjectIdsSlow instead of making multiple calls to this method. If you use this method in a large project within other performance-sensitive contexts such as ISerializationCallbackReceiver.OnBeforeSerialize or ISerializationCallbackReceiver.OnAfterDeserialize, it's strongly recommended to profile the performance impact.