private void OnEnable() { state = new SeqenceState(this); tree = new EditorTrackTree(); InitializeTimeArea(); InitializeMarkerHeader(); }
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); // } }
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(); } }
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(); }
static void OnEditorReload() { SeqenceState.CleanEnv(); }