+非ルートにあるオブジェクトにDontDestoryOnLoadを設置すると以下のような警告が出る。
DontDestroyOnLoad only work for root GameObjects or components on root GameObjects.
UnityEngine.Object:DontDestroyOnLoad()
ルートオブジェクトにDontDestroyOnloadをしておけば、その子オブジェクトも保持される。
+非ルートにあるオブジェクトにDontDestoryOnLoadを設置すると以下のような警告が出る。
DontDestroyOnLoad only work for root GameObjects or components on root GameObjects.
UnityEngine.Object:DontDestroyOnLoad()
ルートオブジェクトにDontDestroyOnloadをしておけば、その子オブジェクトも保持される。