1234567891011121314151617181920212223242526272829303132333435 |
- using UnityEngine;
- using System.Collections;
- using System.Xml;
- public class CraftConfigData
- {
- public int id;
- public string name;
- public string description;
- public int hp;
- public int attack;
- public int[] powers;
- public string model;
- public CraftConfigData(XmlNode node)
- {
- if(node == null)
- return;
- id = StringUtil.ToInt(node.Attributes["id"].Value);
- name = node.Attributes["name"].Value;
- description = node.Attributes["description"].Value;
- hp = StringUtil.ToInt(node.Attributes["hp"].Value);
- attack = StringUtil.ToInt(node.Attributes["attack"].Value);
- powers = StringUtil.SplitToInt(node.Attributes["power"].Value, '|');
- model = node.Attributes["model"].Value;
- }
- public string GetIcon()
- {
- return "Textures/CraftIcon/"+id;
- }
- }
|