コード例 #1
0
ファイル: EditorPeriodicJob.cs プロジェクト: cwp10/MovieProxy
        private static void ProcessMovieProxyTrack(MovieProxyTrack track)
        {
            foreach (var clip in track.GetClips())
            {
                // You might want to use "as" rather than compare type.
                // "as" sometimes fail on first importing time for project.
                if (clip.asset.GetType() != typeof(MovieProxyPlayableAsset))
                {
                    Debug.LogError("MovieProxyPlayableAsset is broken:" + clip.asset.name);
                    continue;
                }

                /*
                 * if (clip.asset == null)
                 * {
                 *  Debug.LogError("MovieProxyPlayableAsset on " + clip.displayName + " is broken.");
                 *  continue;
                 * }*/

                MovieProxyPlayableAsset asset = (MovieProxyPlayableAsset)clip.asset;
                int length = asset.Pictures.Length;
                if (m_MovieProxyPlayableAssetToColorArray.ContainsKey(asset))
                {
                }
                else
                {
                    m_MovieProxyPlayableAssetToColorArray.Add(asset, new BGJobCacheParam(asset));
                }
                var param        = m_MovieProxyPlayableAssetToColorArray[asset];
                int allAreLoaded = PluginUtil.GetAllAreLoaded(asset.GetInstanceID());

                if (allAreLoaded == 0)
                {
                    new BGJobCacheChecker(m_MovieProxyPlayableAssetToColorArray[asset]);
                    UInt32[] colorArray = m_MovieProxyPlayableAssetToColorArray[asset].m_collorArray;
                    if (colorArray == null)
                    {
                        return;
                    }
                    PluginUtil.SetOverwrapWindowData(asset.GetInstanceID(), colorArray, colorArray.Length);
                    if (param.m_allLoaded)
                    {
                        PluginUtil.SetAllAreLoaded(asset.GetInstanceID(), 1);
                    }
                }
                else
                {
                    PluginUtil.HideOverwrapWindow(asset.GetInstanceID());
                }
            }
        }
コード例 #2
0
        public override void Initialize()
        {
            // hmmmm. seemingly kinda garbage makes invalid track.
            // we need to remove such  tracks by checking those are  really included in the timeline asset.
            if (m_track.parent == null)
            {
                RemoveIfFinished();
                return; // ???
            }
            List <TrackAsset> tracks = null;

            if (m_track.parent.GetType() == typeof(GroupTrack))
            {
                tracks = UpdateManager.GetTrackList(m_track.parent as GroupTrack);
            }
            else if (m_track.parent.GetType() == typeof(TimelineAsset))
            {
                tracks = UpdateManager.GetTrackList(m_track.parent as TimelineAsset);
            }
            bool flgFound = false;

            if (tracks != null)
            {
                foreach (var track in tracks)
                {
                    if (track == m_track)
                    {
                        flgFound = true;
                        break;
                    }
                }
            }
            if (flgFound == false) // the track is not included. It must be the garbage.
            {
                m_track = null;
                RemoveIfFinished();
                return;
            }
        }
コード例 #3
0
 public LoaderPeriodicJob(MovieProxyTrack track) : base(UpdateManager.JobOrder.Normal)
 {
     m_track = track;
 }