コード例 #1
0
    public static CutsceneWrapper CreateWrapper(Cutscene cutscene)
    {
        CutsceneWrapper wrapper = new CutsceneWrapper(cutscene);

        if (cutscene != null)
        {
            wrapper.RunningTime = cutscene.RunningTime;
            wrapper.Duration    = cutscene.Duration;
            wrapper.IsPlaying   = cutscene.State == Cutscene.CutsceneState.PreviewPlaying || cutscene.State == Cutscene.CutsceneState.Playing;

            foreach (TrackGroup tg in cutscene.TrackGroups)
            {
                TrackGroupWrapper tgWrapper = new TrackGroupWrapper(tg);
                tgWrapper.Ordinal = tg.Ordinal;
                wrapper.AddTrackGroup(tg, tgWrapper);

                foreach (TimelineTrack track in tg.GetTracks())
                {
                    TimelineTrackWrapper trackWrapper = new TimelineTrackWrapper(track);
                    trackWrapper.Ordinal = track.Ordinal;
                    tgWrapper.AddTrack(track, trackWrapper);

                    foreach (TimelineItem item in track.GetTimelineItems())
                    {
                        if (item.GetType().IsSubclassOf(typeof(CinemaClipCurve)))
                        {
                            CinemaClipCurve        clip        = item as CinemaClipCurve;
                            CinemaClipCurveWrapper clipWrapper = new CinemaClipCurveWrapper(clip, clip.Firetime, clip.Duration);
                            trackWrapper.AddItem(clip, clipWrapper);
                        }
                        else if (item.GetType().IsSubclassOf(typeof(CinemaTween)))
                        {
                        }
                        else if (item.GetType().IsSubclassOf(typeof(TimelineActionFixed)))
                        {
                            TimelineActionFixed      actionFixed        = item as TimelineActionFixed;
                            CinemaActionFixedWrapper actionFixedWrapper = new CinemaActionFixedWrapper(actionFixed, actionFixed.Firetime, actionFixed.Duration, actionFixed.InTime, actionFixed.OutTime, actionFixed.ItemLength);
                            trackWrapper.AddItem(actionFixed, actionFixedWrapper);
                        }
                        else if (item.GetType().IsSubclassOf(typeof(TimelineAction)))
                        {
                            TimelineAction      action      = item as TimelineAction;
                            CinemaActionWrapper itemWrapper = new CinemaActionWrapper(action, action.Firetime, action.Duration);
                            trackWrapper.AddItem(action, itemWrapper);
                        }
                        else
                        {
                            TimelineItemWrapper itemWrapper = new TimelineItemWrapper(item, item.Firetime);
                            trackWrapper.AddItem(item, itemWrapper);
                        }
                    }
                }
            }
        }
        return(wrapper);
    }
コード例 #2
0
    public static CutsceneWrapper CreateWrapper(Cutscene cutscene)
    {
        CutsceneWrapper wrapper = new CutsceneWrapper(cutscene);
        if (cutscene != null)
        {
            wrapper.RunningTime = cutscene.RunningTime;
            wrapper.Duration = cutscene.Duration;
            wrapper.IsPlaying = cutscene.State == Cutscene.CutsceneState.PreviewPlaying || cutscene.State == Cutscene.CutsceneState.Playing;
           
            foreach (TrackGroup tg in cutscene.TrackGroups)
            {
                TrackGroupWrapper tgWrapper = new TrackGroupWrapper(tg);
                tgWrapper.Ordinal = tg.Ordinal;
                wrapper.AddTrackGroup(tg, tgWrapper);

                foreach (TimelineTrack track in tg.GetTracks())
                {
                    TimelineTrackWrapper trackWrapper = new TimelineTrackWrapper(track);
                    trackWrapper.Ordinal = track.Ordinal;
                    tgWrapper.AddTrack(track, trackWrapper);

                    foreach (TimelineItem item in track.GetTimelineItems())
                    {
                        if (item.GetType().IsSubclassOf(typeof(CinemaClipCurve)))
                        {
                            CinemaClipCurve clip = item as CinemaClipCurve;
                            CinemaClipCurveWrapper clipWrapper = new CinemaClipCurveWrapper(clip, clip.Firetime, clip.Duration);
                            trackWrapper.AddItem(clip, clipWrapper);
                        }
                        else if (item.GetType().IsSubclassOf(typeof(CinemaTween)))
                        {
                        }
                        else if (item.GetType().IsSubclassOf(typeof(TimelineActionFixed)))
                        {
                            TimelineActionFixed actionFixed = item as TimelineActionFixed;
                            CinemaActionFixedWrapper actionFixedWrapper = new CinemaActionFixedWrapper(actionFixed, actionFixed.Firetime, actionFixed.Duration, actionFixed.InTime, actionFixed.OutTime, actionFixed.ItemLength);
                            trackWrapper.AddItem(actionFixed, actionFixedWrapper);
                        }
                        else if (item.GetType().IsSubclassOf(typeof(TimelineAction)))
                        {
                            TimelineAction action = item as TimelineAction;
                            CinemaActionWrapper itemWrapper = new CinemaActionWrapper(action, action.Firetime, action.Duration);
                            trackWrapper.AddItem(action, itemWrapper);
                        }
                        else
                        {
                            TimelineItemWrapper itemWrapper = new TimelineItemWrapper(item, item.Firetime);
                            trackWrapper.AddItem(item, itemWrapper);
                        }
                    }
                }
            }
        }
        return wrapper;
    }
