using GLTF; using System; using System.Collections.Generic; using UnityEngine; #if HAVE_DRACO using Draco; #if !HAVE_DRACO_VERSION_5 using DecodeResult = Draco.DracoMeshLoader.DecodeResult; #endif #endif namespace UnityGLTF.Cache { public class MeshCacheData : IDisposable { public class PrimitiveCacheData { public bool meshAttributesCreated = false; public Dictionary Attributes = new Dictionary(4); public List> Targets = new List>(4); public Dictionary SparseAccessors = new Dictionary(4); } public List Primitives = new List(5); public Mesh LoadedMesh { get; set; } #if HAVE_DRACO public bool DracoMeshDataPrepared { get; set; } = false; public bool HasDracoMeshData { get; set; } = false; public Mesh.MeshDataArray DracoMeshData { get; set; } public DecodeResult[] DracoMeshDecodeResult { get; set; } #endif /// /// Unloads the meshes in this cache. /// public void Dispose() { if (LoadedMesh != null) { UnityEngine.Object.Destroy(LoadedMesh); LoadedMesh = null; } } } }