set Copy to child before destroying tmpParent

fix
This commit is contained in:
ichi23 2021-02-10 12:49:26 +09:00
parent dcf9608e86
commit 6d89d7c794

View File

@ -392,7 +392,10 @@ namespace UniGLTF
{
if (tmpParent != null)
{
tmpParent.transform.GetChild(0).SetParent(null);
var child = tmpParent.transform.GetChild(0);
child.SetParent(null);
Copy = child.gameObject;
if (Application.isPlaying)
{
GameObject.Destroy(tmpParent);