mirror of
https://github.com/vrm-c/UniVRM.git
synced 2026-05-14 06:19:47 -05:00
Merge pull request #1528 from ousttrue/fix/scripted_importer_dispose
dispose
This commit is contained in:
commit
b43acd7b5c
|
|
@ -26,6 +26,10 @@ namespace UniGLTF
|
|||
base.OnEnable();
|
||||
|
||||
m_importer = target as GlbScriptedImporter;
|
||||
if (m_data != null)
|
||||
{
|
||||
m_data.Dispose();
|
||||
}
|
||||
m_data = new GlbFileParser(m_importer.assetPath).Parse();
|
||||
|
||||
var materialGenerator = new GltfMaterialDescriptorGenerator();
|
||||
|
|
@ -35,6 +39,14 @@ namespace UniGLTF
|
|||
m_animationEditor = new RemapEditorAnimation(AnimationImporterUtil.EnumerateSubAssetKeys(m_data.GLTF), GetEditorMap, SetEditorMap);
|
||||
}
|
||||
|
||||
public override void OnDisable()
|
||||
{
|
||||
m_data.Dispose();
|
||||
m_data = null;
|
||||
|
||||
base.OnDisable();
|
||||
}
|
||||
|
||||
enum Tabs
|
||||
{
|
||||
Model,
|
||||
|
|
|
|||
|
|
@ -24,6 +24,10 @@ namespace UniGLTF
|
|||
base.OnEnable();
|
||||
|
||||
m_importer = target as GltfScriptedImporter;
|
||||
if (m_data != null)
|
||||
{
|
||||
m_data.Dispose();
|
||||
}
|
||||
m_data = new AutoGltfFileParser(m_importer.assetPath).Parse();
|
||||
|
||||
var materialGenerator = new GltfMaterialDescriptorGenerator();
|
||||
|
|
@ -33,6 +37,14 @@ namespace UniGLTF
|
|||
m_animationEditor = new RemapEditorAnimation(AnimationImporterUtil.EnumerateSubAssetKeys(m_data.GLTF), GetEditorMap, SetEditorMap);
|
||||
}
|
||||
|
||||
public override void OnDisable()
|
||||
{
|
||||
m_data.Dispose();
|
||||
m_data = null;
|
||||
|
||||
base.OnDisable();
|
||||
}
|
||||
|
||||
enum Tabs
|
||||
{
|
||||
Model,
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user