Пример #1
0
 private void OnEnable()
 {
     state = new TimelineState(this);
     tree  = new EditorTrackTree();
     InitializeTimeArea();
     InitializeMarkerHeader();
 }
Пример #2
0
        public static void DrawBackgroundRect(TimelineState state, Rect rect, bool subSequenceMode = false)
        {
            Color c = subSequenceMode ? TimelineStyles.colorSubSequenceBackground : TimelineStyles.colorSequenceBackground;

            EditorGUI.DrawRect(rect, c);
            // if (state.IsEditingAPrefabAsset())
            // {
            //     c = SceneView.kSceneViewPrefabBackground.Color;
            //     c.a = 0.5f;
            //     EditorGUI.DrawRect(rect, c);
            // }
        }
Пример #3
0
        public void OnGUI(TimelineState state)
        {
            if (hierachy == null)
            {
                BuildTreeHierachy(state);
            }
            winRect         = TimelineWindow.inst.winArea;
            posRect         = winRect;
            posRect.x       = x;
            posRect.y       = _y;
            posRect.height  = winRect.height - _y;
            posRect.width   = winRect.width - x;
            viewRect        = posRect;
            viewRect.height = TracksBtmY - _y;
            viewRect.width -= 20;
            width           = winRect.width;
            SyncTreeWidth();

            float y = state.showMarkerHeader ? WindowConstants.trackRowYPosition
                : WindowConstants.markerRowYPosition;
            Rect clip = new Rect(0, y, winRect.width, winRect.height - y);

            GUI.BeginClip(clip);
            if (hierachy != null)
            {
                for (int i = 0; i < hierachy.Count; i++)
                {
                    hierachy[i].OnGUI(scroll);
                }
            }
            GUI.EndClip();
            bool vshow = viewRect.height > posRect.height;

            if (vshow)
            {
                scroll = GUI.BeginScrollView(posRect, scroll, viewRect, false, vshow);
                GUI.EndScrollView();
            }
        }
Пример #4
0
        public void BuildTreeHierachy(TimelineState state)
        {
            if (state.timeline == null)
            {
                throw new Exception("timeline is null");
            }
            winRect   = state.window.winArea;
            x         = WindowConstants.rightAreaMargn;
            _y        = WindowConstants.trackRowYPosition;
            width     = winRect.width;
            track_idx = 0;
            var trees = state.timeline.trackTrees;

            if (trees != null)
            {
                hierachy = new List <EditorTrack>();
                for (int i = 1; i < trees.Length; i++) // 0 is marker track
                {
                    Add(trees[i], hierachy);
                }
            }
            BuildSkillHost();
        }
Пример #5
0
 static void OnEditorReload()
 {
     TimelineState.CleanEnv();
 }