private void HandleCustomTool() { Event evt = Event.current; if (evt.type == EventType.Layout || evt.type == EventType.Repaint) { return; } if (!TilemapEditorTool.IsCustomTilemapEditorToolActive()) { return; } TilemapEditorTool activeTool = EditorToolManager.activeTool as TilemapEditorTool; var executed = CustomTool(isHotControl, activeTool, new Vector3Int(mouseGridPosition.x, mouseGridPosition.y, zPosition)); if (executed != executing) { GUIUtility.hotControl = executed ? m_PermanentControlID : 0; executing = executed; GUI.changed = true; Event.current.Use(); } else if (executing) { GUI.changed = true; Event.current.Use(); } }