Unity - Scripting API: GlobalObjectId
struct in UnityEditor
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.
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.
Description
Struct providing an API for stable, project-global object identifiers.
Provides a project-global object ID for lookup.
The ID is persistent and unique for a given Unity Object.
The format of the string representation of the ID is "GlobalObjectId_V1-{i}-{a}-{l}-{p}" where:
{i} is the identifier type represented by an integer (0 = Null, 1 = Imported Asset, 2 = Scene Object, 3 = Source Asset).
{a} is the asset GUID.
{l} is the local file ID of the object.
{p} is the prefab instance ID of the object.
The default null ID is "GlobalObjectId_V1-0-00000000000000000000000000000000-0-0".
Caveats:
- The ID changes when the object is moved to a new scene because the scene ID is part of the GlobalObjectID.