Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
3 tasks done
lzj10 opened this issue Dec 20, 2023 · 5 comments
Open
3 tasks done
Assignees
Labels
bug Something isn't working Unreal

Comments

@lzj10
Copy link
Contributor

lzj10 commented Dec 20, 2023

前置阅读 | 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 lzj10 added bug Something isn't working Unreal labels Dec 20, 2023
@lzj10 lzj10 changed the title [UE] Bug: asynclode的继承Actor类,没办法重写ReceiveBeginPlay [UE] Bug: 异步加载的继承Actor类,没办法重写ReceiveBeginPlay Dec 20, 2023
@lzj10
Copy link
Contributor Author

lzj10 commented Dec 20, 2023

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

@chexiongsheng
Copy link
Collaborator

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

@chexiongsheng
Copy link
Collaborator

你是开启了AsyncLoadingThreadEnabled?

@lzj10
Copy link
Contributor Author

lzj10 commented Dec 26, 2023

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

@lzj10
Copy link
Contributor Author

lzj10 commented Dec 26, 2023

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

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working Unreal
Projects
None yet
Development

No branches or pull requests

2 participants