예제 #1
0
 //static Dictionary<string,Action<string>> SkillDic_string =new Dictionary<string,Action<string>> ();
 public static void AddSkill(string _skill_name, Skill_Attribution _skill)
 {
     if (!skill_dic.ContainsKey(_skill_name))
     {
         skill_dic.Add(_skill_name, _skill);
     }
 }
예제 #2
0
    void ReadSkillInfo(WWW www)
    {
        XmlDocument xmlDoc = new XmlDocument();

        xmlDoc.LoadXml(www.text);
        XmlNode root = xmlDoc.SelectSingleNode("Skill");

        if (root != null)
        {
            XmlNodeList skill_node_list = root.ChildNodes;
            foreach (XmlNode node in skill_node_list)
            {
                Skill_Attribution temp           = new Skill_Attribution();
                XmlNodeList       cont_node_list = node.ChildNodes;
                foreach (XmlNode _node in cont_node_list)
                {
                    XmlElement xmlelement = (XmlElement)_node;
                    switch (xmlelement.GetAttribute("name"))
                    {
                    case "Rname":
                        temp.name = xmlelement.InnerText;
                        break;

                    case "cd":
                        temp.cd = float.Parse(xmlelement.InnerText);
                        break;

                    case "mp":
                        temp.mp_use = int.Parse(xmlelement.InnerText);
                        break;

                    case "damage":
                        temp.damage_des = xmlelement.InnerText;
                        break;

                    case "description":
                        temp.des = xmlelement.InnerText;
                        break;
                    }
                }
                temp.skill_level = 0;
                temp.damage      = 0;
                Skill_Register.AddSkill(temp.name, temp);
            }
        }
    }