MaterialFactory.Dispose

This commit is contained in:
ousttrue 2021-02-10 21:24:10 +09:00
parent 95a5dd50cb
commit 2edee1e7b5
2 changed files with 15 additions and 4 deletions

View File

@ -939,9 +939,14 @@ namespace UniGLTF
if (Root != null) GameObject.Destroy(Root);
// Remove resources. materials, textures meshes etc...
foreach (var o in ObjectsForSubAsset())
MaterialFactory.Dispose();
foreach (var x in Meshes)
{
UnityEngine.Object.DestroyImmediate(o, true);
UnityEngine.Object.DestroyImmediate(x.Mesh, true);
}
foreach (var x in AnimationClips)
{
UnityEngine.Object.DestroyImmediate(x, true);
}
}

View File

@ -1,4 +1,5 @@
using System.Collections;
using System;
using System.Collections;
using System.Collections.Generic;
using System.IO;
using System.Linq;
@ -11,7 +12,7 @@ namespace UniGLTF
public delegate MaterialItemBase MaterialImporter(int i, glTFMaterial x, bool hasVertexColor);
public class MaterialFactory
public class MaterialFactory : IDisposable
{
MaterialImporter m_materialImporter;
public MaterialImporter MaterialImporter
@ -189,5 +190,10 @@ namespace UniGLTF
return new PBRMaterialItem(i, x);
}
public void Dispose()
{
throw new NotImplementedException();
}
}
}