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; }
private void OnGUI() { EditorGrid.GetInstance().viewport = position; EditorGrid.GetInstance().Draw(); toolBox.ActiveTool.Draw(); toolBox.Draw(); HandleEvent(Event.current); if (GUI.changed) { Repaint(); } }
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; } }