Beispiel #1
0
 public virtual void ActionDrag(BaseEventData baseEvent)
 {
     if (!frozen)
     {
         if (!editorMode)
         {
             float angle = AngleBetweenPoints(transform.position, Input.mousePosition);
             if (angle > dragRotationThreshold || angle < -dragRotationThreshold)
             {
                 EventRotateChannel(angle < -dragRotationThreshold, true);
                 dragged = true;
             }
             if (Math.Abs(angle) > 90)
             {
                 mousePosition = Input.mousePosition;
             }
         }
         else
         {
             if (!dragged && Vector3.Distance(Input.mousePosition, mousePosition) > rectTransform.rect.width / 2)
             {
                 dragged = true;
                 editorManager.ActionToolsBasicDown(channelID);
                 editorManager.selectedTool.transform.rotation = this.transform.rotation;
                 this.setInvisbile(true);
             }
             if (dragged)
             {
                 editorManager.ActionToolsBasicDrag(channelID);
             }
         }
     }
 }