Dispose で Destory(this) する

This commit is contained in:
ousttrue
2021-06-10 20:22:00 +09:00
parent 612a59cba7
commit 81e02c8a76

View File

@@ -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);
}
}
}