Esempio n. 1
0
    public bool Close()
    {
        shouldPlayWhenReady = false;

        if (meshRenderer)
        {
            meshRenderer.enabled = false;

            Texture2D tex = (Texture2D)meshRenderer.material.mainTexture;
            if (tex != null)
            {
#if UNITY_EDITOR // The Preview needs to hang on to the texture even after Close()
                if (GetComponent <HoloVideoPreview>() == null)
#endif
                {
                    Destroy(tex);
                    meshRenderer.material.mainTexture = null;
                    isPlaying = false;
                }
            }
        }

        if (pluginInterop == null)
        {
            return(false);
        }

        return(pluginInterop.CloseHCapObject());
    }
Esempio n. 2
0
    public bool Close()
    {
        isInitialized = false;

        if (meshRenderer)
        {
            meshRenderer.enabled = false;

            Texture2D tex = (Texture2D)meshRenderer.material.mainTexture;
            if (tex != null)
            {
#if UNITY_EDITOR // The Preview needs to hang on to the texture even after Close()
                if (GetComponent <HoloVideoPreview>() == null)
#endif
                Destroy(tex);
            }
        }

        if (pluginInterop == null)
        {
            return(false);
        }
        pluginInterop.CleanupCommandBuffers();
        return(pluginInterop.CloseHCapObject());
    }