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


C# BaseEventData.Use方法代码示例

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


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

示例1: OnUpdateSelected

        public override void OnUpdateSelected(BaseEventData eventData)
        {
            if (!isFocused)
                return;

            bool consumedEvent = false;
            while (Event.PopEvent(m_ProcessingEvent))
            {
                if (m_ProcessingEvent.rawType == EventType.KeyDown)
                {
                    if (!IsAllowedCombination(m_ProcessingEvent))
                    {
                        OnCharEntered(this, new EventArgs());
                        continue;
                    }

                    consumedEvent = true;                    

                    var shouldContinue = KeyPressed(m_ProcessingEvent);
                    if (shouldContinue == EditState.Finish)
                    {
                        DeactivateInputField();
                        break;
                    }
                }
            }

            if (consumedEvent)
            {
                UpdateLabel();
            }

            eventData.Use();
        }
开发者ID:drussilla,项目名称:ConsoleX,代码行数:34,代码来源:ReadOnlyInputField.cs

示例2: OnUpdateSelected

        public override void OnUpdateSelected(BaseEventData eventData)
        {
            if (!isFocused)
                return;

            bool consumedEvent = false;
            while (Event.PopEvent(m_ProcessingEvent))
            {
                if (m_ProcessingEvent.rawType == EventType.KeyDown)
                {
                    if (ProcessKeyPress(m_ProcessingEvent))
                    {
                        continue;
                    }
                    consumedEvent = true;
                    
                    var shouldContinue = KeyPressed(m_ProcessingEvent);
                    if (shouldContinue == EditState.Finish)
                    {
                        DeactivateInputField();
                        break;
                    }
                }
            }

            if (consumedEvent)
                UpdateLabel();

            eventData.Use();
        }
开发者ID:drussilla,项目名称:ConsoleX,代码行数:30,代码来源:CommandPrompt.cs

示例3: OnUpdateSelected

    public override void OnUpdateSelected(BaseEventData eventData)
    {
        if (!this.isFocused) {
            return;
        }

        bool consumedEvent = false;
        while (Event.PopEvent(processEvent)) {
            if (processEvent.rawType == EventType.KeyDown) {
                if (!CombinationPressed(processEvent)) {
                    continue;
                }
                consumedEvent = true;
                EditState state = this.KeyPressed(processEvent);
                if (state == EditState.Finish) {
                    DeactivateInputField();
                }
                break;
            }
        }

        if (consumedEvent) {
            this.UpdateLabel();
        }

        eventData.Use();
    }
开发者ID:tommai78101,项目名称:Multiplier,代码行数:27,代码来源:ReadOnlyInputField.cs

示例4: OnUpdateSelected

        // To change default behavior and to support multiple gui,
        // override InputFiled method here.
        public override void OnUpdateSelected(BaseEventData eventData)
        {
            if (!isFocused) return;

            // To support multiple gui, set the window that this input filed is belonging to
            // as the current active window.
            Window.selected = parentWindow;

            bool consumedEvent = false;
            var e = new Event();
            while (Event.PopEvent(e)) {
            if (e.rawType == EventType.KeyDown) {
                consumedEvent = true;

                // Skip because these keys are used for histroy selection in single-line mode
                // and for move cursor manually in multi-line mode.
                switch (e.keyCode) {
                    case KeyCode.UpArrow:
                    case KeyCode.DownArrow:
                        continue;
                }

                // Skip if completion view is open.
                if (parentWindow.hasCompletion) {
                    if (e.keyCode == KeyCode.Tab || KeyUtil.Enter()) {
                        break;
                    }
                }

                var shouldContinue = KeyPressed(e);

                // Prevent finish.
                // Command submission and cancel are observed and handled in Core.
                switch (e.keyCode) {
                    case KeyCode.Return:
                    case KeyCode.KeypadEnter:
                    case KeyCode.Escape:
                        shouldContinue = EditState.Continue;
                        break;
                }

                if (shouldContinue == EditState.Finish) {
                    DeactivateInputField();
                    break;
                }
            }
            }

            if (consumedEvent) {
            UpdateLabel();
            }

            eventData.Use();
        }
开发者ID:hecomi,项目名称:uREPL,代码行数:56,代码来源:CommandInputField.cs


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