Example #1
0
    public override void ConstructFromXML(FairyGUI.Utils.XML xml)
    {
        base.ConstructFromXML(xml);
        _c0 = this.GetController("type");

        _p_name   = this.GetChild("PropertyName").asTextField;
        _p_loader = this.GetChild("prop").asLoader;
        _p_value  = this.GetChild("PropertyValue").asTextField;

        _propertyModify = (PropertyModify)this.GetChild("PropertyModify").asCom;

        _skill_name = this.GetChild("SkillName").asTextField;
        _plus       = this.GetChild("n14").asTextField;
        _minus      = this.GetChild("n14").asTextField;
    }
Example #2
0
    public void ReadNPCmodify()
    {
        string text = ResourceLoadManager.Instance.GetConfigText(name3);

        if (text == null)
        {
            Debug.LogError("LoadConfig failed: " + name3);
            return;
        }
        NPCmodify.Clear();
        XmlDocument xmlDoc = CommonFunction.LoadXmlConfig(GlobalConst.DIR_XML_TOURNPCMODIFY, text);
        //解析xml的过程
        XmlNodeList nodelist = xmlDoc.SelectSingleNode("Data").ChildNodes;

        foreach (XmlElement xe in nodelist)
        {
            if (CommonFunction.IsCommented(xe))
            {
                continue;
            }
            List <PropertyModify> data = new List <PropertyModify>();
            //AttrValueConfig attrData = new AttrValueConfig();
            uint level = 0;
            foreach (XmlElement xel in xe)
            {
                if (xel.Name == "switch")
                {
                    continue;
                }
                if (xel.Name == "level")
                {
                    level = uint.Parse(xel.InnerText);
                }
                else
                {
                    PropertyModify modify = new PropertyModify();
                    string[]       temp   = xel.InnerText.Split('&');
                    modify.basic   = uint.Parse(temp[0]);
                    modify.hedging = float.Parse(temp[1]);
                    data.Add(modify);
                }
            }
            NPCmodify.Add(level, data);
        }
    }