Example #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);
    }
Example #2
0
    protected bool Init()
    {
        try
        {
            if (AVProQuickTimePlugin.Init())
            {
                Debug.Log("[AVProQuickTime] version " + AVProQuickTimePlugin.GetPluginVersion().ToString("F2") + " initialised");
            }
            else
            {
                Debug.LogError("[AVProQuickTime] failed to initialise.");
                this.enabled = false;
                Deinit();
                return(false);
            }
        }
        catch (DllNotFoundException e)
        {
            Debug.Log("[AVProQuickTime] Unity couldn't find the DLL, did you move the 'Plugins' folder to the root of your project?");
#if UNITY_EDITOR
            AVProQuickTimeCopyPluginWizard.DisplayCopyDialog();
#endif
            throw e;
        }

        GetConversionMethod();
        SetUnityFeatures();

        Debug.Log("[AVProQuickTime] Conversion method: " + _conversionMethod);

#if AVPRO_UNITY_4_X || UNITY_3_5
        //StartCoroutine("FinalRenderCapture");
#endif

        _isInitialised = true;

        return(_isInitialised);
    }