public void ScanForVideoPlayers()
        {
            Debug.Log("scan");
            // Remove any VideoPlayer instances with deleted (null) VideoPlayers
            for (int i = 0; i < _instances.Count; i++)
            {
                VideoPlayerInstance instance = _instances[i];
                if (instance.Is(null))
                {
                    _instances.RemoveAt(i); i--;
                }
            }

            // Find all inactive and active VideoPlayers
            VideoPlayer[] videoPlayers = Resources.FindObjectsOfTypeAll <VideoPlayer>();

            // Create a unique instance for each director
            foreach (VideoPlayer videoPlayer in videoPlayers)
            {
                // Check we don't already have this VideoPlayer
                bool hasVideoPlayer = false;
                foreach (VideoPlayerInstance instance in _instances)
                {
                    if (instance.Is(videoPlayer))
                    {
                        hasVideoPlayer = true;
                        break;
                    }
                }

                // Add to the list
                if (!hasVideoPlayer)
                {
                    _instances.Add(new VideoPlayerInstance(videoPlayer));
                    Debug.Log("add");
                }
            }
        }
Exemplo n.º 2
0
 public Bitmap TakeSnapshot()
 {
     return(VideoPlayerInstance.TakeSnapshot());
 }
Exemplo n.º 3
0
 public void TakeSnapshot(string dst)
 {
     VideoPlayerInstance.TakeSnapshot(dst);
 }