Ejemplo n.º 1
0
 private void OnEnable()
 {
     state = new SeqenceState(this);
     tree  = new EditorTrackTree();
     InitializeTimeArea();
     InitializeMarkerHeader();
 }
Ejemplo n.º 2
0
        public static void DrawBackgroundRect(SeqenceState state, Rect rect, bool subSequenceMode = false)
        {
            Color c = subSequenceMode ? SeqenceStyle.colorSubSequenceBackground : SeqenceStyle.colorSequenceBackground;

            EditorGUI.DrawRect(rect, c);
            // if (state.IsEditingAPrefabAsset())
            // {
            //     c = SceneView.kSceneViewPrefabBackground.Color;
            //     c.a = 0.5f;
            //     EditorGUI.DrawRect(rect, c);
            // }
        }
Ejemplo n.º 3
0
        public void OnGUI(SeqenceState state)
        {
            if (hierachy == null)
            {
                BuildTreeHierachy(state);
            }
            winRect         = SeqenceWindow.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    = WindowConstants.trackRowYPosition;
            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();
            }
        }
Ejemplo n.º 4
0
        public void BuildTreeHierachy(SeqenceState state)
        {
            if (state.seqence == null)
            {
                throw new Exception("seqence is null");
            }
            winRect   = state.window.winArea;
            x         = WindowConstants.rightAreaMargn;
            _y        = WindowConstants.trackRowYPosition;
            width     = winRect.width;
            track_idx = 0;
            var trees = state.seqence.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();
        }