コード例 #1
0
        public override bool Execute(TimelineWindow.TimelineState state)
        {
            bool result;

            if (state.IsEditingASubItem())
            {
                result = false;
            }
            else if (SelectionManager.Count() == 0)
            {
                result = false;
            }
            else
            {
                bool flag = false;
                foreach (TimelineClip current in SelectionManager.SelectedItems <TimelineClip>())
                {
                    flag |= TimelineHelpers.NudgeClip(current, state, 1.0);
                }
                if (flag)
                {
                    state.Evaluate();
                }
                result = true;
            }
            return(result);
        }
コード例 #2
0
        public override bool Execute(TimelineWindow.TimelineState state)
        {
            bool result;

            if (state.IsEditingASubItem())
            {
                result = false;
            }
            else
            {
                TimelineWindow window = state.GetWindow();
                if (window == null || window.treeView == null)
                {
                    result = false;
                }
                else
                {
                    TrackAsset[] visibleTracks = window.treeView.visibleTracks;
                    if (visibleTracks.Length == 0)
                    {
                        result = false;
                    }
                    else
                    {
                        float        num   = 3.40282347E+38f;
                        float        num2  = -3.40282347E+38f;
                        TrackAsset[] array = visibleTracks;
                        for (int i = 0; i < array.Length; i++)
                        {
                            TrackAsset trackAsset = array[i];
                            double     num3;
                            double     num4;
                            trackAsset.GetSequenceTime(out num3, out num4);
                            num  = Mathf.Min(num, (float)num3);
                            num2 = Mathf.Max(num2, (float)(num3 + num4));
                        }
                        float num5 = num2 - Math.Max(0f, num);
                        if (num5 > 0f)
                        {
                            state.SetTimeAreaShownRange(Mathf.Max(-10f, num - num5 * 0.1f), num2 + num5 * 0.1f);
                        }
                        else
                        {
                            state.SetTimeAreaShownRange(0f, 100f);
                        }
                        state.Evaluate();
                        result = true;
                    }
                }
            }
            return(result);
        }
コード例 #3
0
        public override bool Execute(TimelineWindow.TimelineState state)
        {
            bool result;

            if (state.IsEditingASubItem())
            {
                result = false;
            }
            else
            {
                state.time = 0.0;
                state.EnsurePlayHeadIsVisible();
                result = true;
            }
            return(result);
        }
コード例 #4
0
        public override bool Execute(TimelineWindow.TimelineState state)
        {
            bool result;

            if (state.IsEditingASubItem())
            {
                result = false;
            }
            else if (SelectionManager.Count() == 0)
            {
                result = false;
            }
            else
            {
                float num  = 3.40282347E+38f;
                float num2 = -3.40282347E+38f;
                IEnumerable <TimelineClipGUI> enumerable = SelectionManager.SelectedClipGUI();
                if (!enumerable.Any <TimelineClipGUI>())
                {
                    result = false;
                }
                else
                {
                    foreach (TimelineClipGUI current in enumerable)
                    {
                        num  = Mathf.Min(num, (float)current.clip.start);
                        num2 = Mathf.Max(num2, (float)current.clip.start + (float)current.clip.duration);
                        if (current.clipCurveEditor != null)
                        {
                            current.clipCurveEditor.FrameClip();
                        }
                    }
                    float num3 = num2 - num;
                    if (Mathf.Abs(num3) < 1.401298E-45f)
                    {
                        num3 = 1f;
                    }
                    state.SetTimeAreaShownRange(Mathf.Max(num - num3 * 0.2f, -10f), num2 + num3 * 0.2f);
                    state.Evaluate();
                    result = true;
                }
            }
            return(result);
        }