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

Function TryToSetMetatable

Plugins/UnLua/Source/UnLua/Private/LuaCore.cpp:412–419  ·  view source on GitHub ↗

* Set metatable for the userdata/table on the top of the stack */

Source from the content-addressed store, hash-verified

410 * Set metatable for the userdata/table on the top of the stack
411 */
412bool TryToSetMetatable(lua_State* L, const char* MetatableName, UObject* Object)
413{
414 const auto Registry = UnLua::FLuaEnv::FindEnvChecked(L).GetClassRegistry();
415 if (!Registry)
416 return false;
417
418 return Registry->TrySetMetatable(L, MetatableName);
419}
420
421/**
422 * Create a new userdata with padding size

Callers 3

PushPointerFunction · 0.85
NewUserdataWithPaddingFunction · 0.85
PushObjectCoreFunction · 0.85

Calls 1

TrySetMetatableMethod · 0.80

Tested by

no test coverage detected