PowerData.cs 2.0 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465
  1. using UnityEngine;
  2. using System.Collections;
  3. using System.Xml;
  4. public class PowerData
  5. {
  6. public int id;
  7. public string name;
  8. public string description;
  9. public int type;
  10. public int effect;
  11. public int crystal;
  12. public float distance;
  13. public float cd;
  14. public int numBullets;
  15. public float bulletsInterval;
  16. public int target;
  17. public string target_type;
  18. public int target_limit;
  19. public int target_sort;
  20. public float value;
  21. public int value_type;
  22. public int decay;
  23. public int buff;
  24. public int shake;
  25. public string g_effect;
  26. public string s_effect;
  27. public string g_hit;
  28. public string s_hit;
  29. public string icon;
  30. public PowerData(XmlNode node = null)
  31. {
  32. if(node == null)
  33. return;
  34. id = StringUtil.ToInt(node.Attributes["id"].Value);
  35. name = node.Attributes["name"].Value;
  36. description = node.Attributes["description"].Value;
  37. type = StringUtil.ToInt(node.Attributes["type"].Value);
  38. crystal = StringUtil.ToInt(node.Attributes["crystal"].Value);
  39. effect = StringUtil.ToInt(node.Attributes["effect"].Value);
  40. distance = StringUtil.ToFloat(node.Attributes["distance"].Value);
  41. cd = StringUtil.ToFloat(node.Attributes["cd"].Value);
  42. numBullets = StringUtil.ToInt(node.Attributes["bnum"].Value);
  43. bulletsInterval = StringUtil.ToFloat(node.Attributes["binterval"].Value);
  44. target = StringUtil.ToInt(node.Attributes["target"].Value);
  45. target_type = node.Attributes["target_type"].Value;
  46. target_limit = StringUtil.ToInt(node.Attributes["target_lim"].Value);
  47. target_sort = StringUtil.ToInt(node.Attributes["target_sort"].Value);
  48. value = StringUtil.ToFloat(node.Attributes["value"].Value);
  49. value_type = StringUtil.ToInt(node.Attributes["value_type"].Value);
  50. decay = StringUtil.ToInt(node.Attributes["decay"].Value);
  51. buff = StringUtil.ToInt(node.Attributes["buff"].Value);
  52. shake = StringUtil.ToInt(node.Attributes["shake"].Value);
  53. g_effect = node.Attributes["g_effect"].Value;
  54. s_effect = node.Attributes["s_effect"].Value;
  55. g_hit = node.Attributes["g_hit"].Value;
  56. s_hit = node.Attributes["s_hit"].Value;
  57. icon = node.Attributes["icon"].Value;
  58. }
  59. }