RegisterCallFunctionByNameWithArgumentsPreHook
注册一个回调,在调用 UObject::CallFunctionByNameWithArguments 前执行。
除字符串、布尔值和 FOutputDevice 外,参数必须通过 Param:Get() 读取,通过 Param:Set() 设置。
如果回调不返回任何值(或返回 nil),则使用 CallFunctionByNameWithArguments 的原返回值。
如果回调返回 true 或 false,该值会覆盖 CallFunctionByNameWithArguments 的原返回值。
参数
| # | 类型 | 说明 |
|---|---|---|
| 1 | function | 要注册的回调 |
回调参数
| # | 类型 | 说明 |
|---|---|---|
| 1 | UObject | 对象上下文 |
| 2 | string | 字符串 |
| 3 | FOutputDevice | AR 输出设备 |
| 4 | UObject | 执行者 |
| 5 | bool | bForceCallWithNonExec 的值 |
回调返回值
| # | 类型 | 说明 |
|---|---|---|
| 1 | bool | 是否覆盖 CallFunctionByNameWithArguments 的原返回值 |
示例
local function MyCallback(Context, Str, Ar, Executor, bForceCallWithNonExec)
-- Do something with the parameters
-- Return nil to use the original return value of CallFunctionByNameWithArguments
-- Return true or false to override the original return value of CallFunctionByNameWithArguments
return nil
end
RegisterCallFunctionByNameWithArgumentsPreHook(MyCallback)
原文:docs/lua-api/global-functions/registercallfunctionbynamewithargumentsprehook.md · 固定提交 560411f18512 · 来源与 MIT 许可