EditorContext は所有しない

This commit is contained in:
ousttrue
2021-03-08 12:59:25 +09:00
parent 35df40491a
commit 2ff647ec57
5 changed files with 4 additions and 19 deletions

View File

@@ -1,4 +1,3 @@
using System;
using System.Collections.Generic;
using System.IO;
using System.Linq;
@@ -10,11 +9,8 @@ namespace UniGLTF
{
/// <summary>
/// Editor で Asset 化する場合専用
///
/// GameObject を prefab 化するので、prefab の元になった GameObject は破棄対象となる。
///
/// </summary>
public class EditorImporterContext : IDisposable
public class EditorImporterContext
{
ImporterContext m_context;
@@ -23,17 +19,6 @@ namespace UniGLTF
m_context = context;
}
public void Dispose()
{
m_context.Dispose();
if (m_context.Root != null)
{
// Destroy the GameObject that became the basis of Prefab
GameObject.DestroyImmediate(m_context.Root);
}
}
public virtual IEnumerable<UnityEngine.Object> ObjectsForSubAsset()
{
foreach (var x in m_context.TextureFactory.ObjectsForSubAsset())

View File

@@ -8,7 +8,7 @@ using UnityEngine;
namespace UniGLTF
{
[CustomEditor(typeof(GlbScriptedImporter))]
public class GltfScriptedImporterEditorGUI : ScriptedImporterEditor
public class GlbScriptedImporterEditorGUI : ScriptedImporterEditor
{
GlbScriptedImporter m_importer;
GltfParser m_parser;

View File

@@ -63,7 +63,7 @@ namespace VRM
//
context.Load();
editor.SaveAsAsset(prefabPath);
editor.Dispose();
context.Dispose();
};
}
}

View File

@@ -70,7 +70,7 @@ namespace VRM
//
context.Load();
editor.SaveAsAsset(prefabPath);
editor.Dispose();
context.Dispose();
};
}
}