Unity
[Unity] FormerlySerializedAs
소리쿤
2022. 2. 14. 19:29
https://docs.unity.cn/ScriptReference/Serialization.FormerlySerializedAsAttribute.html
ㅈㄱㄴ
에디터 상에서 Serialize 해놓은 값들을 안 날아가게 하기 위한 임시 방편이다.
인자로 넘긴 변수명으로 Unity, Prefab 등 파일 뒤져서
그 데이터를 새 변수에 대입하는 방식일 듯
요약하면 기존 변수에 [FormerlySerializedAs (새 변수)] 달아놓고,
저장한 다음에 인스펙터 창에서 저장댄 거 확인하고 [FormerlySerializedAs] 날리고
새 변수 선언하면 된다.