10using System.Collections.Generic;
21 private List<Mesh> meshes =
new List<Mesh>();
23 [System.NonSerialized]
24 private Queue<Mesh> _tempMeshPool =
new Queue<Mesh>();
26 private void OnDestroy() {
27 foreach (var mesh
in meshes) {
33 foreach (var mesh
in meshes) {
35 mesh.Clear(keepVertexLayout:
false);
36 _tempMeshPool.Enqueue(mesh);
43 if (_tempMeshPool.Count > 0) {
44 return _tempMeshPool.Dequeue();
51 while (_tempMeshPool.Count > 0) {
52 UnityEngine.Object.DestroyImmediate(_tempMeshPool.Dequeue());
57 mesh.hideFlags = HideFlags.HideInHierarchy | HideFlags.HideInInspector;
62 Mesh mesh = meshes[index];
63 meshes.RemoveAt(index);
68 for (
int i = meshes.Count; i-- != 0;) {
69 Mesh mesh = meshes[i];
75 renderingMethod.PreventDuplication(ref mesh);
86 public Mesh
this[
int index] {
91 meshes[index] = value;
void RemoveMesh(int index)
Mesh GetMeshFromPoolOrNew()
void Validate(LeapRenderingMethod renderingMethod)