예제 #1
0
 private void OnEnable()
 {
     state = new SeqenceState(this);
     tree  = new EditorTrackTree();
     InitializeTimeArea();
     InitializeMarkerHeader();
 }
예제 #2
0
파일: Graphics.cs 프로젝트: zxsean/seqence
        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);
            // }
        }
예제 #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 = 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(SeqenceState state)
        {
            if (state.seqence == 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.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();
        }
예제 #5
0
 static void OnEditorReload()
 {
     SeqenceState.CleanEnv();
 }