示例#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;
            }
        }