Ejemplo n.º 1
0
        public static void Open()
        {
            _instance = GetWindow <FInspectorWindow>();

            _instance.Show();
            _instance.titleContent = new GUIContent("Flux Inspector");
        }
Ejemplo n.º 2
0
        public void OnUndo()
        {
            _editorCache.Refresh();

            FInspectorWindow.SetEvents(_selectedEvents);
            FInspectorWindow.SetTracks(_selectedTracks);
        }
Ejemplo n.º 3
0
        void OnEnable()
        {
            _instance = this;

            hideFlags = HideFlags.DontSave;

            EditorApplication.playmodeStateChanged += OnPlaymodeChanged;
        }
Ejemplo n.º 4
0
        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();
        }
Ejemplo n.º 5
0
        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);
        }
Ejemplo n.º 6
0
        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();
        }
Ejemplo n.º 7
0
        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);
        }