当前位置: 首页>>代码示例>>C#>>正文


C# UnityEngine.Use方法代码示例

本文整理汇总了C#中UnityEngine.Use方法的典型用法代码示例。如果您正苦于以下问题:C# UnityEngine.Use方法的具体用法?C# UnityEngine.Use怎么用?C# UnityEngine.Use使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在UnityEngine的用法示例。


在下文中一共展示了UnityEngine.Use方法的7个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。

示例1: OnUpdateSelected

    public override void OnUpdateSelected(UnityEngine.EventSystems.BaseEventData eventData)
    {
        if (!this.isFocused)
        {
            return;
        }
        bool flag = false;
        while (Event.PopEvent (this.m_ProcessingEvent))
        {
            if (this.m_ProcessingEvent.rawType == EventType.KeyDown)
            {
                flag = true;
                InputField.EditState editState;
                if(this.m_ProcessingEvent.keyCode == KeyCode.Backspace){
                    editState = this.KeyPressed2 (this.m_ProcessingEvent);
                }else
                    editState = this.KeyPressed (this.m_ProcessingEvent);

                if (editState == InputField.EditState.Finish)
                {
                    this.DeactivateInputField ();
                    break;
                }
            }
        }
        if (flag)
        {
            this.UpdateLabel ();
        }
        eventData.Use ();
    }
开发者ID:MohHeader,项目名称:Unity_ArabicInputFieldSupport,代码行数:31,代码来源:ArabicInputField.cs

示例2: TextSharedEnd

 private static void TextSharedEnd(bool changed, TextEditor te, UnityEngine.Event @event)
 {
     if (UIUnityEvents.GetKeyboardControl())
     {
         UIUnityEvents.LateLoaded.textFieldInput = true;
     }
     if (changed || @event.type == EventType.Used)
     {
         if (UIUnityEvents.lastInput)
         {
             UIUnityEvents.textInputContent.text = te.content.text;
         }
         if (!changed)
         {
             UIUnityEvents.lastInput.CheckPositioning(te.pos, te.selectPos);
         }
         else
         {
             GUI.changed = true;
             UIUnityEvents.lastInput.CheckChanges(UIUnityEvents.textInputContent.text);
             UIUnityEvents.lastInput.CheckPositioning(te.pos, te.selectPos);
             @event.Use();
         }
     }
     if (UIUnityEvents.submit)
     {
         UIUnityEvents.submit = false;
         if (UIUnityEvents.lastInput.SendSubmitMessage())
         {
             @event.Use();
         }
     }
 }
开发者ID:HexHash,项目名称:LegacyRust,代码行数:33,代码来源:UIUnityEvents.cs

示例3: TextKeyDown

 private static void TextKeyDown(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.GetKeyboardControl())
         {
             Debug.Log(string.Concat("Did not ", @event));
             return;
         }
         bool flag = false;
         if (!UIUnityEvents.TextEditorHandleEvent(@event, textEditor))
         {
             KeyCode keyCode = @event.keyCode;
             if (keyCode == KeyCode.Tab)
             {
                 return;
             }
             if (keyCode == KeyCode.None)
             {
                 char chr = @event.character;
                 if (chr == '\t')
                 {
                     return;
                 }
                 bool flag1 = false;
                 flag1 = chr == '\n';
                 if (flag1 && !input.inputMultiline && [email protected])
                 {
                     UIUnityEvents.submit = true;
                 }
                 else if (label.font)
                 {
                     BMFont bMFont = label.font.bmFont;
                     BMFont bMFont1 = bMFont;
                     if (bMFont != null)
                     {
                         if (flag1 || chr != 0 && bMFont1.ContainsGlyph(chr))
                         {
                             textEditor.Insert(chr);
                             flag = true;
                         }
                         else if (chr == 0)
                         {
                             if (Input.compositionString.Length > 0)
                             {
                                 textEditor.ReplaceSelection(string.Empty);
                                 flag = true;
                             }
                             @event.Use();
                         }
                     }
                 }
             }
         }
         else
         {
             @event.Use();
             flag = true;
         }
         UIUnityEvents.TextSharedEnd(flag, textEditor, @event);
     }
 }
开发者ID:HexHash,项目名称:LegacyRust,代码行数:68,代码来源:UIUnityEvents.cs

示例4: 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);
     }
 }
开发者ID:HexHash,项目名称:LegacyRust,代码行数:26,代码来源:UIUnityEvents.cs

示例5: TextClickUp

 private static void TextClickUp(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)
         {
             Debug.Log(string.Concat(new object[] { "Did not match ", UIUnityEvents.controlID, " ", GUIUtility.hotControl }));
         }
         else
         {
             textEditor.MouseDragSelectsWholeWords(false);
             GUIUtility.hotControl = 0;
             @event.Use();
             UIUnityEvents.SetKeyboardControl();
         }
         UIUnityEvents.TextSharedEnd(false, textEditor, @event);
     }
 }
开发者ID:HexHash,项目名称:LegacyRust,代码行数:24,代码来源:UIUnityEvents.cs

示例6: 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);
 }
开发者ID:HexHash,项目名称:LegacyRust,代码行数:34,代码来源:UIUnityEvents.cs

示例7: onClick

 public void onClick(UnityEngine.EventSystems.BaseEventData data)
 {
     Debug.Log("ON CLICK");
     data.Use ();
 }
开发者ID:redclock,项目名称:UnityEventManager,代码行数:5,代码来源:preventTouch.cs


注:本文中的UnityEngine.Use方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。