public static void Clear(this CombineInstance[] self) { for (var i = 0; i < self.Length; i++) { MeshPool.Return(self[i].mesh); self[i].mesh = null; } }
/// <summary> /// This function is called when the behaviour becomes disabled. /// </summary> protected override void OnDisable() { UIParticleUpdater.Unregister(this); if (!_shouldBeRemoved) particles.Exec(p => p.GetComponent<ParticleSystemRenderer>().enabled = true); _tracker.Clear(); // Destroy object. MeshPool.Return(_bakedMesh); _bakedMesh = null; base.OnDisable(); }
public void Clear() { for (var i = 0; i < combineInstances.Count; i++) { var inst = combineInstances[i]; MeshPool.Return(inst.mesh); inst.mesh = null; combineInstances[i] = inst; } combineInstances.Clear(); MeshPool.Return(mesh); mesh = null; count = 0; hash = -1; index = -1; }
public static void DiscardTemporaryMesh(Mesh mesh) { MeshPool.Return(mesh); }