本文整理汇总了C#中UICamera.RaycastText方法的典型用法代码示例。如果您正苦于以下问题:C# UICamera.RaycastText方法的具体用法?C# UICamera.RaycastText怎么用?C# UICamera.RaycastText使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类UICamera
的用法示例。
在下文中一共展示了UICamera.RaycastText方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: TextDrag
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);
}
}
示例2: TextClickDown
private static void TextClickDown(UICamera camera, UIInput input, UnityEngine.Event @event, UILabel label)
{
UITextPosition uITextPosition = ([email protected] ? camera.RaycastText(Input.mousePosition, label) : new UITextPosition());
TextEditor textEditor = null;
UIUnityEvents.ChangeFocus(camera, input, label);
if (UIUnityEvents.GetTextEditor(out textEditor))
{
GUIUtility.hotControl = UIUnityEvents.controlID;
UIUnityEvents.SetKeyboardControl();
UIUnityEvents.MoveTextPosition(@event, textEditor, ref uITextPosition);
int num = @event.clickCount;
if (num == 2)
{
textEditor.SelectCurrentWord();
textEditor.DblClickSnap(TextEditor.DblClickSnapping.WORDS);
textEditor.MouseDragSelectsWholeWords(true);
}
else if (num == 3)
{
if (input.trippleClickSelect)
{
textEditor.SelectCurrentParagraph();
textEditor.MouseDragSelectsWholeWords(true);
textEditor.DblClickSnap(TextEditor.DblClickSnapping.PARAGRAPHS);
}
}
@event.Use();
}
else
{
Debug.LogError("Null Text Editor");
}
UIUnityEvents.TextSharedEnd(false, textEditor, @event);
}