public void SetRotate(bool value) { if (value) { lastPosition = ClickEventController.GetMousePosOnFlat(); } isRotate = value; }
void FixedUpdate() { if (!isRotate) { return; } var delta = (ClickEventController.GetMousePosOnFlat() - lastPosition); lastPosition = ClickEventController.GetMousePosOnFlat(); var turn = new Vector3(delta.y, -delta.x, 0); if (Math.Abs(delta.magnitude) > Mathf.Epsilon) { MainManager.ClickEventController.SetCatchClicksState(ClickEventControllerStates.Rotate); rb.AddTorque(torque * turn, ForceMode.VelocityChange); } }
void Update() { if (!isDrawingMode) { return; } if (Input.GetButtonDown("Fire1")) { if (ClickEventController.IsPointerOverUIElement()) { return; } if (ConstructorStep(ClickEventController.GetMousePosOnFlat(), drawingPointNumber)) { drawingPointNumber++; } } }