Exemple #1
0
 public void TestFixtureTearDown()
 {
     Object.DestroyImmediate(m_GameObject);
     foreach (var playback in m_CreatedVideoPlaybacks)
     {
         m_PlaybackManager.ReleaseVideoPlayback(playback);
     }
     m_CreatedVideoPlaybacks.Clear();
     while (m_PlaybackManager.videoPlaybackCount > 0)
     {
         VideoPlaybackMgr.ProcessOSMainLoopMessagesForTesting();
         m_PlaybackManager.Update();
     }
     m_PlaybackManager.Dispose();
 }
Exemple #2
0
    public void TestFixtureSetUp()
    {
        var guids = AssetDatabase.FindAssets(kAssetName);

        m_RealAssetPath = AssetDatabase.GUIDToAssetPath(guids[0]);
        AssetDatabase.ImportAsset(m_RealAssetPath, ImportAssetOptions.ForceUpdate);
        m_GameObject = new GameObject(kGameObjectName);
        m_GameObject.AddComponent <Canvas>().renderMode = RenderMode.ScreenSpaceOverlay;
        m_GameObject.AddComponent <Camera>();
        m_PlaybackManager = new VideoPlaybackMgr();
        var playback = m_PlaybackManager.CreateVideoPlayback(m_RealAssetPath, null, null, null);

        playback.SetAudioTarget(0, true, false, null);
        m_CreatedVideoPlaybacks = new List <VideoPlayback>
        {
            playback
        };
        while (!m_CreatedVideoPlaybacks.TrueForAll(p => p.IsReady()))
        {
            VideoPlaybackMgr.ProcessOSMainLoopMessagesForTesting();
            m_PlaybackManager.Update();
        }
    }