static int GetQualifyingConsume(IntPtr L)
    {
        LuaScriptMgr.CheckArgsCount(L, 2);
        QualifyingConfig  obj  = (QualifyingConfig)LuaScriptMgr.GetNetObjectSelf(L, 1, "QualifyingConfig");
        uint              arg0 = (uint)LuaScriptMgr.GetNumber(L, 2);
        QualifyingConsume o    = obj.GetQualifyingConsume(arg0);

        LuaScriptMgr.PushObject(L, o);
        return(1);
    }
Example #2
0
    public void ReadConsume()
    {
        string text = ResourceLoadManager.Instance.GetConfigText(name3);
        if (text == null)
        {
            Debug.LogError("LoadConfig failed: " + name3);
            return;
        }
        
        qualifyingConsumes.Clear();

        XmlDocument xmlDoc = CommonFunction.LoadXmlConfig(GlobalConst.DIR_XML_QUALIFYING_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;
            QualifyingConsume consume = new QualifyingConsume();
            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);
                }
            }

            qualifyingConsumes.Add(consume);
        } 
    }