mirror of
https://github.com/vrm-c/UniVRM.git
synced 2026-09-06 19:11:37 -05:00
EditorContext は所有しない
This commit is contained in:
@@ -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())
|
||||
|
||||
@@ -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;
|
||||
@@ -63,7 +63,7 @@ namespace VRM
|
||||
//
|
||||
context.Load();
|
||||
editor.SaveAsAsset(prefabPath);
|
||||
editor.Dispose();
|
||||
context.Dispose();
|
||||
};
|
||||
}
|
||||
}
|
||||
|
||||
@@ -70,7 +70,7 @@ namespace VRM
|
||||
//
|
||||
context.Load();
|
||||
editor.SaveAsAsset(prefabPath);
|
||||
editor.Dispose();
|
||||
context.Dispose();
|
||||
};
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user