MCPcopy Create free account
hub / github.com/Tencent/xLua / PushObject

Method PushObject

Assets/XLua/Src/ObjectTranslator.cs:1273–1293  ·  view source on GitHub ↗
(RealStatePtr L, object o, int type_id)

Source from the content-addressed store, hash-verified

1271 }
1272
1273 public void PushObject(RealStatePtr L, object o, int type_id)
1274 {
1275 if (o == null)
1276 {
1277 LuaAPI.lua_pushnil(L);
1278 return;
1279 }
1280
1281 int index = -1;
1282 if (reverseMap.TryGetValue(o, out index))
1283 {
1284 if (LuaAPI.xlua_tryget_cachedud(L, index, cacheRef) == 1)
1285 {
1286 return;
1287 }
1288 }
1289
1290 index = addObject(o, false, false);
1291
1292 LuaAPI.xlua_pushcsobj(L, index, type_id, true, cacheRef);
1293 }
1294
1295 public void Update(RealStatePtr L, int index, object obj)
1296 {

Callers

nothing calls this directly

Calls 4

lua_pushnilMethod · 0.80
TryGetValueMethod · 0.80
xlua_tryget_cachedudMethod · 0.80
xlua_pushcsobjMethod · 0.80

Tested by

no test coverage detected