Survivalcraft API 1.8.2.3 v1.8.2.3
Survivalcraft 2.4
载入中...
搜索中...
未找到
InputBuffer.cs
浏览该文件的文档.
1using System.Runtime.InteropServices;
2
3namespace Engine.Browser {
4 [StructLayout(LayoutKind.Sequential)]
5 public unsafe struct InputBuffer {
6 // --- 状态快照区 (State Snapshot) ---
7 public float CanvasWidth;
8 public float CanvasHeight;
9 public float DevicePixelRatio;
10 public int Padding; // 确保 Buffer0 从 8 字节边界开始,优化 64 位对齐
11
12 public float MousePositionX;
13 public float MousePositionY;
14
15 // 手柄摇杆状态 (4 Gamepads * 4 Axes * 4 bytes = 64 bytes)
16 public fixed float GamepadAxes[16];
17
18 // 手柄扳机状态 (4 Gamepads * 2 Triggers * 4 bytes = 32 bytes)
19 public fixed float GamepadTriggers[8];
20
21 // --- 事件流控制 ---
22 public int UsedBytes; // 当前缓冲区已写入的事件字节数
23
24 // --- 事件流数据区 ---
25 public fixed byte EventData[4096];
26 }
27}
unsafe
定义 Main.cs:15