public static void Open() { _instance = GetWindow <FInspectorWindow>(); _instance.Show(); _instance.titleContent = new GUIContent("Flux Inspector"); }
public void OnUndo() { _editorCache.Refresh(); FInspectorWindow.SetEvents(_selectedEvents); FInspectorWindow.SetTracks(_selectedTracks); }
void OnEnable() { _instance = this; hideFlags = HideFlags.DontSave; EditorApplication.playmodeStateChanged += OnPlaymodeChanged; }
private void DeselectEvent(FEventEditor eventEditor) { if (eventEditor == null || !eventEditor.IsSelected()) { return; } Undo.RegisterCompleteObjectUndo(new Object[] { eventEditor, this }, "deselect Event"); _selectedEvents.Remove(eventEditor); FInspectorWindow.SetEvents(_selectedEvents); eventEditor.OnDeselect(); }
private void SelectTrack(FTrackEditor trackEditor) { if (trackEditor == null || trackEditor.IsSelected()) { return; } Undo.RegisterCompleteObjectUndo(new Object[] { trackEditor, this }, "select Track"); _selectedTracks.Add(trackEditor); trackEditor.OnSelect(); FInspectorWindow.SetTracks(_selectedTracks); }
private void SelectEvent(FEventEditor eventEditor) { if (eventEditor == null || eventEditor.IsSelected()) { return; } SelectTrack(eventEditor._trackEditor); Undo.RegisterCompleteObjectUndo(new Object[] { eventEditor, this }, "select Event"); _selectedEvents.Add(eventEditor); FInspectorWindow.SetEvents(_selectedEvents); eventEditor.OnSelect(); }
private void DeselectAll() { int numEvents = _selectedEvents.Count; int numTracks = _selectedTracks.Count; int totalSelected = numEvents + numTracks; if (totalSelected == 0) { return; } // tracks + events + window Object[] objsToSave = new Object[totalSelected + 1]; int i = 0; for (int j = 0; j != numEvents; ++i, ++j) { objsToSave[i] = _selectedEvents[j]; } for (int j = 0; j != numTracks; ++i, ++j) { objsToSave[i] = _selectedTracks[j]; } objsToSave[totalSelected] = this; Undo.RegisterCompleteObjectUndo(objsToSave, "deselect all"); for (int j = 0; j != numEvents; ++j) { _selectedEvents[j].OnDeselect(); } for (int j = 0; j != numTracks; ++j) { _selectedTracks[j].OnDeselect(); } _selectedEvents.Clear(); _selectedTracks.Clear(); FInspectorWindow.SetEvents(null); FInspectorWindow.SetTracks(null); }