private void FrameAll(TimelineWindow.TimelineState state, ClipCurveEditor clipCurveEditor) { CurveDataSource dataSource = clipCurveEditor.dataSource; float start = dataSource.start; float duration = dataSource.animationClip.get_length() / dataSource.timeScale; InlineCurveEditor.Frame(state, start, duration, InlineCurveEditor.s_FrameAllMarginFactor); }
private void FrameSelected(TimelineWindow.TimelineState state, ClipCurveEditor clipCurveEditor) { if (!clipCurveEditor.HasSelection()) { this.FrameAll(state, clipCurveEditor); } else { Vector2 selectionRange = clipCurveEditor.GetSelectionRange(); if (selectionRange.x != selectionRange.y) { CurveDataSource dataSource = clipCurveEditor.dataSource; float start = dataSource.start + selectionRange.x / dataSource.timeScale; float duration = (selectionRange.y - selectionRange.x) / dataSource.timeScale; InlineCurveEditor.Frame(state, start, duration, InlineCurveEditor.s_FrameSelectedMarginFactor); } } }