From 81e02c8a76bfe42a7e379d5f55e690c437eb135c Mon Sep 17 00:00:00 2001 From: ousttrue Date: Thu, 10 Jun 2021 20:22:00 +0900 Subject: [PATCH] =?UTF-8?q?Dispose=20=E3=81=A7=20Destory(this)=20=E3=81=99?= =?UTF-8?q?=E3=82=8B?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Assets/UniGLTF/Runtime/UniGLTF/UnityObjectManager.cs | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/Assets/UniGLTF/Runtime/UniGLTF/UnityObjectManager.cs b/Assets/UniGLTF/Runtime/UniGLTF/UnityObjectManager.cs index beeb548cc..aa58fe242 100644 --- a/Assets/UniGLTF/Runtime/UniGLTF/UnityObjectManager.cs +++ b/Assets/UniGLTF/Runtime/UniGLTF/UnityObjectManager.cs @@ -41,7 +41,10 @@ namespace UniGLTF void OnDestroy() { Debug.Log("UnityResourceDestroyer.OnDestroy"); - Dispose(); + foreach (var (key, x) in m_resources) + { + UnityObjectDestoyer.DestroyRuntimeOrEditor(x); + } } public void TransferOwnership(TakeResponsibilityForDestroyObjectFunc take) @@ -55,10 +58,7 @@ namespace UniGLTF public void Dispose() { - foreach (var (key, x) in m_resources) - { - UnityObjectDestoyer.DestroyRuntimeOrEditor(x); - } + UnityObjectDestoyer.DestroyRuntimeOrEditor(this); } } }