ActivityGetYuanXiaoDataManager.cs 1.3 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647
  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. int i;
  29. for (i = 0; i < gameinfoList.Count; i++)
  30. {
  31. if (!gameinfoList[i].IsCleared)
  32. {
  33. return i;
  34. }
  35. }
  36. return i;
  37. }
  38. public List<GameInfoProto> gameinfoList = new List<GameInfoProto>();
  39. }
  40. }