Unity/UnityEditor

[Unity/UnityEditor] DestroyImmediate 에디터 모드 시 오브젝트 제거

sorry0101 2023. 5. 10. 14:44

에디터 모드에서는 DestroyImmediate를 사용해야 함


참고

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

 

Unity - Scripting API: Object.DestroyImmediate

This function should only be used when writing editor code since the delayed destruction will never be invoked in edit mode. In game code you should use Object.Destroy instead. Destroy is always delayed (but executed within the same frame). Use this functi

docs.unity3d.com