ActivityGetYuanXiaoDataManager.cs 1.3 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950
  1. using ET;
  2. using System.Collections;
  3. using System.Collections.Generic;
  4. using System.Threading.Tasks;
  5. using UnityEngine;
  6. namespace GFGGame
  7. {
  8. public class ActivityGetYuanXiaoDataManager : SingletonBase<ActivityGetYuanXiaoDataManager>
  9. {
  10. public bool CheckOpen()
  11. {
  12. var activityID = ActivityDataManager.Instance.GetCurOpenActiveByType(ActivityType.YuanXiao);
  13. return activityID > 0;
  14. }
  15. public bool HaveNewLevelCanPlay()
  16. {
  17. int curLevel = GetCurLevel();
  18. if(curLevel == gameinfoList.Count)
  19. {
  20. return false;
  21. }
  22. long haveNum = ItemDataManager.GetItemNum(PickUpGameArray.Instance.dataArray[curLevel].comsumePassArr[0][0]);
  23. bool canPlay = (haveNum >= PickUpGameArray.Instance.dataArray[curLevel].comsumePassArr[0][1]);
  24. return canPlay;
  25. }
  26. public int GetCurLevel()
  27. {
  28. //return gameinfoList.Count;
  29. int i;
  30. for (i = 0; i < gameinfoList.Count; i++)
  31. {
  32. if (!gameinfoList[i].IsCleared)
  33. {
  34. return i;
  35. }
  36. }
  37. return i;
  38. }
  39. public List<GameInfoProto> gameinfoList = new List<GameInfoProto>();
  40. }
  41. }