mirror of
https://github.com/ConjureETS/Unity_Utils.git
synced 2026-03-23 20:40:58 +00:00
12 lines
431 B
C#
12 lines
431 B
C#
using UnityEngine;
|
|
using UnityEngine.InputSystem;
|
|
|
|
namespace JohnsonUtils.Utilities
|
|
{
|
|
public static class InputActionExtensions
|
|
{
|
|
public static bool ReadBool(this InputAction action) => action.ReadValue<float>() != 0;
|
|
public static float ReadFloat(this InputAction action) => action.ReadValue<float>();
|
|
public static Vector2 ReadV2(this InputAction action) => action.ReadValue<Vector2>();
|
|
}
|
|
} |