static int GetShootGameConsume(IntPtr L) { LuaScriptMgr.CheckArgsCount(L, 2); ShootGameConfig obj = (ShootGameConfig)LuaScriptMgr.GetNetObjectSelf(L, 1, "ShootGameConfig"); uint arg0 = (uint)LuaScriptMgr.GetNumber(L, 2); ShootGameConsume o = obj.GetShootGameConsume(arg0); LuaScriptMgr.PushObject(L, o); return(1); }
public void ReadConsume() { string text = ResourceLoadManager.Instance.GetConfigText(name2); if (text == null) { Debug.LogError("LoadConfig failed: " + name2); return; } shootGameConsumes.Clear(); XmlDocument xmlDoc = CommonFunction.LoadXmlConfig(GlobalConst.DIR_XML_SHOOT_GAME_CONSUME, text); XmlNodeList nodelist = xmlDoc.SelectSingleNode("Data").ChildNodes; foreach (XmlElement xe in nodelist) { XmlNode comment = xe.SelectSingleNode(GlobalConst.CONFIG_SWITCH_COLUMN); if (comment != null && comment.InnerText == GlobalConst.CONFIG_SWITCH) { continue; } ShootGameConsume consume = new ShootGameConsume(); foreach (XmlElement xel in xe) { if (xel.Name == "buy_times") { uint.TryParse(xel.InnerText, out consume.buy_times); } else if (xel.Name == "consume_type") { uint.TryParse(xel.InnerText, out consume.consume_type); } else if (xel.Name == "consume_value") { uint.TryParse(xel.InnerText, out consume.consume_value); } } shootGameConsumes.Add(consume); } }