예제 #1
0
 public static EditorGrid GetInstance()
 {
     if (instance == null)
     {
         instance = new EditorGrid();
     }
     return(instance);
 }
예제 #2
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;
        }
예제 #3
0
        private void OnGUI()
        {
            EditorGrid.GetInstance().viewport = position;
            EditorGrid.GetInstance().Draw();
            toolBox.ActiveTool.Draw();

            toolBox.Draw();

            HandleEvent(Event.current);

            if (GUI.changed)
            {
                Repaint();
            }
        }
예제 #4
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;
            }
        }