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()); }
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()); }