mirror of
https://gitlab.com/MaddoScientisto/cirnogodot.git
synced 2026-06-01 11:15:33 +00:00
34 lines
No EOL
773 B
C#
34 lines
No EOL
773 B
C#
using Godot;
|
|
|
|
namespace Cirno.Scripts.Components.Actors;
|
|
|
|
public partial class KeyboardInputProvider : InputProvider
|
|
{
|
|
public override Vector2 GetMovementInput()
|
|
{
|
|
return Input.GetVector("left", "right", "up", "down");
|
|
}
|
|
|
|
public override Vector2 GetAimInput()
|
|
{
|
|
return GetRightStickInput();
|
|
}
|
|
|
|
private Vector2 GetRightStickInput()
|
|
{
|
|
return new Vector2(
|
|
Input.GetAxis("aim_left","aim_right"),
|
|
Input.GetAxis("aim_up", "aim_down")
|
|
);
|
|
}
|
|
|
|
public override bool GetActionJustPressed(string action)
|
|
{
|
|
return Input.IsActionJustPressed(action);
|
|
}
|
|
|
|
public override bool GetActionPressed(string action)
|
|
{
|
|
return Input.IsActionPressed(action);
|
|
}
|
|
} |