/// <summary> /// Set the current tool, disable if equal to the parameter /// </summary> /// <param name="tool"></param> private void SetTool(ShapeEditorTool tool) { if (tool != _currentTool) { _currentTool = tool; } else { _currentTool = null; } enabledSelection = true; //By default enable the selection on change tool if (_currentTool != null) { _currentTool.Init(); //Initialize the tool } else { if (_shapeTools.Length > 0) { _currentTool = _shapeTools[0]; } } }