Пример #1
0
        private void OnEnable()
        {
            EditorGrid.GetInstance().viewport = position;
            EditorGrid.GetInstance().Recenter();

            string data = EditorPrefs.GetString(EDITOR_PREF_SETTINGS, EditorJsonUtility.ToJson(this));

            EditorJsonUtility.FromJsonOverwrite(data, this);

            Undo.undoRedoPerformed += OnUndoRedo;
        }
Пример #2
0
        private void OnGUI()
        {
            EditorGrid.GetInstance().viewport = position;
            EditorGrid.GetInstance().Draw();
            toolBox.ActiveTool.Draw();

            toolBox.Draw();

            HandleEvent(Event.current);

            if (GUI.changed)
            {
                Repaint();
            }
        }
Пример #3
0
        private void HandleEvent(Event e)
        {
            if (toolBox.HandleEvent(e))
            {
                GUI.changed = true;
                return;
            }

            if (toolBox.ActiveTool.HandleEvent(e))
            {
                GUI.changed = true;
                return;
            }

            if (EditorGrid.GetInstance().HandleEvent(e))
            {
                GUI.changed = true;
                return;
            }
        }