イラスト、モデリング、Unity、VR関連

unityとかblenderとかvr関連の作業メモ

Unity DontDestroyOnloadはルートのオブジェクトのみに有効

+非ルートにあるオブジェクトにDontDestoryOnLoadを設置すると以下のような警告が出る。

DontDestroyOnLoad only work for root GameObjects or components on root GameObjects.
UnityEngine.Object:DontDestroyOnLoad()

 

ルートオブジェクトにDontDestroyOnloadをしておけば、その子オブジェクトも保持される。