void Cleanup() { if (Application.isPlaying) { GerstnerWavesJobs.Cleanup(); } RenderPipelineManager.beginCameraRendering -= BeginCameraRendering; if (_depthCam) { _depthCam.targetTexture = null; SafeDestroy(_depthCam.gameObject); } if (_depthTex) { SafeDestroy(_depthTex); } if (_waveBuffer != null) { _waveBuffer.Dispose(); } }
private void OnApplicationQuit() { GerstnerWavesJobs.Cleanup(); }