예제 #1
0
        protected bool SendMoveEventToSelectedObject()
        {
            float   unscaledTime  = Time.get_unscaledTime();
            Vector2 rawMoveVector = this.GetRawMoveVector();
            bool    flag1;

            if (Mathf.Approximately((float)rawMoveVector.x, 0.0f) && Mathf.Approximately((float)rawMoveVector.y, 0.0f))
            {
                this._consecutiveMoveCount = 0;
                flag1 = false;
            }
            else
            {
                Input instance = Singleton <Input> .Instance;
                bool  flag2    = instance.State == Input.ValidType.UI && (Singleton <Input> .IsInstance() && (instance.IsPressedHorizontal() || instance.IsPressedVertical()));
                bool  flag3    = (double)Vector2.Dot(rawMoveVector, this._lastMoveVector) > 0.0;
                if (!flag2)
                {
                    flag2 = !flag3 || this._consecutiveMoveCount != 1 ? (double)unscaledTime > (double)this._prevActionTime + 1.0 / (double)this._inputActionPerSecond : (double)unscaledTime > (double)this._prevActionTime + (double)this._repeatDelay;
                }
                bool flag4;
                if (!flag2)
                {
                    flag4 = false;
                }
                else
                {
                    AxisEventData axisEventData = ((BaseInputModule)this).GetAxisEventData((float)rawMoveVector.x, (float)rawMoveVector.y, 0.6f);
                    if (axisEventData.get_moveDir() != 4)
                    {
                        ExecuteEvents.Execute <IMoveHandler>(((BaseInputModule)this).get_eventSystem().get_currentSelectedGameObject(), (BaseEventData)axisEventData, (ExecuteEvents.EventFunction <M0>)ExecuteEvents.get_moveHandler());
                        if (!flag3)
                        {
                            this._consecutiveMoveCount = 0;
                        }
                        ++this._consecutiveMoveCount;
                        this._prevActionTime = unscaledTime;
                        this._lastMoveVector = rawMoveVector;
                    }
                    else
                    {
                        this._consecutiveMoveCount = 0;
                    }
                    flag4 = ((AbstractEventData)axisEventData).get_used();
                }
                flag1 = false;
            }
            return(flag1);
        }