protected override void OnDestroy() { if (cameraSource != null) { cameraSource.Dispose(); cameraSource = null; } if (frameMatrix != null) { frameMatrix.Dispose(); } frameMatrix = null; Texture2D.Destroy(texture); texture = null; comicFilter.Dispose(); comicFilter = null; }
/// <summary> /// Releases all resource. /// </summary> private void Dispose() { NatCam.Release(); if (matrix != null) { matrix.Dispose(); matrix = null; } if (texture != null) { Texture2D.Destroy(texture); texture = null; } didUpdateThisFrame = false; if (comicFilter != null) { comicFilter.Dispose(); } }