void Update()
    {
        UpdateMovie();

        for (int s = 0; s < mStreamTextures.Count; s++)
        {
            var texture = mStreamTextures [s];
            if (texture == null)
            {
                continue;
            }

            //	gr: the updateTexture() can cause mMovie to be deleted. mono seems to miss throwing exceptions if mMovie is null so it will take down unity
            if (mMovie != null)
            {
                mMovie.UpdateTexture(texture, s);
            }
        }

        for (int s = 0; s < mPerformanceTextures.Count && mEnableDebugTextures; s++)
        {
            var texture = mPerformanceTextures [s];
            if (texture == null)
            {
                continue;
            }

            //	gr: the updateTexture() can cause mMovie to be deleted. mono seems to miss throwing exceptions if mMovie is null so it will take down unity
            if (mMovie != null)
            {
                mMovie.UpdatePerformanceGraphTexture(texture, s, mLocalisedPerformanceGraph);
            }
        }

        for (int s = 0; s < mAudioTextures.Count && mEnableDebugTextures; s++)
        {
            var texture = mAudioTextures [s];
            if (texture == null)
            {
                continue;
            }

            //	gr: the updateTexture() can cause mMovie to be deleted. mono seems to miss throwing exceptions if mMovie is null so it will take down unity
            if (mMovie != null)
            {
                mMovie.UpdateAudioTexture(texture, s);
            }
        }

        //	waiting for first frame
        if (!mStarted && mMovie != null)
        {
            var LastFrameCopied = mMovie.GetLastFrameCopiedMs();
            if (LastFrameCopied != 0)
            {
                OnMovieFrameReady();
            }
        }
    }
Example #2
0
    void Update()
    {
        //	cannot read this in the audio thread, so we have to cache it
        mAudioSampleRate = AudioSettings.outputSampleRate;

        //	create movie
        if (mMovie == null)
        {
            try {
                CreateMovie();
            } catch (System.Exception e) {
                DebugLog("failed to create pop movie: " + e.ToString() + " " + e.Message);
            }
        }


        for (int s = 0; s < mPerformanceTextures.Count; s++)
        {
            var texture = mPerformanceTextures [s];
            if (texture == null)
            {
                continue;
            }

            //	gr: the updateTexture() can cause mMovie to be deleted. mono seems to miss throwing exceptions if mMovie is null so it will take down unity
            if (mMovie != null)
            {
                mMovie.UpdatePerformanceGraphTexture(texture, s, mLocalisedPerformanceGraph);
            }
        }

        for (int s = 0; s < mAudioTextures.Count; s++)
        {
            var texture = mAudioTextures [s];
            if (texture == null)
            {
                continue;
            }

            //	gr: the updateTexture() can cause mMovie to be deleted. mono seems to miss throwing exceptions if mMovie is null so it will take down unity
            if (mMovie != null)
            {
                mMovie.UpdateAudioTexture(texture, s);
            }
        }

        for (int s = 0; s < mStreamTextures.Count; s++)
        {
            var texture = mStreamTextures [s];
            if (texture == null)
            {
                continue;
            }

            //	gr: the updateTexture() can cause mMovie to be deleted. mono seems to miss throwing exceptions if mMovie is null so it will take down unity
            if (mMovie != null)
            {
                mMovie.UpdateTexture(texture, s);
            }
        }
    }