コード例 #3
0
    public static CutsceneWrapper CreateWrapper(Cutscene cutscene)
    {
        CutsceneWrapper wrapper = new CutsceneWrapper(cutscene);

        if (cutscene != null)
        {
            wrapper.RunningTime = cutscene.RunningTime;
            wrapper.Duration    = cutscene.Duration;
            wrapper.IsPlaying   = cutscene.State == Cutscene.CutsceneState.PreviewPlaying || cutscene.State == Cutscene.CutsceneState.Playing;
            {
                var __array5       = cutscene.TrackGroups;
                var __arrayLength5 = __array5.Length;
                for (int __i5 = 0; __i5 < __arrayLength5; ++__i5)
                {
                    var tg = (TrackGroup)__array5[__i5];
                    {
                        TrackGroupWrapper tgWrapper = new TrackGroupWrapper(tg);
                        tgWrapper.Ordinal = tg.Ordinal;
                        wrapper.AddTrackGroup(tg, tgWrapper);
                        {
                            // foreach(var track in tg.GetTracks())
                            var __enumerator25 = (tg.GetTracks()).GetEnumerator();
                            while (__enumerator25.MoveNext())
                            {
                                var track = (TimelineTrack)__enumerator25.Current;
                                {
                                    TimelineTrackWrapper trackWrapper = new TimelineTrackWrapper(track);
                                    trackWrapper.Ordinal = track.Ordinal;
                                    tgWrapper.AddTrack(track, trackWrapper);
                                    {
                                        // foreach(var item in track.GetTimelineItems())
                                        var __enumerator33 = (track.GetTimelineItems()).GetEnumerator();
                                        while (__enumerator33.MoveNext())
                                        {
                                            var item = (TimelineItem)__enumerator33.Current;
                                            {
                                                if (item.GetType().IsSubclassOf(typeof(CinemaClipCurve)))
                                                {
                                                    CinemaClipCurve        clip        = item as CinemaClipCurve;
                                                    CinemaClipCurveWrapper clipWrapper = new CinemaClipCurveWrapper(clip, clip.Firetime, clip.Duration);
                                                    trackWrapper.AddItem(clip, clipWrapper);
                                                }
                                                else if (item.GetType().IsSubclassOf(typeof(CinemaTween)))
                                                {
                                                }
                                                else if (item.GetType().IsSubclassOf(typeof(TimelineActionFixed)))
                                                {
                                                    TimelineActionFixed      actionFixed        = item as TimelineActionFixed;
                                                    CinemaActionFixedWrapper actionFixedWrapper = new CinemaActionFixedWrapper(actionFixed, actionFixed.Firetime, actionFixed.Duration, actionFixed.InTime, actionFixed.OutTime, actionFixed.ItemLength);
                                                    trackWrapper.AddItem(actionFixed, actionFixedWrapper);
                                                }
                                                else if (item.GetType().IsSubclassOf(typeof(TimelineAction)))
                                                {
                                                    TimelineAction      action      = item as TimelineAction;
                                                    CinemaActionWrapper itemWrapper = new CinemaActionWrapper(action, action.Firetime, action.Duration);
                                                    trackWrapper.AddItem(action, itemWrapper);
                                                }
                                                else
                                                {
                                                    TimelineItemWrapper itemWrapper = new TimelineItemWrapper(item, item.Firetime);
                                                    trackWrapper.AddItem(item, itemWrapper);
                                                }
                                            }
                                        }
                                    }
                                }
                            }
                        }
                    }
                }
            }
        }
        return(wrapper);
    }