public static void DisposeAllModels() { foreach (var m in remoModelDict) { m.Value?.Dispose(); } remoModelDict?.Clear(); Scene.ClearScene(); TexturePool.Flush(); remoModelDict = new Dictionary <string, Model>(); }
public static void ClearScene() { lock (_lock_ModelLoad_Draw) { foreach (var mi in Models) { mi.Dispose(); } TexturePool.Flush(); Models?.Clear(); GC.Collect(); } }
public static void ClearSceneAndAddModel(Model m) { lock (_lock_ModelLoad_Draw) { foreach (var mi in Models) { if (mi == m) { continue; } mi.Dispose(); } TexturePool.Flush(); Models?.Clear(); GC.Collect(); Models.Add(m); } }