csharp_const.gtpl 1.2 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849
  1. // Code generated by excel export. DO NOT EDIT.
  2. using System;
  3. using ProtoBuf;
  4. using System.Collections.Generic;
  5. using Newtonsoft.Json;
  6. using GameConfig.ConfigBase;
  7. #if UNITY_2017_1_OR_NEWER
  8. using UnityEngine;
  9. #elif BattleServer
  10. using UnityEngineCompatible;
  11. #endif
  12. #pragma warning disable CS0169
  13. namespace GameConfig.ConfigGen
  14. {
  15. [ProtoContract]
  16. public sealed partial class {{ .ClassName }} : ASerialize, IConfigTable, IProto
  17. {
  18. {{- range .ClassFields }}
  19. [ProtoMember({{ .ID }})]
  20. [JsonProperty("{{ .Name }}")]
  21. {{- if .Attr }}
  22. {{ .Attr }}
  23. {{- end }}
  24. public {{ .Type }} {{ .CapsName }} { get; set; } // {{ .Desc }}
  25. {{- end }}
  26. private static {{ .ClassName }} s_instance = null;
  27. public static {{ .ClassName }} Instance
  28. {
  29. get {
  30. if (s_instance == null)
  31. {
  32. s_instance = ConfigTableHelper.Load<{{ .ClassName }}>();
  33. }
  34. return s_instance;
  35. }
  36. private set => s_instance = value;
  37. }
  38. public override void Dispose()
  39. {
  40. s_instance = null;
  41. }
  42. }
  43. }