Exemplo n.º 1
0
 private void CreateTextureGetterAndRegister()
 {
     MonoBehaviourManager.AddManagedComponent <GetTextureByAsyncReadback>(gameObject, (textureFetcher) =>
     {
         if (textureFetcher != null)
         {
             textureFetcher.RegisterOnNewFrameEvent(OnReadbackFrame);
             textureFetcher.RegisterOnSyncFrameEvent(OnReadbackSync);
         }
         else
         {
             Debug.LogError($"{PluginData.PRODUCTION_PLUGIN_NAME}: NDI SENDER: unexpected missing textureFetcher");
         }
     });
 }
Exemplo n.º 2
0
 private void CreateTextureGetterAndRegister()
 {
     MonoBehaviourManager.AddManagedComponent <GetTextureByOnRenderImage>(gameObject, (textureFetcher) =>
     {
         if (textureFetcher != null)
         {
             textureFetcher.registerOnNewTexture(SendRenderTexture);
             textureFetcher.registerOnTextureResize(OnTextureResize);
         }
         else
         {
             Debug.LogError($"{PluginData.PRODUCTION_PLUGIN_NAME}: SPOUT SENDER: unexpected missing textureFetcher");
         }
     });
 }
Exemplo n.º 3
0
        private void CreateManagedComponent()
        {
            // Avoid side effects of managed components being enabled while this component is disabled
            if (!enabled)
            {
                return;
            }

            switch (_outputType)
            {
            case SendTechnique.SyphonSpout:
#if UNITY_EDITOR_OSX || UNITY_STANDALONE_OSX
#if UVO_API_METAL
                MonoBehaviourManager.AddManagedComponent <MetalSyphon>(gameObject, handleCreatedManagedComponent);
#else
                Debug.LogError(PluginData.PRODUCTION_PLUGIN_NAME + ": This graphic API is not supported. Please switch your API to Metal in Project Settings -> Player");
#endif
#elif UNITY_EDITOR_WIN || UNITY_STANDALONE_WIN
#if UVO_API_DIRECTX11
                MonoBehaviourManager.AddManagedComponent <SpoutSender>(gameObject, handleCreatedManagedComponent);
#else
                Debug.LogError(PluginData.PRODUCTION_PLUGIN_NAME + ": This graphic API is not supported. Please switch your API to DirectX11 in Project Settings -> Player");
#endif
#endif

                break;

            case SendTechnique.NDI:
#if UVO_API_DIRECTX11 || UVO_API_METAL
                MonoBehaviourManager.AddManagedComponent <NdiSender>(gameObject, handleCreatedManagedComponent);
#else
                string switchToPlatform = "";
#if UNITY_EDITOR_OSX || UNITY_STANDALONE_OSX
                switchToPlatform = "Metal";
#elif UNITY_EDITOR_WIN || UNITY_STANDALONE_WIN
                switchToPlatform = "DirectX D11";
#endif
                Debug.LogError(PluginData.PRODUCTION_PLUGIN_NAME + ": This graphic API is not supported. Please switch your API to " + switchToPlatform + " in Project Settings -> Player");
#endif
                break;

            default:
                Debug.LogError("Unexpected value of output type");
                break;
            }
        }