static int Get(IntPtr L) { try { int count = LuaDLL.lua_gettop(L); if (count == 0) { System.Collections.Generic.Dictionary <int, Config.ConfigObj.IconConfig> o = Config.ConfigObj.IconConfig.Get(); ToLua.PushSealed(L, o); return(1); } else if (count == 1) { int arg0 = (int)LuaDLL.luaL_checknumber(L, 1); Config.ConfigObj.IconConfig o = Config.ConfigObj.IconConfig.Get(arg0); ToLua.PushObject(L, o); return(1); } else { return(LuaDLL.luaL_throw(L, "invalid arguments to method: Config.ConfigObj.IconConfig.Get")); } } catch (Exception e) { return(LuaDLL.toluaL_exception(L, e)); } }
static int get_Id(IntPtr L) { object o = null; try { o = ToLua.ToObject(L, 1); Config.ConfigObj.IconConfig obj = (Config.ConfigObj.IconConfig)o; int ret = obj.Id; LuaDLL.lua_pushinteger(L, ret); return(1); } catch (Exception e) { return(LuaDLL.toluaL_exception(L, e, o, "attempt to index Id on a nil value")); } }
static int set_ShopIDList(IntPtr L) { object o = null; try { o = ToLua.ToObject(L, 1); Config.ConfigObj.IconConfig obj = (Config.ConfigObj.IconConfig)o; System.Collections.Generic.List <int> arg0 = (System.Collections.Generic.List <int>)ToLua.CheckObject(L, 2, typeof(System.Collections.Generic.List <int>)); obj.ShopIDList = arg0; return(0); } catch (Exception e) { return(LuaDLL.toluaL_exception(L, e, o, "attempt to index ShopIDList on a nil value")); } }
static int set_Key(IntPtr L) { object o = null; try { o = ToLua.ToObject(L, 1); Config.ConfigObj.IconConfig obj = (Config.ConfigObj.IconConfig)o; string arg0 = ToLua.CheckString(L, 2); obj.Key = arg0; return(0); } catch (Exception e) { return(LuaDLL.toluaL_exception(L, e, o, "attempt to index Key on a nil value")); } }
static int set_Id(IntPtr L) { object o = null; try { o = ToLua.ToObject(L, 1); Config.ConfigObj.IconConfig obj = (Config.ConfigObj.IconConfig)o; int arg0 = (int)LuaDLL.luaL_checknumber(L, 2); obj.Id = arg0; return(0); } catch (Exception e) { return(LuaDLL.toluaL_exception(L, e, o, "attempt to index Id on a nil value")); } }
static int get_ShopIDList(IntPtr L) { object o = null; try { o = ToLua.ToObject(L, 1); Config.ConfigObj.IconConfig obj = (Config.ConfigObj.IconConfig)o; System.Collections.Generic.List <int> ret = obj.ShopIDList; ToLua.PushSealed(L, ret); return(1); } catch (Exception e) { return(LuaDLL.toluaL_exception(L, e, o, "attempt to index ShopIDList on a nil value")); } }
static int get_Key(IntPtr L) { object o = null; try { o = ToLua.ToObject(L, 1); Config.ConfigObj.IconConfig obj = (Config.ConfigObj.IconConfig)o; string ret = obj.Key; LuaDLL.lua_pushstring(L, ret); return(1); } catch (Exception e) { return(LuaDLL.toluaL_exception(L, e, o, "attempt to index Key on a nil value")); } }
static public void Parse(TextAsset xmlAsset) { //XmlDocument doc = CommonUtil.LoadXML(xmlAsset); XmlDocument doc = new XmlDocument(); doc.LoadXml(xmlAsset.text); XmlNode node = doc.SelectSingleNode("Config"); Dictionary = new Dictionary <int, IconConfig>(); if (node != null) { XmlNodeList nodeList = node.ChildNodes; if (nodeList != null && nodeList.Count > 0) { foreach (XmlElement el in nodeList) { IconConfig config = new IconConfig(); config.Id = int.Parse(el.GetAttribute("Id")); config.Key = el.GetAttribute("Key"); if (!string.IsNullOrEmpty(el.GetAttribute("ShopId"))) { string str = el.GetAttribute("ShopId"); string[] list = str.Split(','); foreach (string s in list) { config.ShopIDList.Add(int.Parse(s)); } } Dictionary.Add(config.Id, config); //Debug.Log(" --->> key : " + config.Id + " Value: " + config.Key); } } } }
static int _CreateConfig_ConfigObj_IconConfig(IntPtr L) { try { int count = LuaDLL.lua_gettop(L); if (count == 0) { Config.ConfigObj.IconConfig obj = new Config.ConfigObj.IconConfig(); ToLua.PushObject(L, obj); return(1); } else { return(LuaDLL.luaL_throw(L, "invalid arguments to ctor method: Config.ConfigObj.IconConfig.New")); } } catch (Exception e) { return(LuaDLL.toluaL_exception(L, e)); } }