Movement/IMovementExtensions.cs

20 lines
866 B
C#
Raw Normal View History

2021-12-23 12:41:01 +03:00
using UnityEngine;
namespace Syntriax.Modules.Movement
{
public static class IMovementExtensions
{
/// <summary>
/// Applies a <see cref="Vector2"/> parameter into the <see cref="IMovement"/>'s <see cref="IMovement.Move(x, y, z)"/> method by applying the vector's X and Y values accordingly
/// </summary>
2021-12-23 12:41:01 +03:00
public static void Move(this IMovement movement, Vector2 moveVector)
=> movement.Move(moveVector.x, moveVector.y);
/// <summary>
/// Applies a <see cref="Vector3"/> parameter into the <see cref="IMovement"/>'s <see cref="IMovement.Move(x, y, z)"/> method by applying the vector's X, Y and Z values accordingly
/// </summary>
2021-12-23 12:41:01 +03:00
public static void Move(this IMovement movement, Vector3 moveVector)
=> movement.Move(moveVector.x, moveVector.y, moveVector.z);
}
}