ConfigArray.txt 772 B

1234567891011121314151617181920212223242526272829
  1. using System.Collections.Generic;
  2. namespace GFGGame
  3. {
  4. public partial class {CfgArrayName} : SingletonBase<{CfgArrayName}>
  5. {
  6. private Dictionary<{keyType}, {CfgName}> _cfgDic = new Dictionary<{keyType}, {CfgName}>();
  7. private {CfgName}[] _allDatas;
  8. public {CfgName} GetCfg({keyType} {keyName})
  9. {
  10. return ConfigUtil.GetCfg<{keyType}, {CfgName}>("{CfgArrayName}", "{keyName}", {keyName}, _cfgDic);
  11. }
  12. public {CfgName}[] dataArray
  13. {
  14. get
  15. {
  16. if(_allDatas == null)
  17. {
  18. _allDatas = ConfigUtil.GetAllCfgs<{CfgName}>("{CfgArrayName}");
  19. }
  20. return _allDatas;
  21. }
  22. }
  23. }
  24. }