puerts icon indicating copy to clipboard operation
puerts copied to clipboard

[UE] Bug: 异步加载的继承Actor类,没办法重写ReceiveBeginPlay

Open lzj10 opened this issue 1 year ago • 5 comments

前置阅读 | Pre-reading

Puer的版本 | Puer Version

master 5409d2a

UE的版本 | UE Version

5.2

发生在哪个平台 | Platform

win

错误信息 | Error Message

异步加载的Actor,ReceiveBeginPlay,ReceiveEndPlay 无法重写,因为这两个函数是protected的

问题重现 | Bug reproduce

打包后,某些继承引擎的Actor摆放到场景中通过异步加载的时候没有走到TsConstruct,然后在下面重定向UFunction的时候由于ReceiveBeginPlay和ReceiveEndPlay 是protected的所以没有绑定成功 image image image

lzj10 avatar Dec 20 '23 09:12 lzj10

尝试在异步加载的时候把UTypeScriptGeneratedClass::execLazyLoadCallJS加入NativeFunction,但是面临了新的问题。 在execLazyLoadCallJS中调用了PinedDynamicInvoker->NotifyReBind(Class),导致NativeFunctionLookupTable中的函数存在两份,因为ObjectInitialize加入了一份,RedirectToTypeScript中又加入了一份 同名的两个结构一个指向了execLazyLoadCallJS,一个指向了execCallJS 91b3d769f8bd1ff5e2dbb32aa0f7602

lzj10 avatar Dec 20 '23 12:12 lzj10

ReceiveBeginPlay我一直都作为基础例子来演示的,可以的啊,异步加载会导致方法变成protected?

chexiongsheng avatar Dec 26 '23 02:12 chexiongsheng

你是开启了AsyncLoadingThreadEnabled?

chexiongsheng avatar Dec 26 '23 02:12 chexiongsheng

AsyncLoadingThreadEnabled是开启的,我看之前不是说支持了么

lzj10 avatar Dec 26 '23 03:12 lzj10

ReceiveBeginPlay我一直都作为基础例子来演示的,可以的啊,异步加载会导致方法变成protected?

Actor的这几个函数本来就是protected的

lzj10 avatar Dec 26 '23 03:12 lzj10