MiniGameDateManager.cs 3.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124
  1. using ET;
  2. using System;
  3. using System.Collections;
  4. using System.Collections.Generic;
  5. using System.Text.RegularExpressions;
  6. using UnityEngine;
  7. namespace GFGGame
  8. {
  9. class MiniGameDateManager : SingletonBase<MiniGameDateManager>
  10. {
  11. public List<ItemInfoProto> itemList = new List<ItemInfoProto>();
  12. public List<GameInfoProto> gameinfoList = new List<GameInfoProto>();
  13. //记录合成游戏的矩阵信息
  14. public List<int> idList_CS = new List<int>();
  15. public Dictionary<int, int> NewItemIdDic = new Dictionary<int, int>();
  16. public string ItemIdVPosition = "";
  17. public int MergeGameType = 1;
  18. //资源组的名字
  19. public int MergeGameMatType = 1;
  20. public bool CurLevelStatus;
  21. public bool CHECK_TIPS = false; //提示弹窗是否打开
  22. //合成游戏
  23. public int taskID = 40001;
  24. public bool GetRewardRot()
  25. {
  26. if(gameinfoList.Count == 0)
  27. {
  28. return false;
  29. }
  30. foreach(GameInfoProto t in gameinfoList)
  31. {
  32. if(t.FirstPassRewardStatus == 1)
  33. {
  34. return true;
  35. }
  36. if(t.StarRewardStatus.Count > 0 )
  37. {
  38. for(int i = 0; i<t.StarRewardStatus.Count;i++)
  39. {
  40. if(t.StarRewardStatus[i] == 1)
  41. {
  42. return true;
  43. }
  44. }
  45. }
  46. }
  47. return false;
  48. }
  49. public List<List<int>> GetIdListToLL()
  50. {
  51. List<List<int>> idlist = new List<List<int>>();
  52. int itemNum = 5;
  53. int count = 0;
  54. for (int i = 0; i < itemNum; i++)
  55. {
  56. idlist.Add(new List<int>());
  57. for (int j = 0; j < itemNum; j++)
  58. {
  59. int index = i * itemNum + j;
  60. //对两个按钮单独处理
  61. if (i == itemNum - 1)
  62. {
  63. if (j == 0)
  64. {
  65. idlist[i].Add(-1);
  66. continue;
  67. }
  68. if (j == itemNum - 1)
  69. {
  70. idlist[i].Add(-1);
  71. continue;
  72. }
  73. }
  74. idlist[i].Add(idList_CS[count]);
  75. idlist[i][j] = idList_CS[count];
  76. count++;
  77. }
  78. }
  79. return idlist;
  80. }
  81. public List<int> GetListByll(List<List<int>> idlist)
  82. {
  83. List<int> idList_S = new List<int>();
  84. int itemNum = 5;
  85. for (int i = 0; i < itemNum; i++)
  86. {
  87. for (int j = 0; j < itemNum; j++)
  88. {
  89. //对两个按钮单独处理
  90. if (i == itemNum - 1)
  91. {
  92. if (j == 0)
  93. {
  94. continue;
  95. }
  96. if (j == itemNum - 1)
  97. {
  98. continue;
  99. }
  100. }
  101. idList_S.Add(idlist[i][j]);
  102. }
  103. }
  104. return idList_S;
  105. }
  106. public List<int> GetIDListByString(string name)
  107. {
  108. List<int> idList = new List<int>();
  109. string[] parts = Regex.Split(name, "-");
  110. foreach (string id in parts)
  111. {
  112. idList.Add(int.Parse(id));
  113. }
  114. return idList;
  115. }
  116. }
  117. }