private void destroyEverything() { // Unregister delegates properly GetTextureByOnRenderImage getTextureComponent = gameObject.GetComponent <GetTextureByOnRenderImage>(); if (getTextureComponent != null) { getTextureComponent.UnregisterDelegates(); } if (!EditorApplication.isPlayingOrWillChangePlaymode) { MonoBehaviourManager.DestroyManagedComponent <GetTextureByOnRenderImage>(gameObject, null); } NativePluginBridge.SYPHON.ShutdownGLCoreServer(); serverCreated = false; // Release the camera. var componentCamera = GetComponent <Camera>(); componentCamera.targetTexture = null; componentCamera.ResetAspect(); // Release temporary assets. if (_gammaMaterial) { DestroyImmediate(_gammaMaterial); } _gammaMaterial = null; }
private void destroyEverything() { // Unregister delegates properly GetTextureByOnRenderImage getTextureComponent = gameObject.GetComponent <GetTextureByOnRenderImage>(); if (getTextureComponent != null) { getTextureComponent.UnregisterDelegates(); } // Don't bother to destroy managed components in case of game starting if (EditorApplication.isPlayingOrWillChangePlaymode) { MonoBehaviourManager.DestroyManagedComponent <GetTextureByOnRenderImage>(gameObject, null); } GraphicEventManager.IssuePluginEvent((int)NativePluginBridge.SYPHON.GraphicEvent.StopServer, System.IntPtr.Zero); if (metalServerTexture != null) { if (Application.isPlaying) { DestroyImmediate(metalServerTexture); } else { DestroyImmediate(metalServerTexture); } } metalServerTexture = null; // Dispose the internal objects. if (metalBlitMaterial != null) { if (Application.isPlaying) { DestroyImmediate(metalBlitMaterial); } else { DestroyImmediate(metalBlitMaterial); } } }
private void destroyEverything() { // Make sure to unregister GetTextureByAsyncReadback getTextureComponent = gameObject.GetComponent <GetTextureByAsyncReadback>(); if (getTextureComponent != null) { getTextureComponent.UnregisterDelegates(); } // Don't bother to destroy managed components in case of game starting if (!EditorApplication.isPlayingOrWillChangePlaymode) { MonoBehaviourManager.DestroyManagedComponent <GetTextureByAsyncReadback>(gameObject, null); } if (ndiSender != IntPtr.Zero) { NativePluginBridge.NDI.DestroySender(ndiSender); ndiSender = IntPtr.Zero; } }
private void DestroyEverything() { if (spoutSender != System.IntPtr.Zero) { GraphicEventManager.IssuePluginEvent((int)NativePluginBridge.SPOUT.GraphicEvent.Dispose, spoutSender); spoutSender = System.IntPtr.Zero; } // Unregister delegates properly GetTextureByOnRenderImage getTextureComponent = gameObject.GetComponent <GetTextureByOnRenderImage>(); if (getTextureComponent != null) { getTextureComponent.UnregisterDelegates(); } // Don't bother to destroy managed components in case of game starting if (!EditorApplication.isPlayingOrWillChangePlaymode) { MonoBehaviourManager.DestroyManagedComponent <GetTextureByOnRenderImage>(gameObject, null); } Utils.DestroyUnityObject(blitMaterial); Utils.DestroyUnityObject(sharedTexture); }