Movement/Runtime/IMovementControllerExtensio...

20 lines
806 B
C#

using UnityEngine;
namespace Syntriax.Modules.Movement
{
public static class IMovementControllerExtensions
{
/// <summary>
/// Calls <see cref="IMovementController.Move"/> with a <see cref="Vector2"/>'s values accordingly, leaving the z parameter 0
/// </summary>
public static void Move(this IMovementController movementController, Vector2 moveVector)
=> movementController.Move(moveVector.x, moveVector.y, 0f);
/// <summary>
/// Calls <see cref="IMovementController.Move"/> with a <see cref="Vector3"/>'s values accordingly
/// </summary>
public static void Move(this IMovementController movementController, Vector3 moveVector)
=> movementController.Move(moveVector.x, moveVector.y, moveVector.z);
}
}