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

GameInstance的M:Initialize(Initializer)函数会被调用两次 #326

Closed
dawnarc opened this issue Jan 5, 2022 · 2 comments
Closed

GameInstance的M:Initialize(Initializer)函数会被调用两次 #326

dawnarc opened this issue Jan 5, 2022 · 2 comments
Labels
bug Something isn't working

Comments

@dawnarc
Copy link

dawnarc commented Jan 5, 2022

测试环境
Windows 10 21H1
UE4.26.2
Unlua 2.1.1

复现步骤:
1,新建蓝图继承自GameInstance

image

image

image

2, 添加GameInstance的lua测试代码:

image

3, 清空World Settings中的GameMode选项,并在Project Settings中设置新建的GameInstance

image

image

4, 运行游戏,会发现Initialize(Initializer)执行了两次

image

@xuyanghuang-tencent xuyanghuang-tencent added bug Something isn't working pending release This will be released on next version labels Jan 7, 2022
@xuyanghuang-tencent
Copy link
Collaborator

的确在编辑器下会有这个问题,其实就是PIE的时候重复绑定了GameInstance,但不影响真机。

@xuyanghuang-tencent xuyanghuang-tencent removed the pending release This will be released on next version label Nov 7, 2023
@yeheiGame
Copy link

发现打包成windows exe执行时 GameMode 要比GameInstance 先加载为啥呢
Uploading gamemode.png…

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

No branches or pull requests

3 participants