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

Method Do

Plugins/UnLua/Source/UnLua/Private/UnLuaConsoleCommands.cpp:27–44  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

25 }
26
27 void FUnLuaConsoleCommands::Do(const TArray<FString>& Args) const
28 {
29 if (Args.Num() == 0)
30 {
31 UE_LOG(LogUnLua, Log, TEXT("usage: lua.do <your code>"));
32 return;
33 }
34
35 auto Env = Module->GetEnv();
36 if (!Env)
37 {
38 UE_LOG(LogUnLua, Warning, TEXT("no available lua env found to run code."));
39 return;
40 }
41
42 const auto Chunk = FString::Join(Args, TEXT(" "));
43 Env->DoString(Chunk);
44 }
45
46 void FUnLuaConsoleCommands::DoFile(const TArray<FString>& Args) const
47 {

Callers

nothing calls this directly

Calls 3

DoStringMethod · 0.80
NumMethod · 0.45
GetEnvMethod · 0.45

Tested by

no test coverage detected