UnitResConfig.cs 2.0 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879
  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 UnitResConfig : Bright.Config.EditorBeanBase
  14. {
  15. public UnitResConfig()
  16. {
  17. PrefabName = "";
  18. }
  19. public override void LoadJson(SimpleJSON.JSONObject _json)
  20. {
  21. {
  22. var _fieldJson = _json["Id"];
  23. if (_fieldJson != null)
  24. {
  25. if(!_fieldJson.IsNumber) { throw new SerializationException(); } Id = _fieldJson;
  26. }
  27. }
  28. {
  29. var _fieldJson = _json["PrefabName"];
  30. if (_fieldJson != null)
  31. {
  32. if(!_fieldJson.IsString) { throw new SerializationException(); } PrefabName = _fieldJson;
  33. }
  34. }
  35. }
  36. public override void SaveJson(SimpleJSON.JSONObject _json)
  37. {
  38. {
  39. _json["Id"] = new JSONNumber(Id);
  40. }
  41. {
  42. if (PrefabName == null) { throw new System.ArgumentNullException(); }
  43. _json["PrefabName"] = new JSONString(PrefabName);
  44. }
  45. }
  46. public static UnitResConfig LoadJsonUnitResConfig(SimpleJSON.JSONNode _json)
  47. {
  48. UnitResConfig obj = new UnitConfig.UnitResConfig();
  49. obj.LoadJson((SimpleJSON.JSONObject)_json);
  50. return obj;
  51. }
  52. public static void SaveJsonUnitResConfig(UnitResConfig _obj, SimpleJSON.JSONNode _json)
  53. {
  54. _obj.SaveJson((SimpleJSON.JSONObject)_json);
  55. }
  56. /// <summary>
  57. /// Id
  58. /// </summary>
  59. public int Id { get; set; }
  60. /// <summary>
  61. /// Prefab名
  62. /// </summary>
  63. public string PrefabName { get; set; }
  64. }
  65. }