Version: Unity 6.1 Alpha (6000.1)
LanguageEnglish
  • C#

GlobalObjectId.GetGlobalObjectIdSlow

Suggest a change

Success!

Thank you for helping us improve the quality of Unity Documentation. Although we cannot accept all submissions, we do read each suggested change from our users and will make updates where applicable.

Close

Submission failed

For some reason your suggested change could not be submitted. Please <a>try again</a> in a few minutes. And thank you for taking the time to help us improve the quality of Unity Documentation.

Close

Cancel

Declaration

public static GlobalObjectId GetGlobalObjectIdSlow(Object targetObject);

Parameters

targetObject The object to obtain the unique identifier for.

Returns

GlobalObjectId The 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

Description

Obtains the unique object identifiers based on an object reference.

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.

Additional resources: GlobalObjectId.GetGlobalObjectIdsSlow, Object.GetInstanceID


Declaration

public static GlobalObjectId GetGlobalObjectIdSlow(int instanceId);

Parameters

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

Returns

GlobalObjectId The 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

Description

Obtains the unique object identifiers based on an instance ID.

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.

Additional resources: GlobalObjectId.GetGlobalObjectIdsSlow, Object.GetInstanceID