public void Release() { OnStart = OnFrame = null; core.Call("release"); if (preview != null) { MonoBehaviour.Destroy(preview); } preview = null; if (dispatch != null) { dispatch.Release(); } dispatch = null; }
private void SetDetection(bool state) { if (state) { OnFrame -= MetadataUpdate; OnFrame += MetadataUpdate; metadataDispatch = metadataDispatch ?? new ConcurrentDispatch(); } else { OnFrame -= MetadataUpdate; OnMetadata = null; if (metadataDispatch != null) { metadataDispatch.Release(); } metadataDispatch = null; } }
public void Release() { if (!preview) { return; } OnStart = OnFrame = null; #if NATCAM_PRO || NATCAM_PROFESSIONAL ReleaseBuffer(); #endif preview.Stop(); MonoBehaviour.Destroy(preview); preview = null; photoBuffer = null; dispatch.Release(); dispatch = null; camera = -1; }
public void Release() { if (!preview) { return; } OnStart = OnFrame = null; #if NATCAM_EXTENDED SetDetection(false); OnMetadata = null; #endif #if NATCAM_PROFESSIONAL ReleasePreviewBuffer(); #endif preview.Stop(); MonoBehaviour.Destroy(preview); preview = null; dispatch.Release(); dispatch = null; camera = -1; }