示例#1
0
    /// <summary>
    /// Init the background texture at end of the frame.
    /// </summary>
    /// <returns>Yield return.</returns>
    private IEnumerator InitBackground()
    {
        // wait for end of frame to not interfere with rendering thread on mac
        yield return(new WaitForEndOfFrame());

        VideoOverlayProvider.Init();
        #if (UNITY_EDITOR || UNITY_STANDALONE_OSX)
        //issue plugin event to render right after rendering thread finished rendering
        Plugin.IssuePluginEvent(Plugin.PluginEvents.InitBackgroundEvent);
        #elif (UNITY_IPHONE || UNITY_ANDROID)
        GL.InvalidateState();
        #else
        #error platform is not supported
        #endif
        is_initBackgroundFinished = true;
    }