Exemplo n.º 1
0
 public void SetRotate(bool value)
 {
     if (value)
     {
         lastPosition = ClickEventController.GetMousePosOnFlat();
     }
     isRotate = value;
 }
Exemplo n.º 2
0
        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);
            }
        }
Exemplo n.º 3
0
        void Update()
        {
            if (!isDrawingMode)
            {
                return;
            }

            if (Input.GetButtonDown("Fire1"))
            {
                if (ClickEventController.IsPointerOverUIElement())
                {
                    return;
                }
                if (ConstructorStep(ClickEventController.GetMousePosOnFlat(), drawingPointNumber))
                {
                    drawingPointNumber++;
                }
            }
        }