-
Notifications
You must be signed in to change notification settings - Fork 594
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
Standalone Game Bind GameInstance #396
Comments
尝试了一下,把UnLuaModule.cpp里的WITH_EDITOR改成GIsEditor后就修复了Standalone模式绑定GameInstance失败的问题,同时经过测试,编辑器PIE模式以及工程打包之后运行都没有问题。我还给UnLua里加了一个UnLua::AddPackagePathAndCPathForUEPlugin(UnLua::GetState(), "UnLua");函数,方便用户自己的插件里的Content/Script目录下的lua脚本也能正常require使用。
另外,我使用的UnLua的版本是master分支的be0265a加上develop分支的cf455c8号commit |
在编辑器下运行独立模式时 绑定GameInstance 会出现绑定不上的问题
FLuaContext::PostLoadMapWithWorld(UWorld* World)
用 #if !WITH_EDITOR 判断 为什么不是 if (!GIsEditor) 运行时判断?
同时 FLuaContext::OnPostEngineInit()
#if AUTO_UNLUA_STARTUP && !WITH_EDITOR、
应改为
#if AUTO_UNLUA_STARTUP
if (!GIsEditor)
{
SetEnable(true);
}
#endif
另外 GameInstance 的绑定应该早于GameMode 为什么不在PreLoadMap 绑定GameInstance?
The text was updated successfully, but these errors were encountered: