UnityEngine.EventSystems.StandaloneInputModule.SendMoveEventToSelectedObject C# (CSharp) Method

SendMoveEventToSelectedObject() protected method

Calculate and send a move event to the current selected object.

protected SendMoveEventToSelectedObject ( ) : bool
return bool
        protected bool SendMoveEventToSelectedObject()
        {
            float unscaledTime = Time.unscaledTime;
            Vector2 rawMoveVector = this.GetRawMoveVector();
            if (Mathf.Approximately(rawMoveVector.x, 0f) && Mathf.Approximately(rawMoveVector.y, 0f))
            {
                this.m_ConsecutiveMoveCount = 0;
                return false;
            }
            bool flag2 = base.input.GetButtonDown(this.m_HorizontalAxis) || base.input.GetButtonDown(this.m_VerticalAxis);
            bool flag3 = Vector2.Dot(rawMoveVector, this.m_LastMoveVector) > 0f;
            if (!flag2)
            {
                if (flag3 && (this.m_ConsecutiveMoveCount == 1))
                {
                    flag2 = unscaledTime > (this.m_PrevActionTime + this.m_RepeatDelay);
                }
                else
                {
                    flag2 = unscaledTime > (this.m_PrevActionTime + (1f / this.m_InputActionsPerSecond));
                }
            }
            if (!flag2)
            {
                return false;
            }
            AxisEventData eventData = this.GetAxisEventData(rawMoveVector.x, rawMoveVector.y, 0.6f);
            if (eventData.moveDir != MoveDirection.None)
            {
                ExecuteEvents.Execute<IMoveHandler>(base.eventSystem.currentSelectedGameObject, eventData, ExecuteEvents.moveHandler);
                if (!flag3)
                {
                    this.m_ConsecutiveMoveCount = 0;
                }
                this.m_ConsecutiveMoveCount++;
                this.m_PrevActionTime = unscaledTime;
                this.m_LastMoveVector = rawMoveVector;
            }
            else
            {
                this.m_ConsecutiveMoveCount = 0;
            }
            return eventData.used;
        }