| 25 | } |
| 26 | |
| 27 | void UTutorialBlueprintFunctionLibrary::CallLuaByFLuaTable() |
| 28 | { |
| 29 | PrintScreen(TEXT("[C++]CallLuaByFLuaTable 开始")); |
| 30 | UnLua::FLuaEnv Env; |
| 31 | |
| 32 | const auto Require = UnLua::FLuaFunction(&Env, "_G", "require"); |
| 33 | const auto RetValues1 = Require.Call("Tutorials.08_CppCallLua"); |
| 34 | check(RetValues1.Num() == 2); |
| 35 | |
| 36 | const auto RetValue = RetValues1[0]; |
| 37 | const auto LuaTable = UnLua::FLuaTable(&Env, RetValue); |
| 38 | const auto RetValues2 = LuaTable.Call("CallMe", 3.3f, 4.4f); |
| 39 | check(RetValues2.Num() == 1); |
| 40 | |
| 41 | const auto Msg = FString::Printf(TEXT("[C++]收到来自Lua的返回,结果=%f"), RetValues2[0].Value<float>()); |
| 42 | PrintScreen(Msg); |
| 43 | PrintScreen(TEXT("[C++]CallLuaByFLuaTable 结束")); |
| 44 | } |
| 45 | |
| 46 | bool CustomLoader1(UnLua::FLuaEnv& Env, const FString& RelativePath, TArray<uint8>& Data, FString& FullPath) |
| 47 | { |
nothing calls this directly
no test coverage detected