vault backup: 2026-05-03 20:37:58
This commit is contained in:
64
03-UnrealEngine/卡通渲染相关资料/渲染功能/ARC/Gameplay/UEI事件系统.md
Normal file
64
03-UnrealEngine/卡通渲染相关资料/渲染功能/ARC/Gameplay/UEI事件系统.md
Normal file
@@ -0,0 +1,64 @@
|
||||
---
|
||||
title: UEI事件系统
|
||||
date: 2026-05-03 00:00:00
|
||||
excerpt: 引擎回调接口,提供帧生命周期和输入处理钩子
|
||||
tags:
|
||||
- ARC
|
||||
- Gameplay
|
||||
- Framework
|
||||
rating: ⭐
|
||||
---
|
||||
|
||||
# UEI 事件系统
|
||||
|
||||
返回 [[Gameplay]]
|
||||
|
||||
## 概述
|
||||
|
||||
UEI(Unreal Engine Interface)事件系统提供了游戏逻辑与引擎生命周期之间的回调接口。它在引擎的关键时间点触发回调,让游戏层能精确控制帧内的执行时序。
|
||||
|
||||
## FUEIEventHandler
|
||||
|
||||
```cpp
|
||||
// UEIEventHandler.h
|
||||
class FUEIEventHandler
|
||||
{
|
||||
// 帧生命周期回调
|
||||
void BeginFrame();
|
||||
void EndFrame();
|
||||
void Update();
|
||||
|
||||
// 输入处理钩子
|
||||
// 格斗游戏需要在精确的时间点采样输入
|
||||
};
|
||||
```
|
||||
|
||||
## FUEISlateApplication
|
||||
|
||||
继承 `FSlateApplication`,扩展输入管理:
|
||||
|
||||
```cpp
|
||||
class FUEISlateApplication : public FSlateApplication
|
||||
{
|
||||
// User/Controller ID 映射
|
||||
TMap<int32, int32> UserIndexMap;
|
||||
|
||||
// 格斗游戏多手柄输入分配
|
||||
};
|
||||
```
|
||||
|
||||
格斗游戏中两个玩家可能使用不同的控制器,`UserIndexMap` 负责将物理控制器 ID 映射到游戏内的玩家 ID。
|
||||
|
||||
## 使用场景
|
||||
|
||||
- 格斗游戏帧同步:在精确的帧时间点采样输入
|
||||
- 回放系统:按帧记录和回放输入
|
||||
- 控制器热插拔处理
|
||||
|
||||
## 修改文件列表
|
||||
|
||||
| 文件 | 修改类型 |
|
||||
|------|---------|
|
||||
| `Source/Runtime/Engine/Public/UEIEventHandler.h` | **新增** |
|
||||
| `Source/Runtime/Slate/Public/Framework/Application/UEISlateApplication.h` | **新增** |
|
||||
| `Source/Runtime/Slate/Private/Framework/Application/UEISlateApplication.cpp` | **新增** |
|
||||
Reference in New Issue
Block a user