Skip to content

Commit a4d9b1b

Browse files
修改:使用WITH_EDITOR宏包一下对蓝图recompile的处理
1 parent 2714757 commit a4d9b1b

2 files changed

Lines changed: 7 additions & 0 deletions

File tree

CHANGELOG.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@ and this project adheres to [Semantic Versioning](http://semver.org/).
1616
- 同一个Lua函数绑定多个不同签名的代理导致崩溃 [#660](https://github.com/Tencent/UnLua/pull/660)
1717
- 应该支持从L构造FLuaValue类型 [#666](https://github.com/Tencent/UnLua/issue/666)
1818
- 特定情况下在Lua中调用TArray的Add接口时内存对齐引起的问题 [#668](https://github.com/Tencent/UnLua/issue/668)
19+
- 兼容蓝图Recompile导致FuncMap被清空的情况 [#669](https://github.com/Tencent/UnLua/issue/669)
1920
- 清理一些UE5下的编译警告
2021

2122
### Changed

Plugins/UnLua/Source/UnLua/Private/UnLuaManager.cpp

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -259,11 +259,15 @@ bool UUnLuaManager::BindClass(UClass* Class, const FString& InModuleName, FStrin
259259

260260
if (Classes.Contains(Class))
261261
{
262+
#if WITH_EDITOR
262263
// 兼容蓝图Recompile导致FuncMap被清空的情况
263264
if (Class->FindFunctionByName("__UClassBindSucceeded", EIncludeSuperFlag::Type::ExcludeSuper))
264265
return true;
265266

266267
ULuaFunction::RestoreOverrides(Class);
268+
#else
269+
return true;
270+
#endif
267271
}
268272

269273
const auto L = Env->GetMainState();
@@ -325,6 +329,7 @@ bool UUnLuaManager::BindClass(UClass* Class, const FString& InModuleName, FStrin
325329
}
326330
}
327331

332+
#if WITH_EDITOR
328333
// 兼容蓝图Recompile导致FuncMap被清空的情况
329334
for (const auto& Iter : BindInfo.UEFunctions)
330335
{
@@ -336,6 +341,7 @@ bool UUnLuaManager::BindClass(UClass* Class, const FString& InModuleName, FStrin
336341
break;
337342
}
338343
}
344+
#endif
339345

340346
if (auto BPGC = Cast<UBlueprintGeneratedClass>(Class))
341347
{

0 commit comments

Comments
 (0)