public PracticePveData GetConfig(uint ID) { PracticePveData practise = null; configs.TryGetValue(ID, out practise); return(practise); }
static int GetConfig(IntPtr L) { LuaScriptMgr.CheckArgsCount(L, 2); PracticePveConfig obj = (PracticePveConfig)LuaScriptMgr.GetNetObjectSelf(L, 1, "PracticePveConfig"); uint arg0 = (uint)LuaScriptMgr.GetNumber(L, 2); PracticePveData o = obj.GetConfig(arg0); LuaScriptMgr.PushObject(L, o); return(1); }
static int _CreatePracticePveData(IntPtr L) { int count = LuaDLL.lua_gettop(L); if (count == 0) { PracticePveData obj = new PracticePveData(); LuaScriptMgr.PushObject(L, obj); return(1); } else { LuaDLL.luaL_error(L, "invalid arguments to method: PracticePveData.New"); } return(0); }
static int get_gamemode(IntPtr L) { object o = LuaScriptMgr.GetLuaObject(L, 1); PracticePveData obj = (PracticePveData)o; if (obj == null) { LuaTypes types = LuaDLL.lua_type(L, 1); if (types == LuaTypes.LUA_TTABLE) { LuaDLL.luaL_error(L, "unknown member name gamemode"); } else { LuaDLL.luaL_error(L, "attempt to index gamemode on a nil value"); } } LuaScriptMgr.Push(L, obj.gamemode); return(1); }
static int set_awardpack(IntPtr L) { object o = LuaScriptMgr.GetLuaObject(L, 1); PracticePveData obj = (PracticePveData)o; if (obj == null) { LuaTypes types = LuaDLL.lua_type(L, 1); if (types == LuaTypes.LUA_TTABLE) { LuaDLL.luaL_error(L, "unknown member name awardpack"); } else { LuaDLL.luaL_error(L, "attempt to index awardpack on a nil value"); } } obj.awardpack = (uint)LuaScriptMgr.GetNumber(L, 3); return(0); }
public void ReadConfig() { if (isLoadFinish == false) { return; } isLoadFinish = false; lock (LockObject) { GameSystem.Instance.readConfigCnt += 1; } UnityEngine.Debug.Log("Config reading " + name); string text = ResourceLoadManager.Instance.GetConfigText(name); if (text == null) { UnityEngine.Debug.LogError("LoadConfig failed: " + name); return; } configs.Clear(); //读取以及处理XML文本的类 XmlDocument xmlDoc = CommonFunction.LoadXmlConfig(GlobalConst.DIR_XML_PRACTISEPVE, text); //解析xml的过程 foreach (XmlNode xe in xmlDoc.SelectSingleNode("Data").SelectNodes("Line")) { XmlNode comment = xe.SelectSingleNode(GlobalConst.CONFIG_SWITCH_COLUMN); if (comment != null && comment.InnerText == GlobalConst.CONFIG_SWITCH) { continue; } PracticePveData data = new PracticePveData(); //data.ID = uint.Parse(xe.SelectSingleNode("id").InnerText); uint.TryParse(xe.SelectSingleNode("id").InnerText, out data.ID); uint.TryParse(xe.SelectSingleNode("gamemode").InnerText, out data.gamemode); uint.TryParse(xe.SelectSingleNode("awardpack").InnerText, out data.awardpack); configs.Add(data.ID, data); } }