CraftConfigData.cs 764 B

1234567891011121314151617181920212223242526272829303132333435
  1. using UnityEngine;
  2. using System.Collections;
  3. using System.Xml;
  4. public class CraftConfigData
  5. {
  6. public int id;
  7. public string name;
  8. public string description;
  9. public int hp;
  10. public int attack;
  11. public int[] powers;
  12. public string model;
  13. public CraftConfigData(XmlNode node)
  14. {
  15. if(node == null)
  16. return;
  17. id = StringUtil.ToInt(node.Attributes["id"].Value);
  18. name = node.Attributes["name"].Value;
  19. description = node.Attributes["description"].Value;
  20. hp = StringUtil.ToInt(node.Attributes["hp"].Value);
  21. attack = StringUtil.ToInt(node.Attributes["attack"].Value);
  22. powers = StringUtil.SplitToInt(node.Attributes["power"].Value, '|');
  23. model = node.Attributes["model"].Value;
  24. }
  25. public string GetIcon()
  26. {
  27. return "Textures/CraftIcon/"+id;
  28. }
  29. }