MCPcopy Create free account
hub / github.com/Tencent/UnLua / CallLuaByFLuaTable

Method CallLuaByFLuaTable

Source/TPSProject/TutorialBlueprintFunctionLibrary.cpp:27–44  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

25}
26
27void 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
46bool CustomLoader1(UnLua::FLuaEnv& Env, const FString& RelativePath, TArray<uint8>& Data, FString& FullPath)
47{

Callers

nothing calls this directly

Calls 4

PrintScreenFunction · 0.85
checkFunction · 0.85
CallMethod · 0.80
NumMethod · 0.45

Tested by

no test coverage detected