Beispiel #1
0
        private void Open()
        {
            Int64           num      = 0L;
            Int64           num2     = 0L;
            RuntimePlatform platform = Application.platform;
            String          text;

            switch (platform)
            {
            case RuntimePlatform.WindowsEditor:
                text = AssetManagerUtil.GetStreamingAssetsPath() + "/ma/" + this.MovieFile;
                break;

            case RuntimePlatform.IPhonePlayer:
                text = AssetManagerUtil.GetStreamingAssetsPath() + "/ma/" + this.MovieFile;
                break;

            case RuntimePlatform.PS3:
            case RuntimePlatform.XBOX360:
IL_2A:
                if (platform != RuntimePlatform.WindowsPlayer)
                {
                    throw new Exception("[Movie.MovieMaterial.GLPlugin]  Platform: " + Application.platform + " Not supported.");
                }
                text = AssetManagerUtil.GetStreamingAssetsPath() + "/ma/" + this.MovieFile;
                break;

            case RuntimePlatform.Android:
                text = Application.dataPath;
                if (!AssetStream.GetZipFileOffsetLength(Application.dataPath, "ma/" + this.MovieFile, out num, out num2))
                {
                    throw new Exception("[Movie.MovieMaterial.GLPlugin] Error opening movie via AssetStream");
                }
                break;

            default:
                goto IL_2A;
            }
            this.isFMV = this.MovieFile.StartsWith("FMV");
            if (this.m_nativeContext != IntPtr.Zero && MovieMaterial.OpenStream(this.m_nativeContext, text, (Int32)num, (Int32)num2, false, this.scanDuration, 16))
            {
                this.Width           = MovieMaterial.GetPicWidth(this.m_nativeContext);
                this.Height          = MovieMaterial.GetPicHeight(this.m_nativeContext);
                this.m_picX          = MovieMaterial.GetPicX(this.m_nativeContext);
                this.m_picY          = MovieMaterial.GetPicY(this.m_nativeContext);
                this.m_yStride       = MovieMaterial.GetYStride(this.m_nativeContext);
                this.m_yHeight       = MovieMaterial.GetYHeight(this.m_nativeContext);
                this.m_uvStride      = MovieMaterial.GetUVStride(this.m_nativeContext);
                this.m_uvHeight      = MovieMaterial.GetUVHeight(this.m_nativeContext);
                this.currentFPS      = this.FPS;
                this.currentDuration = MovieMaterial.GetDuration(this.m_nativeContext);
                this.CalculateUVScaleOffset();
                return;
            }
            throw new FileLoadException("Error opening movie during stream opening at path: " + text);
        }