Newer
Older
DungeonShooting / DungeonShooting_Godot / src / config / ExcelConfig_ActivityObject.cs
@小李xl 小李xl on 27 Jun 2023 1 KB 修复武器抛壳问题
  1. using System.Text.Json.Serialization;
  2. using System.Collections.Generic;
  3.  
  4. namespace Config;
  5.  
  6. public static partial class ExcelConfig
  7. {
  8. public class ActivityObject
  9. {
  10. /// <summary>
  11. /// 物体唯一id <br/>
  12. /// 需要添加类型前缀
  13. /// </summary>
  14. [JsonInclude]
  15. public string Id;
  16.  
  17. /// <summary>
  18. /// Test(测试对象): 2 <br/>
  19. /// Role(角色): 3 <br/>
  20. /// Enemy(敌人): 4 <br/>
  21. /// Weapon(武器): 5 <br/>
  22. /// Bullet(子弹): 6 <br/>
  23. /// Shell(弹壳): 7 <br/>
  24. /// Effect(特效): 8 <br/>
  25. /// Prop(道具): 9 <br/>
  26. /// Other(其它类型): 99
  27. /// </summary>
  28. [JsonInclude]
  29. public int Type;
  30.  
  31. /// <summary>
  32. /// 物体名称
  33. /// </summary>
  34. [JsonInclude]
  35. public string Name;
  36.  
  37. /// <summary>
  38. /// 物体备注
  39. /// </summary>
  40. [JsonInclude]
  41. public string Remark;
  42.  
  43. /// <summary>
  44. /// 物体预制场景路径, 场景根节点必须是ActivityObject子类
  45. /// </summary>
  46. [JsonInclude]
  47. public string Prefab;
  48.  
  49. /// <summary>
  50. /// 返回浅拷贝出的新对象
  51. /// </summary>
  52. public ActivityObject Clone()
  53. {
  54. var inst = new ActivityObject();
  55. inst.Id = Id;
  56. inst.Type = Type;
  57. inst.Name = Name;
  58. inst.Remark = Remark;
  59. inst.Prefab = Prefab;
  60. return inst;
  61. }
  62. }
  63. }