void OnDestroy() { _particleBuffer.Release(); _deltaDensBuffer.Release(); _cellStartEndBuffer.Release(); _particleIdBuffer.Release(); }
private void OnDestroy() { _divergenceTexture.Release(); _velocityBuffer.Release(); _pressureBuffer.Release(); _previewBuffer.Release(); }
// DEINIT. private void DeInitSystem() { sTotalParticleCount -= mMaxParticleCount; mPositionBuffer.Release(); mVelocityBuffer.Release(); mLifetimeBuffer.Release(); mColorBuffer.Release(); mHaloBuffer.Release(); mScaleBuffer.Release(); mTransperancyBuffer.Release(); mColorLifetimePointsBuffer.Release(); mHaloLifetimePointsBuffer.Release(); mScaleLifetimePointsBuffer.Release(); mTransparencyLifetimePointsBuffer.Release(); mSphereColliderResultBuffer.Release(); }
// SHUTDOWN. static void Shutdown() { sMergedParticleCount = 0; sTotalParticleCount = 0; sGPUParticleSystemDictionary.Clear(); sGPUParticleSystemDictionary = null; sComputeShader = null; sKernelUpdate = -1; sKernelEmitt = -1; sKernelResult = -1; sKernelMergeInitSort = -1; sKernelSort = -1; foreach (KeyValuePair <Mesh, EmittMeshInfo> it in sEmittMeshInfoDictionary) { // Release compute buffers. it.Value.mVertexBuffer.Release(); it.Value.mIndexBuffer.Release(); } sEmittMeshInfoDictionary.Clear(); sGPUParticleAttractorBuffer.Release(); sGPUParticleVectorFieldBuffer.Release(); sGPUParticleSphereColliderBuffer.Release(); sGPUColliderResultSwapBuffer.Release(); sMergedPositionBuffer.Release(); sMergedVelocityBuffer.Release(); sMergedLifetimeBuffer.Release(); sMergedColorBuffer.Release(); sMergedHaloBuffer.Release(); sMergedScaleBuffer.Release(); sMergedTransperancyBuffer.Release(); sSortElementSwapBuffer.Release(); sRandomIndexBuffer.Release(); sRenderMaterial = null; }
/// <summary> /// Release memory block. /// </summary> public void Release() { mSwapBuffer.Release(); }