UnityEngine.EventSystems.BaseInputModule.DetermineMoveDirection C# (CSharp) Method

DetermineMoveDirection() protected static method

Given an input movement, determine the best MoveDirection.

protected static DetermineMoveDirection ( float x, float y ) : MoveDirection
x float X movement.
y float Y movement.
return MoveDirection
        protected static MoveDirection DetermineMoveDirection(float x, float y)
        {
            return DetermineMoveDirection(x, y, 0.6f);
        }

Same methods

BaseInputModule::DetermineMoveDirection ( float x, float y, float deadZone ) : MoveDirection

Usage Example

コード例 #1
0
 /// <summary>
 ///
 /// <para>
 /// Given some input data generate an AxisEventData that can be used by the event system.
 /// </para>
 ///
 /// </summary>
 /// <param name="x">X movement.</param><param name="y">Y movement.</param><param name="moveDeadZone">Dead Zone.</param>
 protected virtual AxisEventData GetAxisEventData(float x, float y, float moveDeadZone)
 {
     if (this.m_AxisEventData == null)
     {
         this.m_AxisEventData = new AxisEventData(this.eventSystem);
     }
     this.m_AxisEventData.Reset();
     this.m_AxisEventData.moveVector = new Vector2(x, y);
     this.m_AxisEventData.moveDir    = BaseInputModule.DetermineMoveDirection(x, y, moveDeadZone);
     return(this.m_AxisEventData);
 }
All Usage Examples Of UnityEngine.EventSystems.BaseInputModule::DetermineMoveDirection