EnumLabelAttribute.cs 692 B

1234567891011121314151617181920212223242526272829303132333435
  1. #if !COMBAT_SERVER
  2. using UnityEngine;
  3. using System;
  4. [AttributeUsage(AttributeTargets.Enum | AttributeTargets.Field)]
  5. public class EnumLabelAttribute : PropertyAttribute
  6. {
  7. /// <summary>
  8. /// 注释
  9. /// </summary>
  10. public string label;
  11. public new int[] order = new int[0];
  12. /// <summary>
  13. /// 数据
  14. /// </summary>
  15. public string data = "";
  16. public EnumLabelAttribute(string label, string data = "")
  17. {
  18. this.label = label;
  19. this.data = data;
  20. }
  21. public EnumLabelAttribute(string label, string data = "", params int[] order)
  22. {
  23. this.label = label;
  24. this.order = order;
  25. this.data = data;
  26. }
  27. }
  28. #endif