/// <summary> /// The method that invoked when single click. /// </summary> private void SingleClick() { if (Input.GetMouseButton(0)) { _fieldController.MoveRectangle(_mousePos); } else if (Input.GetMouseButtonUp(0)) { _fieldController.StopMoveRectangle(); } if (Input.GetMouseButtonDown(1)) { _fieldController.StartConnection(_mousePos); // create connection } else if (Input.GetMouseButton(1)) { _fieldController.MoveConnectionWhenInit(_mousePos); // moving connection when we drugging it to another rectangle } else if (Input.GetMouseButtonUp(1)) { _fieldController.EndConnection(_mousePos); // finishing the creation of the connection } }