Remove RuntimeGltfInstance before saving a prefab.

This commit is contained in:
Masataka SUMI 2021-10-22 18:58:10 +09:00
parent 616f386a29
commit 6b43069eb9

View File

@ -141,6 +141,9 @@ namespace VRM
loaded.TransferOwnership(SaveAsAsset);
var root = loaded.Root;
// Remove RuntimeGltfInstance component before saving as a prefab.
UnityObjectDestoyer.DestroyRuntimeOrEditor(loaded);
// Create or update Main Asset
if (m_prefabPath.IsFileExists)
{
@ -155,7 +158,7 @@ namespace VRM
}
// destroy GameObject on scene
GameObject.DestroyImmediate(root);
UnityObjectDestoyer.DestroyRuntimeOrEditor(root);
foreach (var x in m_paths)
{