StoryCfgManager.cs 1.1 KB

1234567891011121314151617181920212223242526272829303132333435363738394041
  1. using System.Collections.Generic;
  2. namespace GFGGame
  3. {
  4. public class StoryCfgManager : SingletonBase<StoryCfgManager>
  5. {
  6. private List<StoryChapterCfg> _commonCfgs;
  7. private List<StoryChapterCfg> _hardCfgs;
  8. public StoryCfgManager()
  9. {
  10. _commonCfgs = new List<StoryChapterCfg>();
  11. _hardCfgs = new List<StoryChapterCfg>();
  12. StoryChapterCfg[] dataArray = StoryChapterCfgArray.Instance.dataArray;
  13. foreach(StoryChapterCfg cfg in dataArray)
  14. {
  15. if(StoryUtil.CheckChapterIsHard(cfg.id))
  16. {
  17. _hardCfgs.Add(cfg);
  18. }
  19. else
  20. {
  21. _commonCfgs.Add(cfg);
  22. }
  23. }
  24. }
  25. public List<StoryChapterCfg> GetDataArray(int storyType)
  26. {
  27. if(storyType == ConstStoryType.HARD_TYPE)
  28. {
  29. return _hardCfgs;
  30. }
  31. else
  32. {
  33. return _commonCfgs;
  34. }
  35. }
  36. }
  37. }