UnitAttributeConfig.cs 3.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140
  1. //------------------------------------------------------------------------------
  2. // <auto-generated>
  3. // This code was generated by a tool.
  4. // Changes to this file may cause incorrect behavior and will be lost if
  5. // the code is regenerated.
  6. // </auto-generated>
  7. //------------------------------------------------------------------------------
  8. using Bright.Serialization;
  9. using System.Collections.Generic;
  10. using SimpleJSON;
  11. namespace ET.Editor.UnitConfig
  12. {
  13. public sealed partial class UnitAttributeConfig : Bright.Config.EditorBeanBase
  14. {
  15. public UnitAttributeConfig()
  16. {
  17. }
  18. public override void LoadJson(SimpleJSON.JSONObject _json)
  19. {
  20. {
  21. var _fieldJson = _json["Id"];
  22. if (_fieldJson != null)
  23. {
  24. if(!_fieldJson.IsNumber) { throw new SerializationException(); } Id = _fieldJson;
  25. }
  26. }
  27. {
  28. var _fieldJson = _json["HP"];
  29. if (_fieldJson != null)
  30. {
  31. if(!_fieldJson.IsNumber) { throw new SerializationException(); } HP = _fieldJson;
  32. }
  33. }
  34. {
  35. var _fieldJson = _json["MP"];
  36. if (_fieldJson != null)
  37. {
  38. if(!_fieldJson.IsNumber) { throw new SerializationException(); } MP = _fieldJson;
  39. }
  40. }
  41. {
  42. var _fieldJson = _json["Attack"];
  43. if (_fieldJson != null)
  44. {
  45. if(!_fieldJson.IsNumber) { throw new SerializationException(); } Attack = _fieldJson;
  46. }
  47. }
  48. {
  49. var _fieldJson = _json["MoveSpeed"];
  50. if (_fieldJson != null)
  51. {
  52. if(!_fieldJson.IsNumber) { throw new SerializationException(); } MoveSpeed = _fieldJson;
  53. }
  54. }
  55. {
  56. var _fieldJson = _json["AttackSpeed"];
  57. if (_fieldJson != null)
  58. {
  59. if(!_fieldJson.IsNumber) { throw new SerializationException(); } AttackSpeed = _fieldJson;
  60. }
  61. }
  62. }
  63. public override void SaveJson(SimpleJSON.JSONObject _json)
  64. {
  65. {
  66. _json["Id"] = new JSONNumber(Id);
  67. }
  68. {
  69. _json["HP"] = new JSONNumber(HP);
  70. }
  71. {
  72. _json["MP"] = new JSONNumber(MP);
  73. }
  74. {
  75. _json["Attack"] = new JSONNumber(Attack);
  76. }
  77. {
  78. _json["MoveSpeed"] = new JSONNumber(MoveSpeed);
  79. }
  80. {
  81. _json["AttackSpeed"] = new JSONNumber(AttackSpeed);
  82. }
  83. }
  84. public static UnitAttributeConfig LoadJsonUnitAttributeConfig(SimpleJSON.JSONNode _json)
  85. {
  86. UnitAttributeConfig obj = new UnitConfig.UnitAttributeConfig();
  87. obj.LoadJson((SimpleJSON.JSONObject)_json);
  88. return obj;
  89. }
  90. public static void SaveJsonUnitAttributeConfig(UnitAttributeConfig _obj, SimpleJSON.JSONNode _json)
  91. {
  92. _obj.SaveJson((SimpleJSON.JSONObject)_json);
  93. }
  94. /// <summary>
  95. /// Id
  96. /// </summary>
  97. public int Id { get; set; }
  98. /// <summary>
  99. /// 生命值
  100. /// </summary>
  101. public float HP { get; set; }
  102. /// <summary>
  103. /// 魔法值
  104. /// </summary>
  105. public float MP { get; set; }
  106. /// <summary>
  107. /// 攻击力
  108. /// </summary>
  109. public float Attack { get; set; }
  110. /// <summary>
  111. /// 移速
  112. /// </summary>
  113. public float MoveSpeed { get; set; }
  114. /// <summary>
  115. /// 攻击速度
  116. /// </summary>
  117. public float AttackSpeed { get; set; }
  118. }
  119. }