示例#1
0
 private static void TextDrag(UICamera camera, UIInput input, UnityEngine.Event @event, UILabel label)
 {
     if (input == UIUnityEvents.lastInput && camera == UIUnityEvents.lastInputCamera)
     {
         UIUnityEvents.lastLabel = label;
         TextEditor textEditor = null;
         if (!UIUnityEvents.GetTextEditor(out textEditor))
         {
             return;
         }
         if (UIUnityEvents.controlID == GUIUtility.hotControl)
         {
             UITextPosition uITextPosition = camera.RaycastText(Input.mousePosition, label);
             if (@event.shift)
             {
                 UIUnityEvents.MoveTextPosition(@event, textEditor, ref uITextPosition);
             }
             else
             {
                 UIUnityEvents.SelectTextPosition(@event, textEditor, ref uITextPosition);
             }
             @event.Use();
         }
         UIUnityEvents.TextSharedEnd(false, textEditor, @event);
     }
 }