GwWuYou 339498e629 feat(GFramework.Godot): 引入 Godot 输入模块与架构锚点重构
新增 GodotInputModule 和相关输入事件类型,实现 Godot 输入系统与游戏框架的桥接。
重构架构锚点类名及其引用,统一使用 GFrameworkConstants 中定义的框架名称常量。
添加 AbstractGodotModule 基类以规范模块行为,并完善输入事件记录类定义。
2025-12-21 16:13:16 +08:00

33 lines
1.2 KiB
C#
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

using System.Numerics;
namespace GFramework.Game.input;
public static class InputEvents
{
/// <summary>
/// 按键输入事件
/// </summary>
/// <param name="Action">按键操作名称</param>
/// <param name="Pressed">按键是否被按下true表示按下false表示释放</param>
/// <param name="Echo">是否为回显事件,用于处理按键重复触发</param>
public sealed record KeyInputEvent(
string Action,
bool Pressed,
bool Echo
) : IGameInputEvent;
/// <summary>
/// 指针/鼠标输入事件
/// </summary>
/// <typeparam name="TVector2">二维向量类型</typeparam>
/// <param name="Position">指针当前位置坐标</param>
/// <param name="Delta">指针位置变化量</param>
/// <param name="Button">鼠标按键编号0表示左键1表示右键2表示中键</param>
/// <param name="Pressed">按键是否被按下true表示按下false表示释放</param>
public sealed record PointerInputEvent<TVector2>(
TVector2 Position,
TVector2 Delta,
int Button,
bool Pressed
) : IGameInputEvent where TVector2 : struct;
}