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

Method Update

Assets/XLua/Src/ObjectTranslator.cs:1295–1315  ·  view source on GitHub ↗
(RealStatePtr L, int index, object obj)

Source from the content-addressed store, hash-verified

1293 }
1294
1295 public void Update(RealStatePtr L, int index, object obj)
1296 {
1297 int udata = LuaAPI.xlua_tocsobj_fast(L, index);
1298
1299 if (udata != -1)
1300 {
1301 objects.Replace(udata, obj);
1302 }
1303 else
1304 {
1305 UpdateCSObject update;
1306 if (custom_update_funcs.TryGetValue(obj.GetType(), out update))
1307 {
1308 update(L, index, obj);
1309 }
1310 else
1311 {
1312 throw new Exception("can not update [" + obj + "]");
1313 }
1314 }
1315 }
1316
1317 private object getCsObj(RealStatePtr L, int index, int udata)
1318 {

Callers 2

CallMethod · 0.45
genFieldSetterMethod · 0.45

Calls 3

xlua_tocsobj_fastMethod · 0.80
TryGetValueMethod · 0.80
ReplaceMethod · 0.45

Tested by

no test coverage detected