mirror of
https://github.com/vrm-c/UniVRM.git
synced 2026-08-24 19:45:37 -05:00
MaterialFactory.Dispose
This commit is contained in:
@@ -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);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -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();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user