/// <summary> /// Interpreta un gesto reconocido /// </summary> /// <param name="id">Nombre del gesto</param> public void GestureDetection(GesturesID id) { switch (id) { case GesturesID.SwipeUp: Player.OnInputDetection(InputID.Jump); break; case GesturesID.SwipeDown: Player.OnInputDetection(InputID.Crouch); break; case GesturesID.SwipeLeft: Player.OnInputDetection(InputID.Left); break; case GesturesID.SwipeRight: Player.OnInputDetection(InputID.Right); break; } }
/// <summary> /// Constructor /// </summary> /// <param name="minDistance">Minima distancia que debe cubrir el gesto</param> /// <param name="error">Error maximo aceptado</param> /// <param name="maxTime">Tiempo maximo de espera por el gesto</param> /// <param name="ID">ID del gesto</param> public Gesture(float minDistance = 20.0f, float error = 75.0f, float maxTime = 10.0f, GesturesID ID = GesturesID.None) { MinDistance = minDistance; Error = error * Mathf.Deg2Rad; MaxTime = maxTime; Clear(); }