Engine/Unity

[Unity] Object.GetInstanceID() 로 오브젝트 식별

VirtualDever 2022. 9. 15. 22:37

Unity 버전 : 2021.3.8f1 LTS

 

유니티에서는 고유 식별자를 가져올 수 있는 메서드를 제공한다.

The instance ID of an object is always unique.
The ID changes between player runtime and Editor sessions. 

https://docs.unity3d.com/ScriptReference/Object.GetInstanceID.html

 

Unity - Scripting API: Object.GetInstanceID

Returns int Returns the instance ID of the object. When used to call the origin object, this method returns a positive value. When used to call the instance object, this method returns a negative value. The instance ID of an object is always unique. The ID

docs.unity3d.com