public TreeItem(SECTR_AudioWindow window, SECTR_AudioCue cue, string path) { this.cue = cue; this.path = path; this.Name = cue.name; window.hierarchyItems.Add(AsObject, this); }
public TreeItem(SECTR_AudioWindow window, SECTR_AudioBus bus, string path) { this.bus = bus; this.path = path; this.Name = bus.name; this.Expanded = EditorPrefs.GetBool(expandedPrefPrefix + this.path, true); window.hierarchyItems.Add(AsObject, this); }
public bool HandleEvents(SECTR_AudioWindow parent) { bool handledEvent = false; switch(Event.current.type) { case EventType.MouseDown: if(rect.Contains(Event.current.mousePosition)) { dragging = true; handledEvent = true; } break; case EventType.MouseDrag: if(dragging) { pos += vertical ? (int)Event.current.delta.x : (int)Event.current.delta.y; handledEvent = true; } break; case EventType.MouseUp: dragging = false; break; } if(dragging || rect.Contains(Event.current.mousePosition)) { EditorGUIUtility.AddCursorRect(new Rect(Event.current.mousePosition.x - 16, Event.current.mousePosition.y - 16, 32, 32), vertical ? MouseCursor.ResizeHorizontal : MouseCursor.ResizeVertical); } return handledEvent; }
public void Draw(SECTR_AudioWindow window) { if(vertical) { rect = new Rect(pos, 0f, thickness, window.showClipList ? window.bottomSplitter.pos : Screen.height); } else { rect = new Rect(0f, pos, Screen.width, thickness); } GUI.Box(rect, GUIContent.none); }