Easy Save와 Assembly Definition의 주의점

소개



Unity에는 Assembly Definition이라는 C# 빌드 파일을 분할하여 출력할 수 있는 기능이 있습니다.
자세한 내용은 "Unity Assembly Definition 완전히 이해됨"을 참조하십시오.

Easy Save은 Unity에서 쉽게 저장로드 암호화를 구현할 수 있는 자산입니다.

그런데, 현재 Assembly Definition을 잘라내고 있는 자신의 Unity Project에서 Easy Save를 활용하고 있던 곳, 몇가지 빠져 포인트를 발견했으므로 공유합니다.

일반적인 오류는 Kan 님의 블로그를 참조하십시오.
Easy Save를 사용하고 있는 동안에 조우할지도 모른다, 몇개의 에러와 그 대처법【Unity】【애셋】【Easy Save】【트러블 슈팅】

Easy Save에 Assembly Definition 추가



Easy Save는 표준에서 Assembly Definition을 추가하지 않으므로 Assembly Definition을 자르는 어셈블리 내에서 Easy Save의 기능을 추가하려면 Assembly Definition을 직접 추가해야 합니다.

그러면 Assets/Plugins/EasySave3/Scripts 안에 ES3라는 이름으로 Assembly Definition 파일을 만듭니다. Assets/Plugins/EasySave3/Editor 안에 ES3.Editor라는 이름으로 Assembly Definition 파일을 만들고 Assembly Definition References에 ES3.asmdef를 추가합시다.


그러나이 상태에서는 어떤 유형의 값을 저장하려고해도ES3Type for primitive could not be found, but the type list has been initialised and is not empty. Please contact Easy Save developers on [email protected]
라는 오류가 나옵니다.
이 오류를 해결하려면 Assets/Plugins/EasySave3/Resources/ES3/ES3Defaults.asset를 선택하고 Assembly Names에 이번에 추가한 Assembly Definition 파일의 이름(이번에는 ES3)을 추가해야 합니다.


저장된 형식의 namespace 또는 Assembly Definition 파일을 이름 바꾸기



Easy Save는 값을 저장할 때 문자열 키뿐만 아니라 네임 스페이스와 어셈블리 이름도 사용합니다.
따라서 이미 저장되어 있는 클래스나 구조체의 namespace나 어셈블리명(Assembly Definition 파일명)을 바꾼 경우, key는 일치하지만 namespace나 Assembly Definition 파일이 다르기 때문에System.InvalidOperationException: Trying to load data of type 保存対象の型, but data contained in file is type of 라는 오류가 발생하여 로드를 처리할 수 없습니다.

이 경우 es3 파일을 직접 다시 작성하거나 다시 작성해야 합니다.

좋은 웹페이지 즐겨찾기