Beispiel #1
0
    void OnDisable()
    {
        if (VideoPlayer.IsPlaying)
        {
            VideoPlayer.Stop();
        }

        VideoPlayer.Dispose();

        if (VideoRecorder.IsRecording)
        {
            VideoRecorder.Stop();
        }

        if (adapter != null)
        {
            adapter.Close();
            adapter = null;
        }

        depthFilter.Dispose();

        Destroy(imageViewTexture);
        imageViewMaterial.mainTexture = null;

        Destroy(depthViewTexture);
        depthViewMaterial.mainTexture = null;

        model.Dispose();
    }
Beispiel #2
0
    void OnDisable()
    {
        if (adapter != null)
        {
            adapter.Close();
            adapter = null;
        }

        depthFilter.Dispose();

        Destroy(imageViewTexture);
        imageViewMaterial.mainTexture = null;

        Destroy(depthViewTexture);
        depthViewMaterial.mainTexture = null;

        model.Dispose();
    }