예제 #1
0
 public static void SetShowInlineCurves(TrackAsset track, bool inlineOn)
 {
     if (!(track == null))
     {
         TimelineWindowViewPrefs.GetTrackViewModelData(track).showInlineCurves = inlineOn;
     }
 }
예제 #2
0
 public static void SetTrackCollapsed(TrackAsset track, bool collapsed)
 {
     if (!(track == null))
     {
         TimelineWindowViewPrefs.GetTrackViewModelData(track).collapsed = collapsed;
     }
 }
예제 #3
0
 public static void SetInlineCurveHeight(TrackAsset asset, float height)
 {
     if (asset != null)
     {
         TimelineWindowViewPrefs.GetTrackViewModelData(asset).inlineAnimationCurveHeight = height;
     }
 }
예제 #4
0
파일: MarkersLayer.cs 프로젝트: 0geova0/Jam
        void CreateLists(IRowGUI parent)
        {
            var markerCount = parent.asset.GetMarkerCount();

            if (markerCount == 0)
            {
                return;
            }

            var accumulator   = new List <IMarker>();
            var sortedMarkers = new List <IMarker>(parent.asset.GetMarkers());
            var vm            = TimelineWindowViewPrefs.GetTrackViewModelData(parent.asset);

            sortedMarkers.Sort((lhs, rhs) =>
            {
                // Sort by time first
                var timeComparison = lhs.time.CompareTo(rhs.time);
                if (timeComparison != 0)
                {
                    return(timeComparison);
                }

                // If there's a collision, sort by edit timestamp
                var lhsObject = lhs as object;
                var rhsObject = rhs as object;

                if (lhsObject.Equals(null) || rhsObject.Equals(null))
                {
                    return(0);
                }

                var lhsHash = lhsObject.GetHashCode();
                var rhsHash = rhsObject.GetHashCode();

                if (vm.markerTimeStamps.ContainsKey(lhsHash) && vm.markerTimeStamps.ContainsKey(rhsHash))
                {
                    return(vm.markerTimeStamps[lhsHash].CompareTo(vm.markerTimeStamps[rhsHash]));
                }

                return(0);
            });

            foreach (var current in sortedMarkers)
            {
                // TODO: Take zoom factor into account?
                if (accumulator.Count > 0 && Math.Abs(current.time - accumulator[accumulator.Count - 1].time) > TimeUtility.kTimeEpsilon)
                {
                    ProcessAccumulator(accumulator, parent);
                }

                accumulator.Add(current);
            }

            ProcessAccumulator(accumulator, parent);
        }
예제 #5
0
        public static float GetInlineCurveHeight(TrackAsset asset)
        {
            float result;

            if (asset == null)
            {
                result = TrackViewModelData.k_DefaultinlineAnimationCurveHeight;
            }
            else
            {
                result = TimelineWindowViewPrefs.GetTrackViewModelData(asset).inlineAnimationCurveHeight;
            }
            return(result);
        }
예제 #6
0
        void UpdateViewModel()
        {
            var curveEditor = currentCurveEditor.clipCurveEditor;

            if (curveEditor == null || curveEditor.bindingHierarchy.treeViewController == null)
            {
                return;
            }

            var vm = TimelineWindowViewPrefs.GetTrackViewModelData(m_TrackGUI.track);

            vm.inlineCurvesState = curveEditor.bindingHierarchy.treeViewController.state;
            vm.inlineCurvesShownAreaInsideMargins = curveEditor.shownAreaInsideMargins;
            vm.lastInlineCurveDataID = curveEditor.dataSource.id;
        }
예제 #7
0
 public override void Select()
 {
     zOrder = zOrderProvider.Next();
     SelectionManager.Add(marker);
     TimelineWindowViewPrefs.GetTrackViewModelData(parent.asset).markerTimeStamps[m_MarkerHash] = DateTime.UtcNow.Ticks;
 }
예제 #8
0
 public static bool GetShowInlineCurves(TrackAsset track)
 {
     return(!(track == null) && TimelineWindowViewPrefs.GetTrackViewModelData(track).showInlineCurves);
 }
예제 #9
0
 public static bool IsTrackCollapsed(TrackAsset track)
 {
     return(track == null || TimelineWindowViewPrefs.GetTrackViewModelData(track).collapsed);
 }