Unity/UnityEditor

[Unity/UnityEditor] Undo Redo MissingReference

sorry0101 2023. 7. 28. 14:31

너무 어려워!!!

EditorWindow에서 Undo Redo 시에 MissingReference가 날 수가 있는데 Undo 를 이것저것해봐도 적용되지 않았다.

그래서 찾아보니 SerializedObject를 사용하면 된다는데 생각만큼 로직에 적용하기 쉽지 않았는데
겨우겨우 해보니 Undo Redo가 아주 수월하게 된다 참조 에러에는 직렬화가 최고구나;;


참고

[1] https://forum.unity.com/threads/monobehaviour-references-are-lost-on-undo.587011/

[2]chatGPT

[3] https://kingmuffin.tistory.com/95

[4] https://m.blog.naver.com/PostView.nhn?blogId=hammerimpact&logNo=220775012493&targetKeyword=&targetRecommendationCode=1