From d90db508fc6f9c33eaa8bebb185b85e04a2a6b9c Mon Sep 17 00:00:00 2001 From: Makihiro <13536348+mackysoft@users.noreply.github.com> Date: Sun, 10 Apr 2022 12:45:16 +0900 Subject: [PATCH] Update README.md --- README.md | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/README.md b/README.md index 14a973d..be17320 100644 --- a/README.md +++ b/README.md @@ -129,3 +129,18 @@ The `SubclassSelector` attribute supports types that meet the following conditio - Not generic - Not unity object - Serializable attribute is applied. + + +## ❓ FAQ + +### If the type is renamed, the reference is lost. + +It is a limitation of `SerializeReference` of Unity. + +When serializing a `SerializeReference` reference, the type name, namespace, and assembly name are used, so if any of these are changed, the reference cannot be resolved during deserialization. + +To solve this problem, `UnityEngine.Scripting.APIUpdating.MovedFromAttribute` can be used. + +Also, [this thread](https://forum.unity.com/threads/serializereference-data-loss-when-class-name-is-changed.736874/) will be helpful. + +https://forum.unity.com/threads/serializereference-data-loss-when-class-name-is-changed.736874/