Exemplo n.º 1
0
    protected bool Init()
    {
        if (_isInitialised)
        {
            return(true);
        }

        try
        {
            if (AVProQuickTimePlugin.Init())
            {
                Debug.Log("[AVProQuickTime] Initialised (plugin version " + AVProQuickTimePlugin.GetPluginVersion().ToString("F2") + ", script version " + AVProQuickTimePlugin.ScriptVersion + ")");
            }
            else
            {
                Debug.LogError("[AVProQuickTime] failed to initialise.");
                this.enabled = false;
                Deinit();
                return(false);
            }
        }
        catch (DllNotFoundException e)
        {
            Debug.LogError("[AVProQuickTime] Unity couldn't find the DLL.  Please move the 'Plugins' folder to the root of your project, and then restart Unity.");
            Debug.LogException(e);
            return(false);
        }

#if AVPROVIDEO_ISSUEPLUGINEVENT_UNITY52
        if (_nativeFunction_UpdateAllTextures == System.IntPtr.Zero)
        {
            _nativeFunction_UpdateAllTextures = AVProQuickTimePlugin.GetRenderEventFunc();
        }
#endif

        LoadShaders();
        GetConversionMethod();
        SetUnityFeatures();

        if (_updateUsingCoroutine)
        {
            StartCoroutine("FinalRenderCapture");
        }

        _isInitialised = true;

        return(_isInitialised);
    }