GameMain.ts.json 132 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726
  1. {
  2. "sourceFile": "assets/scripts/Game/GameMain.ts",
  3. "activeCommit": 0,
  4. "commits": [
  5. {
  6. "activePatchIndex": 177,
  7. "patches": [
  8. {
  9. "date": 1694486060260,
  10. "content": "Index: \n===================================================================\n--- \n+++ \n"
  11. },
  12. {
  13. "date": 1694486098308,
  14. "content": "Index: \n===================================================================\n--- \n+++ \n@@ -1,5 +1,6 @@\n import { _decorator, Component } from 'cc';\n+import { GameManager } from '../Manager/GameManager';\n const { ccclass, property } = _decorator;\n \n @ccclass('GameMain')\n export class GameMain extends Component {\n@@ -12,8 +13,9 @@\n * 初始化逻辑\n * 每次GameManager.StartGame()时都会调用\n */\n initUI() {\n+ GameManager.getInstance().addScore(20);\n \n }\n \n update(deltaTime: number) {\n"
  15. },
  16. {
  17. "date": 1694488465399,
  18. "content": "Index: \n===================================================================\n--- \n+++ \n@@ -13,10 +13,9 @@\n * 初始化逻辑\n * 每次GameManager.StartGame()时都会调用\n */\n initUI() {\n- GameManager.getInstance().addScore(20);\n-\n+ \n }\n \n update(deltaTime: number) {\n \n"
  19. },
  20. {
  21. "date": 1694488566074,
  22. "content": "Index: \n===================================================================\n--- \n+++ \n@@ -3,8 +3,11 @@\n const { ccclass, property } = _decorator;\n \n @ccclass('GameMain')\n export class GameMain extends Component {\n+\n+ @property(Node)\n+ rootNodeList: Node[] = [];\n \n start() {\n \n }\n@@ -13,9 +16,9 @@\n * 初始化逻辑\n * 每次GameManager.StartGame()时都会调用\n */\n initUI() {\n- \n+\n }\n \n update(deltaTime: number) {\n \n"
  23. },
  24. {
  25. "date": 1694488601121,
  26. "content": "Index: \n===================================================================\n--- \n+++ \n@@ -1,13 +1,16 @@\n-import { _decorator, Component } from 'cc';\n+import { _decorator, Component, Prefab } from 'cc';\n import { GameManager } from '../Manager/GameManager';\n const { ccclass, property } = _decorator;\n \n @ccclass('GameMain')\n export class GameMain extends Component {\n \n @property(Node)\n rootNodeList: Node[] = [];\n+\n+ @property(Prefab)\n+ itemPrefabList: Prefab[] = [];\n \n start() {\n \n }\n"
  27. },
  28. {
  29. "date": 1694488672751,
  30. "content": "Index: \n===================================================================\n--- \n+++ \n@@ -18,9 +18,9 @@\n /**\n * 初始化逻辑\n * 每次GameManager.StartGame()时都会调用\n */\n- initUI() {\n+ initUI() { \n \n }\n \n update(deltaTime: number) {\n"
  31. },
  32. {
  33. "date": 1694488711525,
  34. "content": "Index: \n===================================================================\n--- \n+++ \n@@ -1,5 +1,5 @@\n-import { _decorator, Component, Prefab } from 'cc';\n+import { _decorator, Component, Prefab, Node } from 'cc';\n import { GameManager } from '../Manager/GameManager';\n const { ccclass, property } = _decorator;\n \n @ccclass('GameMain')\n"
  35. },
  36. {
  37. "date": 1694489042425,
  38. "content": "Index: \n===================================================================\n--- \n+++ \n@@ -22,8 +22,12 @@\n initUI() { \n \n }\n \n+ randomNumbers() {\n+ \n+ }\n+\n update(deltaTime: number) {\n \n }\n }\n"
  39. },
  40. {
  41. "date": 1694489071354,
  42. "content": "Index: \n===================================================================\n--- \n+++ \n@@ -9,8 +9,10 @@\n rootNodeList: Node[] = [];\n \n @property(Prefab)\n itemPrefabList: Prefab[] = [];\n+\n+ randomNumList: [] = [];\n \n start() {\n \n }\n@@ -23,9 +25,9 @@\n \n }\n \n randomNumbers() {\n- \n+\n }\n \n update(deltaTime: number) {\n \n"
  43. },
  44. {
  45. "date": 1694489077992,
  46. "content": "Index: \n===================================================================\n--- \n+++ \n@@ -10,9 +10,9 @@\n \n @property(Prefab)\n itemPrefabList: Prefab[] = [];\n \n- randomNumList: [] = [];\n+ randomNumList: number[] = [];\n \n start() {\n \n }\n"
  47. },
  48. {
  49. "date": 1694489145343,
  50. "content": "Index: \n===================================================================\n--- \n+++ \n@@ -24,10 +24,11 @@\n initUI() { \n \n }\n \n- randomNumbers() {\n-\n+ randomNumbers(count) {\n+ let numbers: number[] = [];\n+ \n }\n \n update(deltaTime: number) {\n \n"
  51. },
  52. {
  53. "date": 1694489380149,
  54. "content": "Index: \n===================================================================\n--- \n+++ \n@@ -25,10 +25,15 @@\n \n }\n \n randomNumbers(count) {\n- let numbers: number[] = [];\n- \n+ let numbers = [];\n+ while (numbers.length < count) {\n+ let random = Math.floor(Math.random() * 10) + 1;\n+ if (numbers) {\n+ \n+ }\n+ }\n }\n \n update(deltaTime: number) {\n \n"
  55. },
  56. {
  57. "date": 1694489461062,
  58. "content": "Index: \n===================================================================\n--- \n+++ \n@@ -25,13 +25,13 @@\n \n }\n \n randomNumbers(count) {\n- let numbers = [];\n+ let numbers: number[] = [];\n while (numbers.length < count) {\n let random = Math.floor(Math.random() * 10) + 1;\n if (numbers) {\n- \n+\n }\n }\n }\n \n"
  59. },
  60. {
  61. "date": 1694489668381,
  62. "content": "Index: \n===================================================================\n--- \n+++ \n@@ -28,9 +28,9 @@\n randomNumbers(count) {\n let numbers: number[] = [];\n while (numbers.length < count) {\n let random = Math.floor(Math.random() * 10) + 1;\n- if (numbers) {\n+ if (numbers.includes) {\n \n }\n }\n }\n"
  63. },
  64. {
  65. "date": 1694489755200,
  66. "content": "Index: \n===================================================================\n--- \n+++ \n@@ -28,12 +28,13 @@\n randomNumbers(count) {\n let numbers: number[] = [];\n while (numbers.length < count) {\n let random = Math.floor(Math.random() * 10) + 1;\n- if (numbers.includes) {\n-\n+ if (!numbers.includes(random)) {\n+ numbers.push(random);\n }\n }\n+ return numbers;\n }\n \n update(deltaTime: number) {\n \n"
  67. },
  68. {
  69. "date": 1694490183461,
  70. "content": "Index: \n===================================================================\n--- \n+++ \n@@ -26,14 +26,19 @@\n }\n \n randomNumbers(count) {\n let numbers: number[] = [];\n- while (numbers.length < count) {\n+ while (count < 7 ? numbers.length < count : numbers.length < count - 1) {\n let random = Math.floor(Math.random() * 10) + 1;\n if (!numbers.includes(random)) {\n numbers.push(random);\n }\n }\n+\n+ if (count >= 7) {\n+ numbers.push(numbers[Math.floor(Math.random() * numbers.length)]);\n+ }\n+\n return numbers;\n }\n \n update(deltaTime: number) {\n"
  71. },
  72. {
  73. "date": 1694490276046,
  74. "content": "Index: \n===================================================================\n--- \n+++ \n@@ -21,9 +21,12 @@\n * 初始化逻辑\n * 每次GameManager.StartGame()时都会调用\n */\n initUI() { \n+ this.randomNumList = [];\n+ this.randomNumList = this.randomNumbers(7);\n \n+ console.log(\"=========== randomList =\", this.randomNumList);\n }\n \n randomNumbers(count) {\n let numbers: number[] = [];\n"
  75. },
  76. {
  77. "date": 1694490430359,
  78. "content": "Index: \n===================================================================\n--- \n+++ \n@@ -29,9 +29,10 @@\n }\n \n randomNumbers(count) {\n let numbers: number[] = [];\n- while (count < 7 ? numbers.length < count : numbers.length < count - 1) {\n+ let randomCount = count < 7 ? count: count - 1;\n+ while () {\n let random = Math.floor(Math.random() * 10) + 1;\n if (!numbers.includes(random)) {\n numbers.push(random);\n }\n"
  79. },
  80. {
  81. "date": 1694490451215,
  82. "content": "Index: \n===================================================================\n--- \n+++ \n@@ -30,9 +30,9 @@\n \n randomNumbers(count) {\n let numbers: number[] = [];\n let randomCount = count < 7 ? count: count - 1;\n- while () {\n+ while (numbers < randomCount) {\n let random = Math.floor(Math.random() * 10) + 1;\n if (!numbers.includes(random)) {\n numbers.push(random);\n }\n"
  83. },
  84. {
  85. "date": 1694490551761,
  86. "content": "Index: \n===================================================================\n--- \n+++ \n@@ -30,9 +30,9 @@\n \n randomNumbers(count) {\n let numbers: number[] = [];\n let randomCount = count < 7 ? count: count - 1;\n- while (numbers < randomCount) {\n+ while (numbers.length < randomCount) {\n let random = Math.floor(Math.random() * 10) + 1;\n if (!numbers.includes(random)) {\n numbers.push(random);\n }\n"
  87. },
  88. {
  89. "date": 1694490905128,
  90. "content": "Index: \n===================================================================\n--- \n+++ \n@@ -10,9 +10,9 @@\n \n @property(Prefab)\n itemPrefabList: Prefab[] = [];\n \n- randomNumList: number[] = [];\n+ randomFruitList: number[] = [];\n \n start() {\n \n }\n@@ -21,12 +21,12 @@\n * 初始化逻辑\n * 每次GameManager.StartGame()时都会调用\n */\n initUI() { \n- this.randomNumList = [];\n- this.randomNumList = this.randomNumbers(7);\n+ this.randomFruitList = [];\n+ this.randomFruitList = this.randomNumbers(7);\n \n- console.log(\"=========== randomList =\", this.randomNumList);\n+ console.log(\"=========== randomList =\", this.randomFruitList);\n }\n \n randomNumbers(count) {\n let numbers: number[] = [];\n"
  91. },
  92. {
  93. "date": 1694490960985,
  94. "content": "Index: \n===================================================================\n--- \n+++ \n@@ -44,8 +44,12 @@\n \n return numbers;\n }\n \n+ randomSelectFruit() {\n+ \n+ }\n+\n update(deltaTime: number) {\n \n }\n }\n"
  95. },
  96. {
  97. "date": 1694490988496,
  98. "content": "Index: \n===================================================================\n--- \n+++ \n@@ -11,8 +11,9 @@\n @property(Prefab)\n itemPrefabList: Prefab[] = [];\n \n randomFruitList: number[] = [];\n+ selectFruitList: number[] = [];\n \n start() {\n \n }\n@@ -45,9 +46,9 @@\n return numbers;\n }\n \n randomSelectFruit() {\n- \n+\n }\n \n update(deltaTime: number) {\n \n"
  99. },
  100. {
  101. "date": 1694491513608,
  102. "content": "Index: \n===================================================================\n--- \n+++ \n@@ -10,10 +10,12 @@\n \n @property(Prefab)\n itemPrefabList: Prefab[] = [];\n \n+\n randomFruitList: number[] = [];\n selectFruitList: number[] = [];\n+ positionList: number[] = [];\n \n start() {\n \n }\n@@ -45,10 +47,24 @@\n \n return numbers;\n }\n \n- randomSelectFruit() {\n-\n+ randomSelectFruit(levelNum) {\n+ let numbers: number[] = [];\n+ if (levelNum < 3) {\n+ numbers.push(this.randomFruitList[Math.floor(Math.random() * this.randomFruitList.length)]);\n+ } else {\n+ let firstIndex = Math.floor(Math.random() * this.randomFruitList.length);\n+ let twoIndex = -1;\n+ while (twoIndex == -1) {\n+ let index = Math.floor(Math.random() * this.randomFruitList.length);\n+ if (index != firstIndex) {\n+ twoIndex = index;\n+ }\n+ }\n+ numbers.push(this.randomFruitList[firstIndex], this.randomFruitList[twoIndex]);\n+ }\n+ return numbers;\n }\n \n update(deltaTime: number) {\n \n"
  103. },
  104. {
  105. "date": 1694491520823,
  106. "content": "Index: \n===================================================================\n--- \n+++ \n@@ -47,9 +47,9 @@\n \n return numbers;\n }\n \n- randomSelectFruit(levelNum) {\n+ randomSelectFruit(levelNum: number) {\n let numbers: number[] = [];\n if (levelNum < 3) {\n numbers.push(this.randomFruitList[Math.floor(Math.random() * this.randomFruitList.length)]);\n } else {\n"
  107. },
  108. {
  109. "date": 1694491526837,
  110. "content": "Index: \n===================================================================\n--- \n+++ \n@@ -30,9 +30,9 @@\n \n console.log(\"=========== randomList =\", this.randomFruitList);\n }\n \n- randomNumbers(count) {\n+ randomNumbers(count: number) {\n let numbers: number[] = [];\n let randomCount = count < 7 ? count: count - 1;\n while (numbers.length < randomCount) {\n let random = Math.floor(Math.random() * 10) + 1;\n"
  111. },
  112. {
  113. "date": 1694491603954,
  114. "content": "Index: \n===================================================================\n--- \n+++ \n@@ -26,10 +26,12 @@\n */\n initUI() { \n this.randomFruitList = [];\n this.randomFruitList = this.randomNumbers(7);\n+ this.selectFruitList = this.randomSelectFruit(3);\n \n console.log(\"=========== randomList =\", this.randomFruitList);\n+ console.log(\"=========== selectFruitList =\", this.selectFruitList);\n }\n \n randomNumbers(count: number) {\n let numbers: number[] = [];\n"
  115. },
  116. {
  117. "date": 1694491881402,
  118. "content": "Index: \n===================================================================\n--- \n+++ \n@@ -67,8 +67,19 @@\n }\n return numbers;\n }\n \n+ randomPosition(count: number) {\n+ let numbers: number[] = [];\n+ while (numbers.length < count) {\n+ let random = Math.floor(Math.random() * 9);\n+ if (!numbers.includes(random)) {\n+ numbers.push(random);\n+ }\n+ }\n+ return numbers;\n+ }\n+\n update(deltaTime: number) {\n \n }\n }\n"
  119. },
  120. {
  121. "date": 1694491961283,
  122. "content": "Index: \n===================================================================\n--- \n+++ \n@@ -27,8 +27,9 @@\n initUI() { \n this.randomFruitList = [];\n this.randomFruitList = this.randomNumbers(7);\n this.selectFruitList = this.randomSelectFruit(3);\n+ this.positionList = this.randomPosition(7);\n \n console.log(\"=========== randomList =\", this.randomFruitList);\n console.log(\"=========== selectFruitList =\", this.selectFruitList);\n }\n"
  123. },
  124. {
  125. "date": 1694491990065,
  126. "content": "Index: \n===================================================================\n--- \n+++ \n@@ -25,8 +25,10 @@\n * 每次GameManager.StartGame()时都会调用\n */\n initUI() { \n this.randomFruitList = [];\n+ this.selectFruitList = [];\n+ this.positionList = [];\n this.randomFruitList = this.randomNumbers(7);\n this.selectFruitList = this.randomSelectFruit(3);\n this.positionList = this.randomPosition(7);\n \n"
  127. },
  128. {
  129. "date": 1694492011887,
  130. "content": "Index: \n===================================================================\n--- \n+++ \n@@ -33,8 +33,9 @@\n this.positionList = this.randomPosition(7);\n \n console.log(\"=========== randomList =\", this.randomFruitList);\n console.log(\"=========== selectFruitList =\", this.selectFruitList);\n+ console.log(\"=========== positionList =\", this.positionList);\n }\n \n randomNumbers(count: number) {\n let numbers: number[] = [];\n"
  131. },
  132. {
  133. "date": 1694492277215,
  134. "content": "Index: \n===================================================================\n--- \n+++ \n@@ -82,8 +82,12 @@\n }\n return numbers;\n }\n \n+ generateFruits() {\n+ \n+ }\n+\n update(deltaTime: number) {\n \n }\n }\n"
  135. },
  136. {
  137. "date": 1694492378497,
  138. "content": "Index: \n===================================================================\n--- \n+++ \n@@ -83,11 +83,17 @@\n return numbers;\n }\n \n generateFruits() {\n- \n+\n }\n \n+ clearAllRootChildren() {\n+ for (let i = 0; i < this.rootNodeList.length; i++) {\n+ this.rootNodeList[i].destroyAllChildren();\n+ }\n+ }\n+\n update(deltaTime: number) {\n \n }\n }\n"
  139. },
  140. {
  141. "date": 1694492527055,
  142. "content": "Index: \n===================================================================\n--- \n+++ \n@@ -1,5 +1,5 @@\n-import { _decorator, Component, Prefab, Node } from 'cc';\n+import { _decorator, Component, Prefab, Node, instantiate } from 'cc';\n import { GameManager } from '../Manager/GameManager';\n const { ccclass, property } = _decorator;\n \n @ccclass('GameMain')\n@@ -83,9 +83,13 @@\n return numbers;\n }\n \n generateFruits() {\n-\n+ this.clearAllRootChildren();\n+ for (let i = 0; i < this.randomFruitList.length; i++) {\n+ let item = instantiate(this.itemPrefabList[this.randomFruitList[i] - 1]);\n+ this.rootNodeList[this.positionList[i]].addChild(item);\n+ }\n }\n \n clearAllRootChildren() {\n for (let i = 0; i < this.rootNodeList.length; i++) {\n"
  143. },
  144. {
  145. "date": 1694492544490,
  146. "content": "Index: \n===================================================================\n--- \n+++ \n@@ -31,8 +31,10 @@\n this.randomFruitList = this.randomNumbers(7);\n this.selectFruitList = this.randomSelectFruit(3);\n this.positionList = this.randomPosition(7);\n \n+ this.generateFruits();\n+\n console.log(\"=========== randomList =\", this.randomFruitList);\n console.log(\"=========== selectFruitList =\", this.selectFruitList);\n console.log(\"=========== positionList =\", this.positionList);\n }\n"
  147. },
  148. {
  149. "date": 1694494171616,
  150. "content": "Index: \n===================================================================\n--- \n+++ \n@@ -14,8 +14,10 @@\n \n randomFruitList: number[] = [];\n selectFruitList: number[] = [];\n positionList: number[] = [];\n+ randomFruitCount: number = 0;\n+ selectCount: number = 0;\n \n start() {\n \n }\n@@ -27,8 +29,9 @@\n initUI() { \n this.randomFruitList = [];\n this.selectFruitList = [];\n this.positionList = [];\n+ this.getRandomByLevelNum(1);\n this.randomFruitList = this.randomNumbers(7);\n this.selectFruitList = this.randomSelectFruit(3);\n this.positionList = this.randomPosition(7);\n \n@@ -38,8 +41,21 @@\n console.log(\"=========== selectFruitList =\", this.selectFruitList);\n console.log(\"=========== positionList =\", this.positionList);\n }\n \n+ getRandomByLevelNum(levelNum) {\n+ if (levelNum == 1) {\n+ this.randomFruitCount = 3;\n+ this.selectCount = 1;\n+ } else if (levelNum === 2) {\n+ this.randomFruitCount = 5;\n+ this.selectCount = 1;\n+ } else {\n+ this.randomFruitCount = 7;\n+ this.selectCount = 2;\n+ }\n+ }\n+\n randomNumbers(count: number) {\n let numbers: number[] = [];\n let randomCount = count < 7 ? count: count - 1;\n while (numbers.length < randomCount) {\n"
  151. },
  152. {
  153. "date": 1694494244538,
  154. "content": "Index: \n===================================================================\n--- \n+++ \n@@ -30,11 +30,11 @@\n this.randomFruitList = [];\n this.selectFruitList = [];\n this.positionList = [];\n this.getRandomByLevelNum(1);\n- this.randomFruitList = this.randomNumbers(7);\n- this.selectFruitList = this.randomSelectFruit(3);\n- this.positionList = this.randomPosition(7);\n+ this.randomFruitList = this.randomNumbers(this.randomFruitCount);\n+ this.selectFruitList = this.randomSelectFruit(t);\n+ this.positionList = this.randomPosition(this.randomFruitCount);\n \n this.generateFruits();\n \n console.log(\"=========== randomList =\", this.randomFruitList);\n@@ -44,15 +44,12 @@\n \n getRandomByLevelNum(levelNum) {\n if (levelNum == 1) {\n this.randomFruitCount = 3;\n- this.selectCount = 1;\n } else if (levelNum === 2) {\n this.randomFruitCount = 5;\n- this.selectCount = 1;\n } else {\n this.randomFruitCount = 7;\n- this.selectCount = 2;\n }\n }\n \n randomNumbers(count: number) {\n"
  155. },
  156. {
  157. "date": 1694494275889,
  158. "content": "Index: \n===================================================================\n--- \n+++ \n@@ -29,11 +29,12 @@\n initUI() { \n this.randomFruitList = [];\n this.selectFruitList = [];\n this.positionList = [];\n- this.getRandomByLevelNum(1);\n+ let levelNum = 1;\n+ this.getRandomByLevelNum(levelNum);\n this.randomFruitList = this.randomNumbers(this.randomFruitCount);\n- this.selectFruitList = this.randomSelectFruit(t);\n+ this.selectFruitList = this.randomSelectFruit(levelNum);\n this.positionList = this.randomPosition(this.randomFruitCount);\n \n this.generateFruits();\n \n"
  159. },
  160. {
  161. "date": 1694495616884,
  162. "content": "Index: \n===================================================================\n--- \n+++ \n@@ -1,5 +1,5 @@\n-import { _decorator, Component, Prefab, Node, instantiate } from 'cc';\n+import { _decorator, Component, Prefab, Node, instantiate, tween } from 'cc';\n import { GameManager } from '../Manager/GameManager';\n const { ccclass, property } = _decorator;\n \n @ccclass('GameMain')\n@@ -112,8 +112,42 @@\n this.rootNodeList[i].destroyAllChildren();\n }\n }\n \n+ // setTimeoutToTimes(time, times, tagNode, callback) {\n+ // let repeatTimes = 1;\n+ // if(times){\n+ // repeatTimes = times;\n+ // };\n+\n+ // if(tagNode){\n+ // let action = cc.tween(tagNode)\n+ // .delay(time)\n+ // .call(() => { \n+ // if(callback){\n+ // callback();\n+ // }\n+ // });\n+ // let act = cc.tween(tagNode)\n+ // .repeat(repeatTimes, action)\n+ // .start();\n+ // return act;\n+ // }else{\n+ // console.warn(\"setTimeout tagNode is Null\");\n+ // return null;\n+ // }\n+ // }\n+\n+ setTimeOutToTimes(time: number, times: number, tagNode: Node, callback: any) {\n+ let repeatTimes = 1;\n+ if (times) { repeatTimes = times; }\n+\n+ if (tagNode) {\n+ let action = tween(tagNode).delay(time).call(() => { if (callback) { callback() } });\n+ let act = tween(tagNode).repeat(repeatTimes, action).start();\n+ }\n+ }\n+\n update(deltaTime: number) {\n \n }\n }\n"
  163. },
  164. {
  165. "date": 1694495785688,
  166. "content": "Index: \n===================================================================\n--- \n+++ \n@@ -30,14 +30,21 @@\n this.randomFruitList = [];\n this.selectFruitList = [];\n this.positionList = [];\n let levelNum = 1;\n+ let time = 3;\n this.getRandomByLevelNum(levelNum);\n this.randomFruitList = this.randomNumbers(this.randomFruitCount);\n this.selectFruitList = this.randomSelectFruit(levelNum);\n this.positionList = this.randomPosition(this.randomFruitCount);\n \n this.generateFruits();\n+ this.setTimeOutToTimes(1, time, this.node, () => {\n+ time--;\n+ if (time <= 0) {\n+ \n+ }\n+ });\n \n console.log(\"=========== randomList =\", this.randomFruitList);\n console.log(\"=========== selectFruitList =\", this.selectFruitList);\n console.log(\"=========== positionList =\", this.positionList);\n"
  167. },
  168. {
  169. "date": 1694495887644,
  170. "content": "Index: \n===================================================================\n--- \n+++ \n@@ -37,14 +37,11 @@\n this.selectFruitList = this.randomSelectFruit(levelNum);\n this.positionList = this.randomPosition(this.randomFruitCount);\n \n this.generateFruits();\n- this.setTimeOutToTimes(1, time, this.node, () => {\n- time--;\n- if (time <= 0) {\n- \n- }\n- });\n+ setTimeout(() => {\n+ \n+ }, time * 1000);\n \n console.log(\"=========== randomList =\", this.randomFruitList);\n console.log(\"=========== selectFruitList =\", this.selectFruitList);\n console.log(\"=========== positionList =\", this.positionList);\n"
  171. },
  172. {
  173. "date": 1694495899983,
  174. "content": "Index: \n===================================================================\n--- \n+++ \n@@ -36,16 +36,16 @@\n this.randomFruitList = this.randomNumbers(this.randomFruitCount);\n this.selectFruitList = this.randomSelectFruit(levelNum);\n this.positionList = this.randomPosition(this.randomFruitCount);\n \n+ console.log(\"=========== randomList =\", this.randomFruitList);\n+ console.log(\"=========== selectFruitList =\", this.selectFruitList);\n+ console.log(\"=========== positionList =\", this.positionList);\n+\n this.generateFruits();\n setTimeout(() => {\n- \n+\n }, time * 1000);\n-\n- console.log(\"=========== randomList =\", this.randomFruitList);\n- console.log(\"=========== selectFruitList =\", this.selectFruitList);\n- console.log(\"=========== positionList =\", this.positionList);\n }\n \n getRandomByLevelNum(levelNum) {\n if (levelNum == 1) {\n"
  175. },
  176. {
  177. "date": 1694495920512,
  178. "content": "Index: \n===================================================================\n--- \n+++ \n@@ -116,39 +116,16 @@\n this.rootNodeList[i].destroyAllChildren();\n }\n }\n \n- // setTimeoutToTimes(time, times, tagNode, callback) {\n- // let repeatTimes = 1;\n- // if(times){\n- // repeatTimes = times;\n- // };\n-\n- // if(tagNode){\n- // let action = cc.tween(tagNode)\n- // .delay(time)\n- // .call(() => { \n- // if(callback){\n- // callback();\n- // }\n- // });\n- // let act = cc.tween(tagNode)\n- // .repeat(repeatTimes, action)\n- // .start();\n- // return act;\n- // }else{\n- // console.warn(\"setTimeout tagNode is Null\");\n- // return null;\n- // }\n- // }\n-\n setTimeOutToTimes(time: number, times: number, tagNode: Node, callback: any) {\n let repeatTimes = 1;\n if (times) { repeatTimes = times; }\n \n if (tagNode) {\n let action = tween(tagNode).delay(time).call(() => { if (callback) { callback() } });\n let act = tween(tagNode).repeat(repeatTimes, action).start();\n+ return act;\n }\n }\n \n update(deltaTime: number) {\n"
  179. },
  180. {
  181. "date": 1694495942266,
  182. "content": "Index: \n===================================================================\n--- \n+++ \n@@ -127,8 +127,12 @@\n return act;\n }\n }\n \n+ hideFruit() {\n+ \n+ }\n+\n update(deltaTime: number) {\n \n }\n }\n"
  183. },
  184. {
  185. "date": 1694496039058,
  186. "content": "Index: \n===================================================================\n--- \n+++ \n@@ -128,9 +128,11 @@\n }\n }\n \n hideFruit() {\n- \n+ for (let i = 0; i < this.rootNodeList.length; i++) {\n+ this.rootNodeList[i].children[0].active = false;\n+ }\n }\n \n update(deltaTime: number) {\n \n"
  187. },
  188. {
  189. "date": 1694496049825,
  190. "content": "Index: \n===================================================================\n--- \n+++ \n@@ -42,9 +42,9 @@\n console.log(\"=========== positionList =\", this.positionList);\n \n this.generateFruits();\n setTimeout(() => {\n-\n+ this.hideFruit();\n }, time * 1000);\n }\n \n getRandomByLevelNum(levelNum) {\n"
  191. },
  192. {
  193. "date": 1694496143133,
  194. "content": "Index: \n===================================================================\n--- \n+++ \n@@ -129,9 +129,11 @@\n }\n \n hideFruit() {\n for (let i = 0; i < this.rootNodeList.length; i++) {\n- this.rootNodeList[i].children[0].active = false;\n+ if (this.rootNodeList[i].children.length > 0) {\n+ this.rootNodeList[i].children[0].active = false;\n+ }\n }\n }\n \n update(deltaTime: number) {\n"
  195. },
  196. {
  197. "date": 1694496612606,
  198. "content": "Index: \n===================================================================\n--- \n+++ \n@@ -1,5 +1,5 @@\n-import { _decorator, Component, Prefab, Node, instantiate, tween } from 'cc';\n+import { _decorator, Component, Prefab, Node, instantiate, tween, Label } from 'cc';\n import { GameManager } from '../Manager/GameManager';\n const { ccclass, property } = _decorator;\n \n @ccclass('GameMain')\n@@ -10,9 +10,15 @@\n \n @property(Prefab)\n itemPrefabList: Prefab[] = [];\n \n+ @property(Node)\n+ maskNode: Node = null;\n \n+ @property(Label)\n+ timeLabel: Label = null;\n+\n+\n randomFruitList: number[] = [];\n selectFruitList: number[] = [];\n positionList: number[] = [];\n randomFruitCount: number = 0;\n"
  199. },
  200. {
  201. "date": 1694496691902,
  202. "content": "Index: \n===================================================================\n--- \n+++ \n@@ -141,8 +141,12 @@\n }\n }\n }\n \n+ startCountdown() {\n+ \n+ }\n+\n update(deltaTime: number) {\n \n }\n }\n"
  203. },
  204. {
  205. "date": 1694496788803,
  206. "content": "Index: \n===================================================================\n--- \n+++ \n@@ -142,9 +142,15 @@\n }\n }\n \n startCountdown() {\n- \n+ let time = 3;\n+ let cdTween = this.setTimeOutToTimes(1, time, this.node, () => {\n+ time--;\n+ if (time <= 0) {\n+ \n+ }\n+ });\n }\n \n update(deltaTime: number) {\n \n"
  207. },
  208. {
  209. "date": 1694496822649,
  210. "content": "Index: \n===================================================================\n--- \n+++ \n@@ -146,9 +146,11 @@\n let time = 3;\n let cdTween = this.setTimeOutToTimes(1, time, this.node, () => {\n time--;\n if (time <= 0) {\n- \n+ cdTween.stop();\n+ cdTween.removeSelf();\n+ cdTween = null;\n }\n });\n }\n \n"
  211. },
  212. {
  213. "date": 1694496849492,
  214. "content": "Index: \n===================================================================\n--- \n+++ \n@@ -144,8 +144,9 @@\n \n startCountdown() {\n let time = 3;\n let cdTween = this.setTimeOutToTimes(1, time, this.node, () => {\n+ this.timeLabel.string = time + \"\";\n time--;\n if (time <= 0) {\n cdTween.stop();\n cdTween.removeSelf();\n"
  215. },
  216. {
  217. "date": 1694496865266,
  218. "content": "Index: \n===================================================================\n--- \n+++ \n@@ -150,8 +150,9 @@\n if (time <= 0) {\n cdTween.stop();\n cdTween.removeSelf();\n cdTween = null;\n+ this.maskNode.active = false;\n }\n });\n }\n \n"
  219. },
  220. {
  221. "date": 1694496901492,
  222. "content": "Index: \n===================================================================\n--- \n+++ \n@@ -49,8 +49,10 @@\n \n this.generateFruits();\n setTimeout(() => {\n this.hideFruit();\n+ this.maskNode.active = true;\n+ this.startCountdown();\n }, time * 1000);\n }\n \n getRandomByLevelNum(levelNum) {\n"
  223. },
  224. {
  225. "date": 1694497006554,
  226. "content": "Index: \n===================================================================\n--- \n+++ \n@@ -50,8 +50,10 @@\n this.generateFruits();\n setTimeout(() => {\n this.hideFruit();\n this.maskNode.active = true;\n+ let item = 3;\n+ this.timeLabel.string = time + \"\";\n this.startCountdown();\n }, time * 1000);\n }\n \n"
  227. },
  228. {
  229. "date": 1694497011722,
  230. "content": "Index: \n===================================================================\n--- \n+++ \n@@ -50,9 +50,9 @@\n this.generateFruits();\n setTimeout(() => {\n this.hideFruit();\n this.maskNode.active = true;\n- let item = 3;\n+ let time = 3;\n this.timeLabel.string = time + \"\";\n this.startCountdown();\n }, time * 1000);\n }\n"
  231. },
  232. {
  233. "date": 1694497023796,
  234. "content": "Index: \n===================================================================\n--- \n+++ \n@@ -145,10 +145,9 @@\n }\n }\n }\n \n- startCountdown() {\n- let time = 3;\n+ startCountdown(time) {\n let cdTween = this.setTimeOutToTimes(1, time, this.node, () => {\n this.timeLabel.string = time + \"\";\n time--;\n if (time <= 0) {\n"
  235. },
  236. {
  237. "date": 1694497043985,
  238. "content": "Index: \n===================================================================\n--- \n+++ \n@@ -52,9 +52,9 @@\n this.hideFruit();\n this.maskNode.active = true;\n let time = 3;\n this.timeLabel.string = time + \"\";\n- this.startCountdown();\n+ this.startCountdown(time);\n }, time * 1000);\n }\n \n getRandomByLevelNum(levelNum) {\n"
  239. },
  240. {
  241. "date": 1694497087421,
  242. "content": "Index: \n===================================================================\n--- \n+++ \n@@ -147,10 +147,10 @@\n }\n \n startCountdown(time) {\n let cdTween = this.setTimeOutToTimes(1, time, this.node, () => {\n+ time--;\n this.timeLabel.string = time + \"\";\n- time--;\n if (time <= 0) {\n cdTween.stop();\n cdTween.removeSelf();\n cdTween = null;\n"
  243. },
  244. {
  245. "date": 1694497193819,
  246. "content": "Index: \n===================================================================\n--- \n+++ \n@@ -154,12 +154,18 @@\n cdTween.stop();\n cdTween.removeSelf();\n cdTween = null;\n this.maskNode.active = false;\n+ // 开始选择\n+ this.startBlink();\n }\n });\n }\n \n+ startBlink() {\n+ \n+ }\n+\n update(deltaTime: number) {\n \n }\n }\n"
  247. },
  248. {
  249. "date": 1694504412036,
  250. "content": "Index: \n===================================================================\n--- \n+++ \n@@ -122,9 +122,9 @@\n }\n \n clearAllRootChildren() {\n for (let i = 0; i < this.rootNodeList.length; i++) {\n- this.rootNodeList[i].destroyAllChildren();\n+ this.rootNodeList[i].children[1];\n }\n }\n \n setTimeOutToTimes(time: number, times: number, tagNode: Node, callback: any) {\n@@ -161,9 +161,9 @@\n });\n }\n \n startBlink() {\n- \n+\n }\n \n update(deltaTime: number) {\n \n"
  251. },
  252. {
  253. "date": 1694504583481,
  254. "content": "Index: \n===================================================================\n--- \n+++ \n@@ -161,9 +161,11 @@\n });\n }\n \n startBlink() {\n-\n+ for (let i = 0; i < this.positionList.length; i++) {\n+ this.rootNodeList[this.positionList[i]].emit(\"show\");\n+ }\n }\n \n update(deltaTime: number) {\n \n"
  255. },
  256. {
  257. "date": 1694504590639,
  258. "content": "Index: \n===================================================================\n--- \n+++ \n@@ -162,9 +162,9 @@\n }\n \n startBlink() {\n for (let i = 0; i < this.positionList.length; i++) {\n- this.rootNodeList[this.positionList[i]].emit(\"show\");\n+ this.rootNodeList[this.positionList[i]].emit(\"show\", i);\n }\n }\n \n update(deltaTime: number) {\n"
  259. },
  260. {
  261. "date": 1694504937829,
  262. "content": "Index: \n===================================================================\n--- \n+++ \n@@ -140,9 +140,9 @@\n \n hideFruit() {\n for (let i = 0; i < this.rootNodeList.length; i++) {\n if (this.rootNodeList[i].children.length > 0) {\n- this.rootNodeList[i].children[0].active = false;\n+ this.rootNodeList[i].children[1].active = false;\n }\n }\n }\n \n"
  263. },
  264. {
  265. "date": 1694504996184,
  266. "content": "Index: \n===================================================================\n--- \n+++ \n@@ -139,9 +139,9 @@\n }\n \n hideFruit() {\n for (let i = 0; i < this.rootNodeList.length; i++) {\n- if (this.rootNodeList[i].children.length > 0) {\n+ if (this.rootNodeList[i].children.length > 1) {\n this.rootNodeList[i].children[1].active = false;\n }\n }\n }\n"
  267. },
  268. {
  269. "date": 1694506540411,
  270. "content": "Index: \n===================================================================\n--- \n+++ \n@@ -161,11 +161,14 @@\n });\n }\n \n startBlink() {\n- for (let i = 0; i < this.positionList.length; i++) {\n- this.rootNodeList[this.positionList[i]].emit(\"show\", i);\n- }\n+ let tw = tween(this).call(() => {\n+ for (let i = 0; i < this.positionList.length; i++) {\n+ this.rootNodeList[this.positionList[i]].emit(\"show\", i);\n+ }\n+ }).delay(3);\n+ tween(this).repeatForever(tw).start();\n }\n \n update(deltaTime: number) {\n \n"
  271. },
  272. {
  273. "date": 1694507366946,
  274. "content": "Index: \n===================================================================\n--- \n+++ \n@@ -1,6 +1,7 @@\n import { _decorator, Component, Prefab, Node, instantiate, tween, Label } from 'cc';\n import { GameManager } from '../Manager/GameManager';\n+import { EventUtils } from './EventUtils';\n const { ccclass, property } = _decorator;\n \n @ccclass('GameMain')\n export class GameMain extends Component {\n@@ -16,14 +17,25 @@\n \n @property(Label)\n timeLabel: Label = null;\n \n+ @property(Node)\n+ refrigeratorNode: Node = null;\n \n+\n randomFruitList: number[] = [];\n selectFruitList: number[] = [];\n positionList: number[] = [];\n randomFruitCount: number = 0;\n selectCount: number = 0;\n+\n+ onLoad() {\n+ EventUtils.on(\"stopBlink\", this.onStopBlink, this);\n+ }\n+\n+ onDestroy() {\n+ EventUtils.off(\"stopBlink\", this.onStopBlink, this);\n+ }\n \n start() {\n \n }\n@@ -169,8 +181,15 @@\n }).delay(3);\n tween(this).repeatForever(tw).start();\n }\n \n+ onStopBlink() {\n+\n+ for (let i = 0; i < this.positionList.length; i++) {\n+ this.rootNodeList[this.positionList[i]].emit(\"show\", i);\n+ }\n+ }\n+\n update(deltaTime: number) {\n \n }\n }\n"
  275. },
  276. {
  277. "date": 1694507403343,
  278. "content": "Index: \n===================================================================\n--- \n+++ \n@@ -173,14 +173,14 @@\n });\n }\n \n startBlink() {\n- let tw = tween(this).call(() => {\n+ let tw = tween(this.refrigeratorNode).call(() => {\n for (let i = 0; i < this.positionList.length; i++) {\n this.rootNodeList[this.positionList[i]].emit(\"show\", i);\n }\n }).delay(3);\n- tween(this).repeatForever(tw).start();\n+ tween(this.refrigeratorNode).repeatForever(tw).start();\n }\n \n onStopBlink() {\n \n"
  279. },
  280. {
  281. "date": 1694507429743,
  282. "content": "Index: \n===================================================================\n--- \n+++ \n@@ -1,5 +1,5 @@\n-import { _decorator, Component, Prefab, Node, instantiate, tween, Label } from 'cc';\n+import { _decorator, Component, Prefab, Node, instantiate, tween, Label, Tween } from 'cc';\n import { GameManager } from '../Manager/GameManager';\n import { EventUtils } from './EventUtils';\n const { ccclass, property } = _decorator;\n \n@@ -182,11 +182,11 @@\n tween(this.refrigeratorNode).repeatForever(tw).start();\n }\n \n onStopBlink() {\n-\n+ Tween.stopAllByTarget(this.refrigeratorNode);\n for (let i = 0; i < this.positionList.length; i++) {\n- this.rootNodeList[this.positionList[i]].emit(\"show\", i);\n+ this.rootNodeList[this.positionList[i]].emit(\"hide\");\n }\n }\n \n update(deltaTime: number) {\n"
  283. },
  284. {
  285. "date": 1694508062810,
  286. "content": "Index: \n===================================================================\n--- \n+++ \n@@ -1,7 +1,8 @@\n import { _decorator, Component, Prefab, Node, instantiate, tween, Label, Tween } from 'cc';\n import { GameManager } from '../Manager/GameManager';\n import { EventUtils } from './EventUtils';\n+import { GameDataManager } from './GameDataManager';\n const { ccclass, property } = _decorator;\n \n @ccclass('GameMain')\n export class GameMain extends Component {\n@@ -36,29 +37,31 @@\n EventUtils.off(\"stopBlink\", this.onStopBlink, this);\n }\n \n start() {\n- \n+ GameDataManager.randomFruitList\n+ GameDataManager.selectFruitList\n+ GameDataManager.positionList\n }\n \n /**\n * 初始化逻辑\n * 每次GameManager.StartGame()时都会调用\n */\n initUI() { \n- this.randomFruitList = [];\n- this.selectFruitList = [];\n- this.positionList = [];\n+ GameDataManager.randomFruitList = [];\n+ GameDataManager.selectFruitList = [];\n+ GameDataManager.positionList = [];\n let levelNum = 1;\n let time = 3;\n this.getRandomByLevelNum(levelNum);\n- this.randomFruitList = this.randomNumbers(this.randomFruitCount);\n- this.selectFruitList = this.randomSelectFruit(levelNum);\n- this.positionList = this.randomPosition(this.randomFruitCount);\n+ GameDataManager.randomFruitList = this.randomNumbers(this.randomFruitCount);\n+ GameDataManager.selectFruitList = this.randomSelectFruit(levelNum);\n+ GameDataManager.positionList = this.randomPosition(this.randomFruitCount);\n \n- console.log(\"=========== randomList =\", this.randomFruitList);\n- console.log(\"=========== selectFruitList =\", this.selectFruitList);\n- console.log(\"=========== positionList =\", this.positionList);\n+ console.log(\"=========== randomList =\", GameDataManager.randomFruitList);\n+ console.log(\"=========== selectFruitList =\", GameDataManager.selectFruitList);\n+ console.log(\"=========== positionList =\", GameDataManager.positionList);\n \n this.generateFruits();\n setTimeout(() => {\n this.hideFruit();\n@@ -98,19 +101,19 @@\n \n randomSelectFruit(levelNum: number) {\n let numbers: number[] = [];\n if (levelNum < 3) {\n- numbers.push(this.randomFruitList[Math.floor(Math.random() * this.randomFruitList.length)]);\n+ numbers.push(GameDataManager.randomFruitList[Math.floor(Math.random() * GameDataManager.randomFruitList.length)]);\n } else {\n- let firstIndex = Math.floor(Math.random() * this.randomFruitList.length);\n+ let firstIndex = Math.floor(Math.random() * GameDataManager.randomFruitList.length);\n let twoIndex = -1;\n while (twoIndex == -1) {\n- let index = Math.floor(Math.random() * this.randomFruitList.length);\n+ let index = Math.floor(Math.random() * GameDataManager.randomFruitList.length);\n if (index != firstIndex) {\n twoIndex = index;\n }\n }\n- numbers.push(this.randomFruitList[firstIndex], this.randomFruitList[twoIndex]);\n+ numbers.push(GameDataManager.randomFruitList[firstIndex], GameDataManager.randomFruitList[twoIndex]);\n }\n return numbers;\n }\n \n@@ -126,11 +129,11 @@\n }\n \n generateFruits() {\n this.clearAllRootChildren();\n- for (let i = 0; i < this.randomFruitList.length; i++) {\n- let item = instantiate(this.itemPrefabList[this.randomFruitList[i] - 1]);\n- this.rootNodeList[this.positionList[i]].addChild(item);\n+ for (let i = 0; i < GameDataManager.randomFruitList.length; i++) {\n+ let item = instantiate(this.itemPrefabList[GameDataManager.randomFruitList[i] - 1]);\n+ this.rootNodeList[GameDataManager.positionList[i]].addChild(item);\n }\n }\n \n clearAllRootChildren() {\n@@ -174,19 +177,19 @@\n }\n \n startBlink() {\n let tw = tween(this.refrigeratorNode).call(() => {\n- for (let i = 0; i < this.positionList.length; i++) {\n- this.rootNodeList[this.positionList[i]].emit(\"show\", i);\n+ for (let i = 0; i < GameDataManager.positionList.length; i++) {\n+ this.rootNodeList[GameDataManager.positionList[i]].emit(\"show\", i);\n }\n }).delay(3);\n tween(this.refrigeratorNode).repeatForever(tw).start();\n }\n \n onStopBlink() {\n Tween.stopAllByTarget(this.refrigeratorNode);\n- for (let i = 0; i < this.positionList.length; i++) {\n- this.rootNodeList[this.positionList[i]].emit(\"hide\");\n+ for (let i = 0; i < GameDataManager.positionList.length; i++) {\n+ this.rootNodeList[GameDataManager.positionList[i]].emit(\"hide\");\n }\n }\n \n update(deltaTime: number) {\n"
  287. },
  288. {
  289. "date": 1694508073197,
  290. "content": "Index: \n===================================================================\n--- \n+++ \n@@ -37,11 +37,9 @@\n EventUtils.off(\"stopBlink\", this.onStopBlink, this);\n }\n \n start() {\n- GameDataManager.randomFruitList\n- GameDataManager.selectFruitList\n- GameDataManager.positionList\n+ \n }\n \n /**\n * 初始化逻辑\n"
  291. },
  292. {
  293. "date": 1694508146359,
  294. "content": "Index: \n===================================================================\n--- \n+++ \n@@ -48,9 +48,9 @@\n initUI() { \n GameDataManager.randomFruitList = [];\n GameDataManager.selectFruitList = [];\n GameDataManager.positionList = [];\n- let levelNum = 1;\n+ let levelNum = 3;\n let time = 3;\n this.getRandomByLevelNum(levelNum);\n GameDataManager.randomFruitList = this.randomNumbers(this.randomFruitCount);\n GameDataManager.selectFruitList = this.randomSelectFruit(levelNum);\n"
  295. },
  296. {
  297. "date": 1694508419050,
  298. "content": "Index: \n===================================================================\n--- \n+++ \n@@ -178,9 +178,9 @@\n let tw = tween(this.refrigeratorNode).call(() => {\n for (let i = 0; i < GameDataManager.positionList.length; i++) {\n this.rootNodeList[GameDataManager.positionList[i]].emit(\"show\", i);\n }\n- }).delay(3);\n+ }).delay(7);\n tween(this.refrigeratorNode).repeatForever(tw).start();\n }\n \n onStopBlink() {\n"
  299. },
  300. {
  301. "date": 1694508469626,
  302. "content": "Index: \n===================================================================\n--- \n+++ \n@@ -178,9 +178,9 @@\n let tw = tween(this.refrigeratorNode).call(() => {\n for (let i = 0; i < GameDataManager.positionList.length; i++) {\n this.rootNodeList[GameDataManager.positionList[i]].emit(\"show\", i);\n }\n- }).delay(7);\n+ }).delay(GameDataManager.positionList.length);\n tween(this.refrigeratorNode).repeatForever(tw).start();\n }\n \n onStopBlink() {\n"
  303. },
  304. {
  305. "date": 1694508670502,
  306. "content": "Index: \n===================================================================\n--- \n+++ \n@@ -169,8 +169,9 @@\n cdTween = null;\n this.maskNode.active = false;\n // 开始选择\n this.startBlink();\n+ this.startSelect();\n }\n });\n }\n \n@@ -189,8 +190,12 @@\n this.rootNodeList[GameDataManager.positionList[i]].emit(\"hide\");\n }\n }\n \n+ startSelect() {\n+ \n+ }\n+\n update(deltaTime: number) {\n \n }\n }\n"
  307. },
  308. {
  309. "date": 1694508685630,
  310. "content": "Index: \n===================================================================\n--- \n+++ \n@@ -48,8 +48,9 @@\n initUI() { \n GameDataManager.randomFruitList = [];\n GameDataManager.selectFruitList = [];\n GameDataManager.positionList = [];\n+ GameDataManager.currentSelect = -1;\n let levelNum = 3;\n let time = 3;\n this.getRandomByLevelNum(levelNum);\n GameDataManager.randomFruitList = this.randomNumbers(this.randomFruitCount);\n@@ -191,9 +192,9 @@\n }\n }\n \n startSelect() {\n- \n+\n }\n \n update(deltaTime: number) {\n \n"
  311. },
  312. {
  313. "date": 1694508866939,
  314. "content": "Index: \n===================================================================\n--- \n+++ \n@@ -44,9 +44,9 @@\n /**\n * 初始化逻辑\n * 每次GameManager.StartGame()时都会调用\n */\n- initUI() { \n+ initUI(gameData) { \n GameDataManager.randomFruitList = [];\n GameDataManager.selectFruitList = [];\n GameDataManager.positionList = [];\n GameDataManager.currentSelect = -1;\n"
  315. },
  316. {
  317. "date": 1694508895885,
  318. "content": "Index: \n===================================================================\n--- \n+++ \n@@ -49,10 +49,10 @@\n GameDataManager.randomFruitList = [];\n GameDataManager.selectFruitList = [];\n GameDataManager.positionList = [];\n GameDataManager.currentSelect = -1;\n- let levelNum = 3;\n- let time = 3;\n+ let levelNum = gameData[\"id\"] || 1;\n+ let time = gameData[\"time\"] || 3;\n this.getRandomByLevelNum(levelNum);\n GameDataManager.randomFruitList = this.randomNumbers(this.randomFruitCount);\n GameDataManager.selectFruitList = this.randomSelectFruit(levelNum);\n GameDataManager.positionList = this.randomPosition(this.randomFruitCount);\n"
  319. },
  320. {
  321. "date": 1694509175678,
  322. "content": "Index: \n===================================================================\n--- \n+++ \n@@ -44,9 +44,10 @@\n /**\n * 初始化逻辑\n * 每次GameManager.StartGame()时都会调用\n */\n- initUI(gameData) { \n+ initUI(gameData) {\n+ this.onStopBlink();\n GameDataManager.randomFruitList = [];\n GameDataManager.selectFruitList = [];\n GameDataManager.positionList = [];\n GameDataManager.currentSelect = -1;\n"
  323. },
  324. {
  325. "date": 1694509206806,
  326. "content": "Index: \n===================================================================\n--- \n+++ \n@@ -46,8 +46,9 @@\n * 每次GameManager.StartGame()时都会调用\n */\n initUI(gameData) {\n this.onStopBlink();\n+ this.clearAllRootChildren();\n GameDataManager.randomFruitList = [];\n GameDataManager.selectFruitList = [];\n GameDataManager.positionList = [];\n GameDataManager.currentSelect = -1;\n"
  327. },
  328. {
  329. "date": 1694509215283,
  330. "content": "Index: \n===================================================================\n--- \n+++ \n@@ -129,9 +129,9 @@\n return numbers;\n }\n \n generateFruits() {\n- this.clearAllRootChildren();\n+ // this.clearAllRootChildren();\n for (let i = 0; i < GameDataManager.randomFruitList.length; i++) {\n let item = instantiate(this.itemPrefabList[GameDataManager.randomFruitList[i] - 1]);\n this.rootNodeList[GameDataManager.positionList[i]].addChild(item);\n }\n"
  331. },
  332. {
  333. "date": 1694509348384,
  334. "content": "Index: \n===================================================================\n--- \n+++ \n@@ -53,8 +53,9 @@\n GameDataManager.positionList = [];\n GameDataManager.currentSelect = -1;\n let levelNum = gameData[\"id\"] || 1;\n let time = gameData[\"time\"] || 3;\n+ let countdownTime = gameData[\"countdown\"] || 3;\n this.getRandomByLevelNum(levelNum);\n GameDataManager.randomFruitList = this.randomNumbers(this.randomFruitCount);\n GameDataManager.selectFruitList = this.randomSelectFruit(levelNum);\n GameDataManager.positionList = this.randomPosition(this.randomFruitCount);\n"
  335. },
  336. {
  337. "date": 1694509387704,
  338. "content": "Index: \n===================================================================\n--- \n+++ \n@@ -67,11 +67,10 @@\n this.generateFruits();\n setTimeout(() => {\n this.hideFruit();\n this.maskNode.active = true;\n- let time = 3;\n this.timeLabel.string = time + \"\";\n- this.startCountdown(time);\n+ this.startCountdown(countdownTime);\n }, time * 1000);\n }\n \n getRandomByLevelNum(levelNum) {\n"
  339. },
  340. {
  341. "date": 1694509528332,
  342. "content": "Index: \n===================================================================\n--- \n+++ \n@@ -138,9 +138,9 @@\n }\n \n clearAllRootChildren() {\n for (let i = 0; i < this.rootNodeList.length; i++) {\n- this.rootNodeList[i].children[1];\n+ this.rootNodeList[i].children[1].destroy();\n }\n }\n \n setTimeOutToTimes(time: number, times: number, tagNode: Node, callback: any) {\n"
  343. },
  344. {
  345. "date": 1694509553220,
  346. "content": "Index: \n===================================================================\n--- \n+++ \n@@ -129,9 +129,8 @@\n return numbers;\n }\n \n generateFruits() {\n- // this.clearAllRootChildren();\n for (let i = 0; i < GameDataManager.randomFruitList.length; i++) {\n let item = instantiate(this.itemPrefabList[GameDataManager.randomFruitList[i] - 1]);\n this.rootNodeList[GameDataManager.positionList[i]].addChild(item);\n }\n"
  347. },
  348. {
  349. "date": 1694509648784,
  350. "content": "Index: \n===================================================================\n--- \n+++ \n@@ -27,8 +27,11 @@\n selectFruitList: number[] = [];\n positionList: number[] = [];\n randomFruitCount: number = 0;\n selectCount: number = 0;\n+ waitingTime: number = 0;\n+ countdownTime: number = 0;\n+ levelNum: number = 0;\n \n onLoad() {\n EventUtils.on(\"stopBlink\", this.onStopBlink, this);\n }\n"
  351. },
  352. {
  353. "date": 1694509668059,
  354. "content": "Index: \n===================================================================\n--- \n+++ \n@@ -54,14 +54,14 @@\n GameDataManager.randomFruitList = [];\n GameDataManager.selectFruitList = [];\n GameDataManager.positionList = [];\n GameDataManager.currentSelect = -1;\n- let levelNum = gameData[\"id\"] || 1;\n+ this.levelNum = gameData[\"id\"] || 1;\n let time = gameData[\"time\"] || 3;\n let countdownTime = gameData[\"countdown\"] || 3;\n- this.getRandomByLevelNum(levelNum);\n+ this.getRandomByLevelNum(this.levelNum);\n GameDataManager.randomFruitList = this.randomNumbers(this.randomFruitCount);\n- GameDataManager.selectFruitList = this.randomSelectFruit(levelNum);\n+ GameDataManager.selectFruitList = this.randomSelectFruit(this.levelNum);\n GameDataManager.positionList = this.randomPosition(this.randomFruitCount);\n \n console.log(\"=========== randomList =\", GameDataManager.randomFruitList);\n console.log(\"=========== selectFruitList =\", GameDataManager.selectFruitList);\n"
  355. },
  356. {
  357. "date": 1694509692555,
  358. "content": "Index: \n===================================================================\n--- \n+++ \n@@ -55,9 +55,9 @@\n GameDataManager.selectFruitList = [];\n GameDataManager.positionList = [];\n GameDataManager.currentSelect = -1;\n this.levelNum = gameData[\"id\"] || 1;\n- let time = gameData[\"time\"] || 3;\n+ this.waitingTime = gameData[\"time\"] || 3;\n let countdownTime = gameData[\"countdown\"] || 3;\n this.getRandomByLevelNum(this.levelNum);\n GameDataManager.randomFruitList = this.randomNumbers(this.randomFruitCount);\n GameDataManager.selectFruitList = this.randomSelectFruit(this.levelNum);\n@@ -70,11 +70,11 @@\n this.generateFruits();\n setTimeout(() => {\n this.hideFruit();\n this.maskNode.active = true;\n- this.timeLabel.string = time + \"\";\n+ this.timeLabel.string = this.waitingTime + \"\";\n this.startCountdown(countdownTime);\n- }, time * 1000);\n+ }, this.waitingTime * 1000);\n }\n \n getRandomByLevelNum(levelNum) {\n if (levelNum == 1) {\n"
  359. },
  360. {
  361. "date": 1694509705835,
  362. "content": "Index: \n===================================================================\n--- \n+++ \n@@ -56,9 +56,9 @@\n GameDataManager.positionList = [];\n GameDataManager.currentSelect = -1;\n this.levelNum = gameData[\"id\"] || 1;\n this.waitingTime = gameData[\"time\"] || 3;\n- let countdownTime = gameData[\"countdown\"] || 3;\n+ this.countdownTime = gameData[\"countdown\"] || 3;\n this.getRandomByLevelNum(this.levelNum);\n GameDataManager.randomFruitList = this.randomNumbers(this.randomFruitCount);\n GameDataManager.selectFruitList = this.randomSelectFruit(this.levelNum);\n GameDataManager.positionList = this.randomPosition(this.randomFruitCount);\n@@ -71,9 +71,9 @@\n setTimeout(() => {\n this.hideFruit();\n this.maskNode.active = true;\n this.timeLabel.string = this.waitingTime + \"\";\n- this.startCountdown(countdownTime);\n+ this.startCountdown(this.countdownTime);\n }, this.waitingTime * 1000);\n }\n \n getRandomByLevelNum(levelNum) {\n"
  363. },
  364. {
  365. "date": 1694509776440,
  366. "content": "Index: \n===================================================================\n--- \n+++ \n@@ -196,9 +196,9 @@\n }\n }\n \n startSelect() {\n-\n+ GameDataManager.currentSelect = this.selectFruitList[0];\n }\n \n update(deltaTime: number) {\n \n"
  367. },
  368. {
  369. "date": 1694510172124,
  370. "content": "Index: \n===================================================================\n--- \n+++ \n@@ -1,5 +1,7 @@\n import { _decorator, Component, Prefab, Node, instantiate, tween, Label, Tween } from 'cc';\n+import { EventCustom } from '../Common/EventCustom';\n+import { Global } from '../Common/Global';\n import { GameManager } from '../Manager/GameManager';\n import { EventUtils } from './EventUtils';\n import { GameDataManager } from './GameDataManager';\n const { ccclass, property } = _decorator;\n@@ -199,10 +201,11 @@\n startSelect() {\n GameDataManager.currentSelect = this.selectFruitList[0];\n }\n \n- update(deltaTime: number) {\n-\n+ showTips(str) {\n+ let tip = new EventCustom(Global.EventType_ShowTips, true, str);\n+ this.node.dispatchEvent(tip);\n }\n }\n \n \n"
  371. },
  372. {
  373. "date": 1694510642790,
  374. "content": "Index: \n===================================================================\n--- \n+++ \n@@ -199,8 +199,10 @@\n }\n \n startSelect() {\n GameDataManager.currentSelect = this.selectFruitList[0];\n+ let name = GameDataManager.fruitNameList[GameDataManager.currentSelect - 1];\n+ this.showTips(\"请点击\" + name + \"出现的地方\");\n }\n \n showTips(str) {\n let tip = new EventCustom(Global.EventType_ShowTips, true, str);\n"
  375. },
  376. {
  377. "date": 1694510732660,
  378. "content": "Index: \n===================================================================\n--- \n+++ \n@@ -142,9 +142,11 @@\n }\n \n clearAllRootChildren() {\n for (let i = 0; i < this.rootNodeList.length; i++) {\n- this.rootNodeList[i].children[1].destroy();\n+ if (this.rootNodeList[i].children[1]) {\n+ this.rootNodeList[i].children[1].destroy();\n+ }\n }\n }\n \n setTimeOutToTimes(time: number, times: number, tagNode: Node, callback: any) {\n"
  379. },
  380. {
  381. "date": 1694511006331,
  382. "content": "Index: \n===================================================================\n--- \n+++ \n@@ -201,8 +201,9 @@\n }\n \n startSelect() {\n GameDataManager.currentSelect = this.selectFruitList[0];\n+ console.log(\"\")\n let name = GameDataManager.fruitNameList[GameDataManager.currentSelect - 1];\n this.showTips(\"请点击\" + name + \"出现的地方\");\n }\n \n"
  383. },
  384. {
  385. "date": 1694511052896,
  386. "content": "Index: \n===================================================================\n--- \n+++ \n@@ -201,9 +201,9 @@\n }\n \n startSelect() {\n GameDataManager.currentSelect = this.selectFruitList[0];\n- console.log(\"\")\n+ console.log(\"```````````` 选择 =\", GameDataManager.currentSelect);\n let name = GameDataManager.fruitNameList[GameDataManager.currentSelect - 1];\n this.showTips(\"请点击\" + name + \"出现的地方\");\n }\n \n"
  387. },
  388. {
  389. "date": 1694511123812,
  390. "content": "Index: \n===================================================================\n--- \n+++ \n@@ -200,9 +200,9 @@\n }\n }\n \n startSelect() {\n- GameDataManager.currentSelect = this.selectFruitList[0];\n+ GameDataManager.currentSelect = GameDataManager.selectFruitList[0];\n console.log(\"```````````` 选择 =\", GameDataManager.currentSelect);\n let name = GameDataManager.fruitNameList[GameDataManager.currentSelect - 1];\n this.showTips(\"请点击\" + name + \"出现的地方\");\n }\n"
  391. },
  392. {
  393. "date": 1694511867289,
  394. "content": "Index: \n===================================================================\n--- \n+++ \n@@ -24,19 +24,20 @@\n @property(Node)\n refrigeratorNode: Node = null;\n \n \n- randomFruitList: number[] = [];\n- selectFruitList: number[] = [];\n- positionList: number[] = [];\n+ // randomFruitList: number[] = [];\n+ // selectFruitList: number[] = [];\n+ // positionList: number[] = [];\n randomFruitCount: number = 0;\n selectCount: number = 0;\n waitingTime: number = 0;\n countdownTime: number = 0;\n levelNum: number = 0;\n \n onLoad() {\n EventUtils.on(\"stopBlink\", this.onStopBlink, this);\n+\n }\n \n onDestroy() {\n EventUtils.off(\"stopBlink\", this.onStopBlink, this);\n"
  395. },
  396. {
  397. "date": 1694511969024,
  398. "content": "Index: \n===================================================================\n--- \n+++ \n@@ -35,13 +35,14 @@\n levelNum: number = 0;\n \n onLoad() {\n EventUtils.on(\"stopBlink\", this.onStopBlink, this);\n-\n+ EventUtils.on(\"gameResult\", this.onGameResult, this);\n }\n \n onDestroy() {\n EventUtils.off(\"stopBlink\", this.onStopBlink, this);\n+ EventUtils.off(\"gameResult\", this.onGameResult, this);\n }\n \n start() {\n \n@@ -207,8 +208,12 @@\n let name = GameDataManager.fruitNameList[GameDataManager.currentSelect - 1];\n this.showTips(\"请点击\" + name + \"出现的地方\");\n }\n \n+ onGameResult(isCorrect, frultType) {\n+\n+ }\n+\n showTips(str) {\n let tip = new EventCustom(Global.EventType_ShowTips, true, str);\n this.node.dispatchEvent(tip);\n }\n"
  399. },
  400. {
  401. "date": 1694511982009,
  402. "content": "Index: \n===================================================================\n--- \n+++ \n@@ -208,9 +208,9 @@\n let name = GameDataManager.fruitNameList[GameDataManager.currentSelect - 1];\n this.showTips(\"请点击\" + name + \"出现的地方\");\n }\n \n- onGameResult(isCorrect, frultType) {\n+ onGameResult(isCorrect, fruitType) {\n \n }\n \n showTips(str) {\n"
  403. },
  404. {
  405. "date": 1694512012640,
  406. "content": "Index: \n===================================================================\n--- \n+++ \n@@ -209,9 +209,13 @@\n this.showTips(\"请点击\" + name + \"出现的地方\");\n }\n \n onGameResult(isCorrect, fruitType) {\n-\n+ if (isCorrect) {\n+ \n+ } else {\n+ \n+ }\n }\n \n showTips(str) {\n let tip = new EventCustom(Global.EventType_ShowTips, true, str);\n"
  407. },
  408. {
  409. "date": 1694512018549,
  410. "content": "Index: \n===================================================================\n--- \n+++ \n@@ -203,18 +203,17 @@\n }\n \n startSelect() {\n GameDataManager.currentSelect = GameDataManager.selectFruitList[0];\n- console.log(\"```````````` 选择 =\", GameDataManager.currentSelect);\n let name = GameDataManager.fruitNameList[GameDataManager.currentSelect - 1];\n this.showTips(\"请点击\" + name + \"出现的地方\");\n }\n \n onGameResult(isCorrect, fruitType) {\n if (isCorrect) {\n \n } else {\n- \n+\n }\n }\n \n showTips(str) {\n"
  411. },
  412. {
  413. "date": 1694512737269,
  414. "content": "Index: \n===================================================================\n--- \n+++ \n@@ -23,9 +23,12 @@\n \n @property(Node)\n refrigeratorNode: Node = null;\n \n+ @property(Node)\n+ resultMaskNode: Node = null;\n \n+\n // randomFruitList: number[] = [];\n // selectFruitList: number[] = [];\n // positionList: number[] = [];\n randomFruitCount: number = 0;\n"
  415. },
  416. {
  417. "date": 1694512787399,
  418. "content": "Index: \n===================================================================\n--- \n+++ \n@@ -211,8 +211,10 @@\n this.showTips(\"请点击\" + name + \"出现的地方\");\n }\n \n onGameResult(isCorrect, fruitType) {\n+ this.resultMaskNode.active = true;\n+ this.refrigeratorNode.emit(\"init\", isCorrect);\n if (isCorrect) {\n \n } else {\n \n"
  419. },
  420. {
  421. "date": 1694512818783,
  422. "content": "Index: \n===================================================================\n--- \n+++ \n@@ -213,13 +213,15 @@\n \n onGameResult(isCorrect, fruitType) {\n this.resultMaskNode.active = true;\n this.refrigeratorNode.emit(\"init\", isCorrect);\n- if (isCorrect) {\n+ setTimeout(() => {\n+ if (isCorrect) {\n \n- } else {\n-\n- }\n+ } else {\n+ \n+ }\n+ }, 0.5 * 1000);\n }\n \n showTips(str) {\n let tip = new EventCustom(Global.EventType_ShowTips, true, str);\n"
  423. },
  424. {
  425. "date": 1694513571095,
  426. "content": "Index: \n===================================================================\n--- \n+++ \n@@ -211,9 +211,8 @@\n this.showTips(\"请点击\" + name + \"出现的地方\");\n }\n \n onGameResult(isCorrect, fruitType) {\n- this.resultMaskNode.active = true;\n this.refrigeratorNode.emit(\"init\", isCorrect);\n setTimeout(() => {\n if (isCorrect) {\n \n"
  427. },
  428. {
  429. "date": 1694513897743,
  430. "content": "Index: \n===================================================================\n--- \n+++ \n@@ -212,15 +212,15 @@\n }\n \n onGameResult(isCorrect, fruitType) {\n this.refrigeratorNode.emit(\"init\", isCorrect);\n- setTimeout(() => {\n- if (isCorrect) {\n+ // setTimeout(() => {\n+ // if (isCorrect) {\n \n- } else {\n+ // } else {\n \n- }\n- }, 0.5 * 1000);\n+ // }\n+ // }, 0.5 * 1000);\n }\n \n showTips(str) {\n let tip = new EventCustom(Global.EventType_ShowTips, true, str);\n"
  431. },
  432. {
  433. "date": 1694513922683,
  434. "content": "Index: \n===================================================================\n--- \n+++ \n@@ -211,9 +211,9 @@\n this.showTips(\"请点击\" + name + \"出现的地方\");\n }\n \n onGameResult(isCorrect, fruitType) {\n- this.refrigeratorNode.emit(\"init\", isCorrect);\n+ this.resultMaskNode.emit(\"init\", isCorrect);\n // setTimeout(() => {\n // if (isCorrect) {\n \n // } else {\n"
  435. },
  436. {
  437. "date": 1694514148438,
  438. "content": "Index: \n===================================================================\n--- \n+++ \n@@ -198,12 +198,12 @@\n tween(this.refrigeratorNode).repeatForever(tw).start();\n }\n \n onStopBlink() {\n- Tween.stopAllByTarget(this.refrigeratorNode);\n- for (let i = 0; i < GameDataManager.positionList.length; i++) {\n- this.rootNodeList[GameDataManager.positionList[i]].emit(\"hide\");\n- }\n+ // Tween.stopAllByTarget(this.refrigeratorNode);\n+ // for (let i = 0; i < GameDataManager.positionList.length; i++) {\n+ // this.rootNodeList[GameDataManager.positionList[i]].emit(\"hide\");\n+ // }\n }\n \n startSelect() {\n GameDataManager.currentSelect = GameDataManager.selectFruitList[0];\n"
  439. },
  440. {
  441. "date": 1694514206318,
  442. "content": "Index: \n===================================================================\n--- \n+++ \n@@ -198,12 +198,12 @@\n tween(this.refrigeratorNode).repeatForever(tw).start();\n }\n \n onStopBlink() {\n- // Tween.stopAllByTarget(this.refrigeratorNode);\n- // for (let i = 0; i < GameDataManager.positionList.length; i++) {\n- // this.rootNodeList[GameDataManager.positionList[i]].emit(\"hide\");\n- // }\n+ Tween.stopAllByTarget(this.refrigeratorNode);\n+ for (let i = 0; i < GameDataManager.positionList.length; i++) {\n+ this.rootNodeList[GameDataManager.positionList[i]].emit(\"hide\");\n+ }\n }\n \n startSelect() {\n GameDataManager.currentSelect = GameDataManager.selectFruitList[0];\n"
  443. },
  444. {
  445. "date": 1694514544847,
  446. "content": "Index: \n===================================================================\n--- \n+++ \n@@ -211,16 +211,14 @@\n this.showTips(\"请点击\" + name + \"出现的地方\");\n }\n \n onGameResult(isCorrect, fruitType) {\n- this.resultMaskNode.emit(\"init\", isCorrect);\n- // setTimeout(() => {\n- // if (isCorrect) {\n+ EventUtils.dispatchEvent(\"SingleResult\", isCorrect)\n+ if (isCorrect) {\n \n- // } else {\n- \n- // }\n- // }, 0.5 * 1000);\n+ } else {\n+\n+ }\n }\n \n showTips(str) {\n let tip = new EventCustom(Global.EventType_ShowTips, true, str);\n"
  447. },
  448. {
  449. "date": 1694514836285,
  450. "content": "Index: \n===================================================================\n--- \n+++ \n@@ -213,9 +213,9 @@\n \n onGameResult(isCorrect, fruitType) {\n EventUtils.dispatchEvent(\"SingleResult\", isCorrect)\n if (isCorrect) {\n- \n+ GameManager.getInstance().addScore(20);\n } else {\n \n }\n }\n"
  451. },
  452. {
  453. "date": 1694514957309,
  454. "content": "Index: \n===================================================================\n--- \n+++ \n@@ -55,14 +55,14 @@\n * 初始化逻辑\n * 每次GameManager.StartGame()时都会调用\n */\n initUI(gameData) {\n- this.onStopBlink();\n- this.clearAllRootChildren();\n- GameDataManager.randomFruitList = [];\n- GameDataManager.selectFruitList = [];\n- GameDataManager.positionList = [];\n- GameDataManager.currentSelect = -1;\n+ // this.onStopBlink();\n+ // this.clearAllRootChildren();\n+ // GameDataManager.randomFruitList = [];\n+ // GameDataManager.selectFruitList = [];\n+ // GameDataManager.positionList = [];\n+ // GameDataManager.currentSelect = -1;\n this.levelNum = gameData[\"id\"] || 1;\n this.waitingTime = gameData[\"time\"] || 3;\n this.countdownTime = gameData[\"countdown\"] || 3;\n this.getRandomByLevelNum(this.levelNum);\n@@ -82,8 +82,17 @@\n this.startCountdown(this.countdownTime);\n }, this.waitingTime * 1000);\n }\n \n+ createLevelData() {\n+ this.onStopBlink();\n+ this.clearAllRootChildren();\n+ GameDataManager.randomFruitList = [];\n+ GameDataManager.selectFruitList = [];\n+ GameDataManager.positionList = [];\n+ GameDataManager.currentSelect = -1;\n+ }\n+\n getRandomByLevelNum(levelNum) {\n if (levelNum == 1) {\n this.randomFruitCount = 3;\n } else if (levelNum === 2) {\n@@ -214,8 +223,11 @@\n onGameResult(isCorrect, fruitType) {\n EventUtils.dispatchEvent(\"SingleResult\", isCorrect)\n if (isCorrect) {\n GameManager.getInstance().addScore(20);\n+ setTimeout(() => {\n+\n+ }, 1 * 1000);\n } else {\n \n }\n }\n"
  455. },
  456. {
  457. "date": 1694514972831,
  458. "content": "Index: \n===================================================================\n--- \n+++ \n@@ -64,8 +64,19 @@\n // GameDataManager.currentSelect = -1;\n this.levelNum = gameData[\"id\"] || 1;\n this.waitingTime = gameData[\"time\"] || 3;\n this.countdownTime = gameData[\"countdown\"] || 3;\n+ \n+ }\n+\n+ createLevelData() {\n+ this.onStopBlink();\n+ this.clearAllRootChildren();\n+ GameDataManager.randomFruitList = [];\n+ GameDataManager.selectFruitList = [];\n+ GameDataManager.positionList = [];\n+ GameDataManager.currentSelect = -1;\n+\n this.getRandomByLevelNum(this.levelNum);\n GameDataManager.randomFruitList = this.randomNumbers(this.randomFruitCount);\n GameDataManager.selectFruitList = this.randomSelectFruit(this.levelNum);\n GameDataManager.positionList = this.randomPosition(this.randomFruitCount);\n@@ -82,17 +93,8 @@\n this.startCountdown(this.countdownTime);\n }, this.waitingTime * 1000);\n }\n \n- createLevelData() {\n- this.onStopBlink();\n- this.clearAllRootChildren();\n- GameDataManager.randomFruitList = [];\n- GameDataManager.selectFruitList = [];\n- GameDataManager.positionList = [];\n- GameDataManager.currentSelect = -1;\n- }\n-\n getRandomByLevelNum(levelNum) {\n if (levelNum == 1) {\n this.randomFruitCount = 3;\n } else if (levelNum === 2) {\n"
  459. },
  460. {
  461. "date": 1694514989813,
  462. "content": "Index: \n===================================================================\n--- \n+++ \n@@ -64,8 +64,9 @@\n // GameDataManager.currentSelect = -1;\n this.levelNum = gameData[\"id\"] || 1;\n this.waitingTime = gameData[\"time\"] || 3;\n this.countdownTime = gameData[\"countdown\"] || 3;\n+ this.createLevelData();\n \n }\n \n createLevelData() {\n"
  463. },
  464. {
  465. "date": 1694515007775,
  466. "content": "Index: \n===================================================================\n--- \n+++ \n@@ -227,9 +227,9 @@\n EventUtils.dispatchEvent(\"SingleResult\", isCorrect)\n if (isCorrect) {\n GameManager.getInstance().addScore(20);\n setTimeout(() => {\n-\n+ this.createLevelData();\n }, 1 * 1000);\n } else {\n \n }\n"
  467. },
  468. {
  469. "date": 1694515298488,
  470. "content": "Index: \n===================================================================\n--- \n+++ \n@@ -228,11 +228,13 @@\n if (isCorrect) {\n GameManager.getInstance().addScore(20);\n setTimeout(() => {\n this.createLevelData();\n- }, 1 * 1000);\n+ }, 1.5 * 1000);\n } else {\n-\n+ setTimeout(() => {\n+ this.createLevelData();\n+ }, 1.5 * 1000);\n }\n }\n \n showTips(str) {\n"
  471. },
  472. {
  473. "date": 1694515598350,
  474. "content": "Index: \n===================================================================\n--- \n+++ \n@@ -217,20 +217,29 @@\n }\n }\n \n startSelect() {\n- GameDataManager.currentSelect = GameDataManager.selectFruitList[0];\n- let name = GameDataManager.fruitNameList[GameDataManager.currentSelect - 1];\n- this.showTips(\"请点击\" + name + \"出现的地方\");\n+ if (GameDataManager.selectFruitList.length > 0) {\n+ GameDataManager.currentSelect = GameDataManager.selectFruitList[0];\n+ let name = GameDataManager.fruitNameList[GameDataManager.currentSelect - 1];\n+ GameDataManager.selectFruitList.slice(0, 1);\n+ this.showTips(\"请点击\" + name + \"出现的地方\");\n+ } else {\n+\n+ }\n }\n \n onGameResult(isCorrect, fruitType) {\n EventUtils.dispatchEvent(\"SingleResult\", isCorrect)\n if (isCorrect) {\n- GameManager.getInstance().addScore(20);\n- setTimeout(() => {\n- this.createLevelData();\n- }, 1.5 * 1000);\n+ if (this.levelNum < 3) {\n+ GameManager.getInstance().addScore(20);\n+ setTimeout(() => {\n+ this.createLevelData();\n+ }, 1.5 * 1000);\n+ } else {\n+ this.startSelect();\n+ }\n } else {\n setTimeout(() => {\n this.createLevelData();\n }, 1.5 * 1000);\n"
  475. },
  476. {
  477. "date": 1694515701606,
  478. "content": "Index: \n===================================================================\n--- \n+++ \n@@ -236,9 +236,12 @@\n setTimeout(() => {\n this.createLevelData();\n }, 1.5 * 1000);\n } else {\n- this.startSelect();\n+ GameManager.getInstance().addScore(10);\n+ setTimeout(() => {\n+ this.startSelect();\n+ }, 1.5 * 1000);\n }\n } else {\n setTimeout(() => {\n this.createLevelData();\n"
  479. },
  480. {
  481. "date": 1694515719920,
  482. "content": "Index: \n===================================================================\n--- \n+++ \n@@ -223,9 +223,9 @@\n let name = GameDataManager.fruitNameList[GameDataManager.currentSelect - 1];\n GameDataManager.selectFruitList.slice(0, 1);\n this.showTips(\"请点击\" + name + \"出现的地方\");\n } else {\n-\n+ this.createLevelData();\n }\n }\n \n onGameResult(isCorrect, fruitType) {\n"
  483. },
  484. {
  485. "date": 1694515776516,
  486. "content": "Index: \n===================================================================\n--- \n+++ \n@@ -242,11 +242,17 @@\n this.startSelect();\n }, 1.5 * 1000);\n }\n } else {\n- setTimeout(() => {\n- this.createLevelData();\n- }, 1.5 * 1000);\n+ if (this.levelNum < 3) {\n+ setTimeout(() => {\n+ this.createLevelData();\n+ }, 1.5 * 1000);\n+ } else {\n+ setTimeout(() => {\n+ this.startSelect();\n+ }, 1.5 * 1000);\n+ }\n }\n }\n \n showTips(str) {\n"
  487. },
  488. {
  489. "date": 1694516011333,
  490. "content": "Index: \n===================================================================\n--- \n+++ \n@@ -192,8 +192,9 @@\n if (time <= 0) {\n cdTween.stop();\n cdTween.removeSelf();\n cdTween = null;\n+ this.timeLabel.string = \"\";\n this.maskNode.active = false;\n // 开始选择\n this.startBlink();\n this.startSelect();\n"
  491. },
  492. {
  493. "date": 1694516152979,
  494. "content": "Index: \n===================================================================\n--- \n+++ \n@@ -35,8 +35,9 @@\n selectCount: number = 0;\n waitingTime: number = 0;\n countdownTime: number = 0;\n levelNum: number = 0;\n+ _currentScore: number = 0;\n \n onLoad() {\n EventUtils.on(\"stopBlink\", this.onStopBlink, this);\n EventUtils.on(\"gameResult\", this.onGameResult, this);\n@@ -234,8 +235,9 @@\n if (isCorrect) {\n if (this.levelNum < 3) {\n GameManager.getInstance().addScore(20);\n setTimeout(() => {\n+\n this.createLevelData();\n }, 1.5 * 1000);\n } else {\n GameManager.getInstance().addScore(10);\n"
  495. },
  496. {
  497. "date": 1694516174287,
  498. "content": "Index: \n===================================================================\n--- \n+++ \n@@ -65,8 +65,9 @@\n // GameDataManager.currentSelect = -1;\n this.levelNum = gameData[\"id\"] || 1;\n this.waitingTime = gameData[\"time\"] || 3;\n this.countdownTime = gameData[\"countdown\"] || 3;\n+ this._currentScore = 0;\n this.createLevelData();\n \n }\n \n"
  499. },
  500. {
  501. "date": 1694516290465,
  502. "content": "Index: \n===================================================================\n--- \n+++ \n@@ -36,8 +36,9 @@\n waitingTime: number = 0;\n countdownTime: number = 0;\n levelNum: number = 0;\n _currentScore: number = 0;\n+ _gameData: object = {};\n \n onLoad() {\n EventUtils.on(\"stopBlink\", this.onStopBlink, this);\n EventUtils.on(\"gameResult\", this.onGameResult, this);\n@@ -62,8 +63,9 @@\n // GameDataManager.randomFruitList = [];\n // GameDataManager.selectFruitList = [];\n // GameDataManager.positionList = [];\n // GameDataManager.currentSelect = -1;\n+ this._gameData = gameData;\n this.levelNum = gameData[\"id\"] || 1;\n this.waitingTime = gameData[\"time\"] || 3;\n this.countdownTime = gameData[\"countdown\"] || 3;\n this._currentScore = 0;\n@@ -235,11 +237,13 @@\n EventUtils.dispatchEvent(\"SingleResult\", isCorrect)\n if (isCorrect) {\n if (this.levelNum < 3) {\n GameManager.getInstance().addScore(20);\n+ this._currentScore += 20;\n setTimeout(() => {\n-\n- this.createLevelData();\n+ if (this._currentScore < this._gameData[\"targetScore\"]) {\n+ this.createLevelData();\n+ }\n }, 1.5 * 1000);\n } else {\n GameManager.getInstance().addScore(10);\n setTimeout(() => {\n"
  503. },
  504. {
  505. "date": 1694516314809,
  506. "content": "Index: \n===================================================================\n--- \n+++ \n@@ -228,9 +228,11 @@\n let name = GameDataManager.fruitNameList[GameDataManager.currentSelect - 1];\n GameDataManager.selectFruitList.slice(0, 1);\n this.showTips(\"请点击\" + name + \"出现的地方\");\n } else {\n- this.createLevelData();\n+ if (this._currentScore < this._gameData[\"targetScore\"]) {\n+ this.createLevelData();\n+ }\n }\n }\n \n onGameResult(isCorrect, fruitType) {\n"
  507. },
  508. {
  509. "date": 1694516613721,
  510. "content": "Index: \n===================================================================\n--- \n+++ \n@@ -93,9 +93,9 @@\n this.generateFruits();\n setTimeout(() => {\n this.hideFruit();\n this.maskNode.active = true;\n- this.timeLabel.string = this.waitingTime + \"\";\n+ this.timeLabel.string = this.countdownTime + \"\";\n this.startCountdown(this.countdownTime);\n }, this.waitingTime * 1000);\n }\n \n"
  511. },
  512. {
  513. "date": 1694516839231,
  514. "content": "Index: \n===================================================================\n--- \n+++ \n@@ -225,9 +225,9 @@\n startSelect() {\n if (GameDataManager.selectFruitList.length > 0) {\n GameDataManager.currentSelect = GameDataManager.selectFruitList[0];\n let name = GameDataManager.fruitNameList[GameDataManager.currentSelect - 1];\n- GameDataManager.selectFruitList.slice(0, 1);\n+ GameDataManager.selectFruitList.splice(0, 1);\n this.showTips(\"请点击\" + name + \"出现的地方\");\n } else {\n if (this._currentScore < this._gameData[\"targetScore\"]) {\n this.createLevelData();\n"
  515. },
  516. {
  517. "date": 1694517296122,
  518. "content": "Index: \n===================================================================\n--- \n+++ \n@@ -90,8 +90,9 @@\n console.log(\"=========== selectFruitList =\", GameDataManager.selectFruitList);\n console.log(\"=========== positionList =\", GameDataManager.positionList);\n \n this.generateFruits();\n+ this.showTips(\"请记住水果出现的地方\");\n setTimeout(() => {\n this.hideFruit();\n this.maskNode.active = true;\n this.timeLabel.string = this.countdownTime + \"\";\n"
  519. },
  520. {
  521. "date": 1694517302274,
  522. "content": "Index: \n===================================================================\n--- \n+++ \n@@ -90,9 +90,9 @@\n console.log(\"=========== selectFruitList =\", GameDataManager.selectFruitList);\n console.log(\"=========== positionList =\", GameDataManager.positionList);\n \n this.generateFruits();\n- this.showTips(\"请记住水果出现的地方\");\n+ this.showTips(\"请记住水果出现的地方。\");\n setTimeout(() => {\n this.hideFruit();\n this.maskNode.active = true;\n this.timeLabel.string = this.countdownTime + \"\";\n"
  523. },
  524. {
  525. "date": 1694517601486,
  526. "content": "Index: \n===================================================================\n--- \n+++ \n@@ -190,8 +190,9 @@\n }\n }\n \n startCountdown(time) {\n+ this.showTips(\"倒计时结束后,选择水果出现的正确位置\");\n let cdTween = this.setTimeOutToTimes(1, time, this.node, () => {\n time--;\n this.timeLabel.string = time + \"\";\n if (time <= 0) {\n"
  527. },
  528. {
  529. "date": 1694573947106,
  530. "content": "Index: \n===================================================================\n--- \n+++ \n@@ -57,14 +57,8 @@\n * 初始化逻辑\n * 每次GameManager.StartGame()时都会调用\n */\n initUI(gameData) {\n- // this.onStopBlink();\n- // this.clearAllRootChildren();\n- // GameDataManager.randomFruitList = [];\n- // GameDataManager.selectFruitList = [];\n- // GameDataManager.positionList = [];\n- // GameDataManager.currentSelect = -1;\n this._gameData = gameData;\n this.levelNum = gameData[\"id\"] || 1;\n this.waitingTime = gameData[\"time\"] || 3;\n this.countdownTime = gameData[\"countdown\"] || 3;\n"
  531. },
  532. {
  533. "date": 1694573954624,
  534. "content": "Index: \n===================================================================\n--- \n+++ \n@@ -52,12 +52,8 @@\n start() {\n \n }\n \n- /**\n- * 初始化逻辑\n- * 每次GameManager.StartGame()时都会调用\n- */\n initUI(gameData) {\n this._gameData = gameData;\n this.levelNum = gameData[\"id\"] || 1;\n this.waitingTime = gameData[\"time\"] || 3;\n"
  535. },
  536. {
  537. "date": 1694573960506,
  538. "content": "Index: \n===================================================================\n--- \n+++ \n@@ -59,9 +59,8 @@\n this.waitingTime = gameData[\"time\"] || 3;\n this.countdownTime = gameData[\"countdown\"] || 3;\n this._currentScore = 0;\n this.createLevelData();\n- \n }\n \n createLevelData() {\n this.onStopBlink();\n"
  539. },
  540. {
  541. "date": 1694573966803,
  542. "content": "Index: \n===================================================================\n--- \n+++ \n@@ -26,12 +26,8 @@\n \n @property(Node)\n resultMaskNode: Node = null;\n \n-\n- // randomFruitList: number[] = [];\n- // selectFruitList: number[] = [];\n- // positionList: number[] = [];\n randomFruitCount: number = 0;\n selectCount: number = 0;\n waitingTime: number = 0;\n countdownTime: number = 0;\n"
  543. },
  544. {
  545. "date": 1694573992107,
  546. "content": "Index: \n===================================================================\n--- \n+++ \n@@ -26,8 +26,11 @@\n \n @property(Node)\n resultMaskNode: Node = null;\n \n+ @property(Node)\n+ carFruitRoot: Node = null;\n+\n randomFruitCount: number = 0;\n selectCount: number = 0;\n waitingTime: number = 0;\n countdownTime: number = 0;\n"
  547. },
  548. {
  549. "date": 1694582256674,
  550. "content": "Index: \n===================================================================\n--- \n+++ \n@@ -238,8 +238,9 @@\n }, 1.5 * 1000);\n } else {\n GameManager.getInstance().addScore(10);\n setTimeout(() => {\n+ this.startBlink();\n this.startSelect();\n }, 1.5 * 1000);\n }\n } else {\n@@ -249,8 +250,9 @@\n }, 1.5 * 1000);\n } else {\n setTimeout(() => {\n this.startSelect();\n+ this.startBlink();\n }, 1.5 * 1000);\n }\n }\n }\n"
  551. },
  552. {
  553. "date": 1694582375931,
  554. "content": "Index: \n===================================================================\n--- \n+++ \n@@ -36,8 +36,9 @@\n countdownTime: number = 0;\n levelNum: number = 0;\n _currentScore: number = 0;\n _gameData: object = {};\n+ _currentCarRootIndex: number = 0;\n \n onLoad() {\n EventUtils.on(\"stopBlink\", this.onStopBlink, this);\n EventUtils.on(\"gameResult\", this.onGameResult, this);\n"
  555. },
  556. {
  557. "date": 1694582381396,
  558. "content": "Index: \n===================================================================\n--- \n+++ \n@@ -36,9 +36,9 @@\n countdownTime: number = 0;\n levelNum: number = 0;\n _currentScore: number = 0;\n _gameData: object = {};\n- _currentCarRootIndex: number = 0;\n+ _currentCarRootIndex: number = 1;\n \n onLoad() {\n EventUtils.on(\"stopBlink\", this.onStopBlink, this);\n EventUtils.on(\"gameResult\", this.onGameResult, this);\n"
  559. },
  560. {
  561. "date": 1694582475395,
  562. "content": "Index: \n===================================================================\n--- \n+++ \n@@ -257,8 +257,12 @@\n }\n }\n }\n \n+ generateCarFruit(index, fruitType) {\n+ \n+ }\n+\n showTips(str) {\n let tip = new EventCustom(Global.EventType_ShowTips, true, str);\n this.node.dispatchEvent(tip);\n }\n"
  563. },
  564. {
  565. "date": 1694582606006,
  566. "content": "Index: \n===================================================================\n--- \n+++ \n@@ -258,9 +258,13 @@\n }\n }\n \n generateCarFruit(index, fruitType) {\n- \n+ let fruitItem = instantiate(this.itemPrefabList[fruitType - 1]);\n+ let root = this.carFruitRoot.getChildByName(\"root_\" + index);\n+ if (root && fruitItem) {\n+ root.addChild(fruitItem);\n+ }\n }\n \n showTips(str) {\n let tip = new EventCustom(Global.EventType_ShowTips, true, str);\n"
  567. },
  568. {
  569. "date": 1694582675256,
  570. "content": "Index: \n===================================================================\n--- \n+++ \n@@ -234,8 +234,10 @@\n this._currentScore += 20;\n setTimeout(() => {\n if (this._currentScore < this._gameData[\"targetScore\"]) {\n this.createLevelData();\n+ this.generateCarFruit(this._currentCarRootIndex, fruitType);\n+ this._currentCarRootIndex++;\n }\n }, 1.5 * 1000);\n } else {\n GameManager.getInstance().addScore(10);\n@@ -247,8 +249,10 @@\n } else {\n if (this.levelNum < 3) {\n setTimeout(() => {\n this.createLevelData();\n+ this.generateCarFruit(this._currentCarRootIndex, fruitType);\n+ this._currentCarRootIndex++;\n }, 1.5 * 1000);\n } else {\n setTimeout(() => {\n this.startSelect();\n"
  571. },
  572. {
  573. "date": 1694582741305,
  574. "content": "Index: \n===================================================================\n--- \n+++ \n@@ -263,9 +263,9 @@\n }\n \n generateCarFruit(index, fruitType) {\n let fruitItem = instantiate(this.itemPrefabList[fruitType - 1]);\n- let root = this.carFruitRoot.getChildByName(\"root_\" + index);\n+ let root = this.carFruitRoot.getChildByName(\"root\" + index);\n if (root && fruitItem) {\n root.addChild(fruitItem);\n }\n }\n"
  575. },
  576. {
  577. "date": 1694582836224,
  578. "content": "Index: \n===================================================================\n--- \n+++ \n@@ -264,8 +264,10 @@\n \n generateCarFruit(index, fruitType) {\n let fruitItem = instantiate(this.itemPrefabList[fruitType - 1]);\n let root = this.carFruitRoot.getChildByName(\"root\" + index);\n+ console.log(\"~~~~~~~~~~~ index\", index, \" fruitType\", fruitType);\n+ console.log(\"~~~~~~~~~~~ \", fruitItem, root);\n if (root && fruitItem) {\n root.addChild(fruitItem);\n }\n }\n"
  579. },
  580. {
  581. "date": 1694582933465,
  582. "content": "Index: \n===================================================================\n--- \n+++ \n@@ -243,8 +243,10 @@\n GameManager.getInstance().addScore(10);\n setTimeout(() => {\n this.startBlink();\n this.startSelect();\n+ this.generateCarFruit(this._currentCarRootIndex, fruitType);\n+ this._currentCarRootIndex++;\n }, 1.5 * 1000);\n }\n } else {\n if (this.levelNum < 3) {\n"
  583. },
  584. {
  585. "date": 1694583232546,
  586. "content": "Index: \n===================================================================\n--- \n+++ \n@@ -68,8 +68,9 @@\n GameDataManager.randomFruitList = [];\n GameDataManager.selectFruitList = [];\n GameDataManager.positionList = [];\n GameDataManager.currentSelect = -1;\n+ GameDataManager.isClick = false;\n \n this.getRandomByLevelNum(this.levelNum);\n GameDataManager.randomFruitList = this.randomNumbers(this.randomFruitCount);\n GameDataManager.selectFruitList = this.randomSelectFruit(this.levelNum);\n"
  587. },
  588. {
  589. "date": 1694583257699,
  590. "content": "Index: \n===================================================================\n--- \n+++ \n@@ -193,8 +193,9 @@\n this.maskNode.active = false;\n // 开始选择\n this.startBlink();\n this.startSelect();\n+ GameDataManager.isClick = true;\n }\n });\n }\n \n"
  591. },
  592. {
  593. "date": 1694590027966,
  594. "content": "Index: \n===================================================================\n--- \n+++ \n@@ -259,9 +259,8 @@\n }, 1.5 * 1000);\n } else {\n setTimeout(() => {\n this.startSelect();\n- this.startBlink();\n }, 1.5 * 1000);\n }\n }\n }\n"
  595. },
  596. {
  597. "date": 1694590039829,
  598. "content": "Index: \n===================================================================\n--- \n+++ \n@@ -243,9 +243,8 @@\n }, 1.5 * 1000);\n } else {\n GameManager.getInstance().addScore(10);\n setTimeout(() => {\n- this.startBlink();\n this.startSelect();\n this.generateCarFruit(this._currentCarRootIndex, fruitType);\n this._currentCarRootIndex++;\n }, 1.5 * 1000);\n"
  599. },
  600. {
  601. "date": 1694590046794,
  602. "content": "Index: \n===================================================================\n--- \n+++ \n@@ -220,8 +220,9 @@\n GameDataManager.currentSelect = GameDataManager.selectFruitList[0];\n let name = GameDataManager.fruitNameList[GameDataManager.currentSelect - 1];\n GameDataManager.selectFruitList.splice(0, 1);\n this.showTips(\"请点击\" + name + \"出现的地方\");\n+ this.startBlink();\n } else {\n if (this._currentScore < this._gameData[\"targetScore\"]) {\n this.createLevelData();\n }\n"
  603. },
  604. {
  605. "date": 1694590690630,
  606. "content": "Index: \n===================================================================\n--- \n+++ \n@@ -1,5 +1,5 @@\n-import { _decorator, Component, Prefab, Node, instantiate, tween, Label, Tween } from 'cc';\n+import { _decorator, Component, Prefab, Node, instantiate, tween, Label, Tween, UIOpacity } from 'cc';\n import { EventCustom } from '../Common/EventCustom';\n import { Global } from '../Common/Global';\n import { GameManager } from '../Manager/GameManager';\n import { EventUtils } from './EventUtils';\n@@ -41,8 +41,9 @@\n \n onLoad() {\n EventUtils.on(\"stopBlink\", this.onStopBlink, this);\n EventUtils.on(\"gameResult\", this.onGameResult, this);\n+ this.refrigeratorNode.getComponent(UIOpacity).opacity = 1;\n }\n \n onDestroy() {\n EventUtils.off(\"stopBlink\", this.onStopBlink, this);\n@@ -58,9 +59,12 @@\n this.levelNum = gameData[\"id\"] || 1;\n this.waitingTime = gameData[\"time\"] || 3;\n this.countdownTime = gameData[\"countdown\"] || 3;\n this._currentScore = 0;\n- this.createLevelData();\n+ Tween.stopAllByTarget(this.refrigeratorNode.getComponent(UIOpacity));\n+ tween(this.refrigeratorNode.getComponent(UIOpacity)).to(0.5, { opacity: 255 }).call(() => {\n+ this.createLevelData();\n+ }).start()\n }\n \n createLevelData() {\n this.onStopBlink();\n"
  607. },
  608. {
  609. "date": 1694590701082,
  610. "content": "Index: \n===================================================================\n--- \n+++ \n@@ -60,8 +60,9 @@\n this.waitingTime = gameData[\"time\"] || 3;\n this.countdownTime = gameData[\"countdown\"] || 3;\n this._currentScore = 0;\n Tween.stopAllByTarget(this.refrigeratorNode.getComponent(UIOpacity));\n+ this.refrigeratorNode.getComponent(UIOpacity).opacity = 1;\n tween(this.refrigeratorNode.getComponent(UIOpacity)).to(0.5, { opacity: 255 }).call(() => {\n this.createLevelData();\n }).start()\n }\n"
  611. },
  612. {
  613. "date": 1694590866600,
  614. "content": "Index: \n===================================================================\n--- \n+++ \n@@ -244,16 +244,24 @@\n if (this._currentScore < this._gameData[\"targetScore\"]) {\n this.createLevelData();\n this.generateCarFruit(this._currentCarRootIndex, fruitType);\n this._currentCarRootIndex++;\n+ } else {\n+ Tween.stopAllByTarget(this.refrigeratorNode.getComponent(UIOpacity));\n+ tween(this.refrigeratorNode.getComponent(UIOpacity)).to(0.5, { opacity: 1 }).start();\n }\n }, 1.5 * 1000);\n } else {\n GameManager.getInstance().addScore(10);\n setTimeout(() => {\n- this.startSelect();\n- this.generateCarFruit(this._currentCarRootIndex, fruitType);\n- this._currentCarRootIndex++;\n+ if (this._currentScore < this._gameData[\"targetScore\"]) {\n+ this.startSelect();\n+ this.generateCarFruit(this._currentCarRootIndex, fruitType);\n+ this._currentCarRootIndex++;\n+ } else {\n+ Tween.stopAllByTarget(this.refrigeratorNode.getComponent(UIOpacity));\n+ tween(this.refrigeratorNode.getComponent(UIOpacity)).to(0.5, { opacity: 1 }).start();\n+ }\n }, 1.5 * 1000);\n }\n } else {\n if (this.levelNum < 3) {\n"
  615. },
  616. {
  617. "date": 1694591194651,
  618. "content": "Index: \n===================================================================\n--- \n+++ \n@@ -266,10 +266,8 @@\n } else {\n if (this.levelNum < 3) {\n setTimeout(() => {\n this.createLevelData();\n- this.generateCarFruit(this._currentCarRootIndex, fruitType);\n- this._currentCarRootIndex++;\n }, 1.5 * 1000);\n } else {\n setTimeout(() => {\n this.startSelect();\n"
  619. },
  620. {
  621. "date": 1694591361585,
  622. "content": "Index: \n===================================================================\n--- \n+++ \n@@ -240,24 +240,24 @@\n if (this.levelNum < 3) {\n GameManager.getInstance().addScore(20);\n this._currentScore += 20;\n setTimeout(() => {\n+ this.generateCarFruit(this._currentCarRootIndex, fruitType);\n+ this._currentCarRootIndex++;\n if (this._currentScore < this._gameData[\"targetScore\"]) {\n this.createLevelData();\n- this.generateCarFruit(this._currentCarRootIndex, fruitType);\n- this._currentCarRootIndex++;\n } else {\n Tween.stopAllByTarget(this.refrigeratorNode.getComponent(UIOpacity));\n tween(this.refrigeratorNode.getComponent(UIOpacity)).to(0.5, { opacity: 1 }).start();\n }\n }, 1.5 * 1000);\n } else {\n GameManager.getInstance().addScore(10);\n setTimeout(() => {\n+ this.generateCarFruit(this._currentCarRootIndex, fruitType);\n+ this._currentCarRootIndex++;\n if (this._currentScore < this._gameData[\"targetScore\"]) {\n this.startSelect();\n- this.generateCarFruit(this._currentCarRootIndex, fruitType);\n- this._currentCarRootIndex++;\n } else {\n Tween.stopAllByTarget(this.refrigeratorNode.getComponent(UIOpacity));\n tween(this.refrigeratorNode.getComponent(UIOpacity)).to(0.5, { opacity: 1 }).start();\n }\n"
  623. },
  624. {
  625. "date": 1694591468367,
  626. "content": "Index: \n===================================================================\n--- \n+++ \n@@ -27,8 +27,11 @@\n @property(Node)\n resultMaskNode: Node = null;\n \n @property(Node)\n+ carNode: Node = null;\n+\n+ @property(Node)\n carFruitRoot: Node = null;\n \n randomFruitCount: number = 0;\n selectCount: number = 0;\n"
  627. },
  628. {
  629. "date": 1694591561361,
  630. "content": "Index: \n===================================================================\n--- \n+++ \n@@ -1,5 +1,5 @@\n-import { _decorator, Component, Prefab, Node, instantiate, tween, Label, Tween, UIOpacity } from 'cc';\n+import { _decorator, Component, Prefab, Node, instantiate, tween, Label, Tween, UIOpacity, v2, v3 } from 'cc';\n import { EventCustom } from '../Common/EventCustom';\n import { Global } from '../Common/Global';\n import { GameManager } from '../Manager/GameManager';\n import { EventUtils } from './EventUtils';\n@@ -45,8 +45,9 @@\n onLoad() {\n EventUtils.on(\"stopBlink\", this.onStopBlink, this);\n EventUtils.on(\"gameResult\", this.onGameResult, this);\n this.refrigeratorNode.getComponent(UIOpacity).opacity = 1;\n+ this.carNode.setPosition(v3(3000, this.carNode.position.y, 0));\n }\n \n onDestroy() {\n EventUtils.off(\"stopBlink\", this.onStopBlink, this);\n"
  631. },
  632. {
  633. "date": 1694591825047,
  634. "content": "Index: \n===================================================================\n--- \n+++ \n@@ -70,8 +70,18 @@\n this.createLevelData();\n }).start()\n }\n \n+ setRefrigerator() {\n+\n+ }\n+\n+ sesCar() {\n+ Tween.stopAllByTarget(this.carNode);\n+ this.carNode.setPosition(v3(3000, this.carNode.position.y, 0));\n+ tween(this.carNode).to(1, { position: v3(520, this.carNode.position.y, 0) }).start();\n+ }\n+\n createLevelData() {\n this.onStopBlink();\n this.clearAllRootChildren();\n GameDataManager.randomFruitList = [];\n"
  635. },
  636. {
  637. "date": 1694591940544,
  638. "content": "Index: \n===================================================================\n--- \n+++ \n@@ -75,8 +75,13 @@\n \n }\n \n sesCar() {\n+ for (let i = 0; i < this.carFruitRoot.children.length; i++) {\n+ if (this.carFruitRoot.children[i].children.length > 0) {\n+ this.carFruitRoot.children[i].children[0].destroy();\n+ } \n+ }\n Tween.stopAllByTarget(this.carNode);\n this.carNode.setPosition(v3(3000, this.carNode.position.y, 0));\n tween(this.carNode).to(1, { position: v3(520, this.carNode.position.y, 0) }).start();\n }\n"
  639. },
  640. {
  641. "date": 1694591985470,
  642. "content": "Index: \n===================================================================\n--- \n+++ \n@@ -63,20 +63,21 @@\n this.levelNum = gameData[\"id\"] || 1;\n this.waitingTime = gameData[\"time\"] || 3;\n this.countdownTime = gameData[\"countdown\"] || 3;\n this._currentScore = 0;\n+ this.setRefrigerator();\n+ this.setCar();\n+ }\n+\n+ setRefrigerator() {\n Tween.stopAllByTarget(this.refrigeratorNode.getComponent(UIOpacity));\n this.refrigeratorNode.getComponent(UIOpacity).opacity = 1;\n tween(this.refrigeratorNode.getComponent(UIOpacity)).to(0.5, { opacity: 255 }).call(() => {\n this.createLevelData();\n- }).start()\n+ }).start();\n }\n \n- setRefrigerator() {\n-\n- }\n-\n- sesCar() {\n+ setCar() {\n for (let i = 0; i < this.carFruitRoot.children.length; i++) {\n if (this.carFruitRoot.children[i].children.length > 0) {\n this.carFruitRoot.children[i].children[0].destroy();\n } \n"
  643. },
  644. {
  645. "date": 1694592052887,
  646. "content": "Index: \n===================================================================\n--- \n+++ \n@@ -265,10 +265,9 @@\n this._currentCarRootIndex++;\n if (this._currentScore < this._gameData[\"targetScore\"]) {\n this.createLevelData();\n } else {\n- Tween.stopAllByTarget(this.refrigeratorNode.getComponent(UIOpacity));\n- tween(this.refrigeratorNode.getComponent(UIOpacity)).to(0.5, { opacity: 1 }).start();\n+ this.endAnim();\n }\n }, 1.5 * 1000);\n } else {\n GameManager.getInstance().addScore(10);\n@@ -277,10 +276,9 @@\n this._currentCarRootIndex++;\n if (this._currentScore < this._gameData[\"targetScore\"]) {\n this.startSelect();\n } else {\n- Tween.stopAllByTarget(this.refrigeratorNode.getComponent(UIOpacity));\n- tween(this.refrigeratorNode.getComponent(UIOpacity)).to(0.5, { opacity: 1 }).start();\n+ this.endAnim();\n }\n }, 1.5 * 1000);\n }\n } else {\n@@ -295,8 +293,13 @@\n }\n }\n }\n \n+ endAnim() {\n+ Tween.stopAllByTarget(this.refrigeratorNode.getComponent(UIOpacity));\n+ tween(this.refrigeratorNode.getComponent(UIOpacity)).to(0.5, { opacity: 1 }).start();\n+ }\n+\n generateCarFruit(index, fruitType) {\n let fruitItem = instantiate(this.itemPrefabList[fruitType - 1]);\n let root = this.carFruitRoot.getChildByName(\"root\" + index);\n console.log(\"~~~~~~~~~~~ index\", index, \" fruitType\", fruitType);\n"
  647. },
  648. {
  649. "date": 1694592128255,
  650. "content": "Index: \n===================================================================\n--- \n+++ \n@@ -296,8 +296,11 @@\n \n endAnim() {\n Tween.stopAllByTarget(this.refrigeratorNode.getComponent(UIOpacity));\n tween(this.refrigeratorNode.getComponent(UIOpacity)).to(0.5, { opacity: 1 }).start();\n+\n+ Tween.stopAllByTarget(this.carNode);\n+ tween(this.carNode).to(0.5, { position: v3(-3000, this.carNode.position.y, 0 )}).start();\n }\n \n generateCarFruit(index, fruitType) {\n let fruitItem = instantiate(this.itemPrefabList[fruitType - 1]);\n"
  651. },
  652. {
  653. "date": 1694592426155,
  654. "content": "Index: \n===================================================================\n--- \n+++ \n@@ -63,8 +63,9 @@\n this.levelNum = gameData[\"id\"] || 1;\n this.waitingTime = gameData[\"time\"] || 3;\n this.countdownTime = gameData[\"countdown\"] || 3;\n this._currentScore = 0;\n+ this._currentCarRootIndex = 1;\n this.setRefrigerator();\n this.setCar();\n }\n \n"
  655. },
  656. {
  657. "date": 1694593382448,
  658. "content": "Index: \n===================================================================\n--- \n+++ \n@@ -52,12 +52,8 @@\n onDestroy() {\n EventUtils.off(\"stopBlink\", this.onStopBlink, this);\n EventUtils.off(\"gameResult\", this.onGameResult, this);\n }\n- \n- start() {\n- \n- }\n \n initUI(gameData) {\n this._gameData = gameData;\n this.levelNum = gameData[\"id\"] || 1;\n"
  659. },
  660. {
  661. "date": 1694593737789,
  662. "content": "Index: \n===================================================================\n--- \n+++ \n@@ -80,8 +80,9 @@\n } \n }\n Tween.stopAllByTarget(this.carNode);\n this.carNode.setPosition(v3(3000, this.carNode.position.y, 0));\n+ this.carNode.emit(\"init\");\n tween(this.carNode).to(1, { position: v3(520, this.carNode.position.y, 0) }).start();\n }\n \n createLevelData() {\n"
  663. },
  664. {
  665. "date": 1694593769789,
  666. "content": "Index: \n===================================================================\n--- \n+++ \n@@ -297,8 +297,9 @@\n tween(this.refrigeratorNode.getComponent(UIOpacity)).to(0.5, { opacity: 1 }).start();\n \n Tween.stopAllByTarget(this.carNode);\n tween(this.carNode).to(0.5, { position: v3(-3000, this.carNode.position.y, 0 )}).start();\n+ this.carNode.emit(\"init\");\n }\n \n generateCarFruit(index, fruitType) {\n let fruitItem = instantiate(this.itemPrefabList[fruitType - 1]);\n"
  667. },
  668. {
  669. "date": 1694593782831,
  670. "content": "Index: \n===================================================================\n--- \n+++ \n@@ -293,12 +293,12 @@\n }\n \n endAnim() {\n Tween.stopAllByTarget(this.refrigeratorNode.getComponent(UIOpacity));\n- tween(this.refrigeratorNode.getComponent(UIOpacity)).to(0.5, { opacity: 1 }).start();\n+ tween(this.refrigeratorNode.getComponent(UIOpacity)).to(1, { opacity: 1 }).start();\n \n Tween.stopAllByTarget(this.carNode);\n- tween(this.carNode).to(0.5, { position: v3(-3000, this.carNode.position.y, 0 )}).start();\n+ tween(this.carNode).to(1, { position: v3(-3000, this.carNode.position.y, 0 )}).start();\n this.carNode.emit(\"init\");\n }\n \n generateCarFruit(index, fruitType) {\n"
  671. },
  672. {
  673. "date": 1694594205792,
  674. "content": "Index: \n===================================================================\n--- \n+++ \n@@ -67,9 +67,9 @@\n \n setRefrigerator() {\n Tween.stopAllByTarget(this.refrigeratorNode.getComponent(UIOpacity));\n this.refrigeratorNode.getComponent(UIOpacity).opacity = 1;\n- tween(this.refrigeratorNode.getComponent(UIOpacity)).to(0.5, { opacity: 255 }).call(() => {\n+ tween(this.refrigeratorNode.getComponent(UIOpacity)).to(1, { opacity: 255 }).delay(0.5).call(() => {\n this.createLevelData();\n }).start();\n }\n \n@@ -81,9 +81,9 @@\n }\n Tween.stopAllByTarget(this.carNode);\n this.carNode.setPosition(v3(3000, this.carNode.position.y, 0));\n this.carNode.emit(\"init\");\n- tween(this.carNode).to(1, { position: v3(520, this.carNode.position.y, 0) }).start();\n+ tween(this.carNode).to(1.5, { position: v3(520, this.carNode.position.y, 0) }).start();\n }\n \n createLevelData() {\n this.onStopBlink();\n"
  675. },
  676. {
  677. "date": 1694594382163,
  678. "content": "Index: \n===================================================================\n--- \n+++ \n@@ -1,5 +1,5 @@\n-import { _decorator, Component, Prefab, Node, instantiate, tween, Label, Tween, UIOpacity, v2, v3 } from 'cc';\n+import { _decorator, Component, Prefab, Node, instantiate, tween, Label, Tween, UIOpacity, v2, v3, AudioSource } from 'cc';\n import { EventCustom } from '../Common/EventCustom';\n import { Global } from '../Common/Global';\n import { GameManager } from '../Manager/GameManager';\n import { EventUtils } from './EventUtils';\n@@ -32,8 +32,10 @@\n \n @property(Node)\n carFruitRoot: Node = null;\n \n+ audio: AudioSource = null;\n+\n randomFruitCount: number = 0;\n selectCount: number = 0;\n waitingTime: number = 0;\n countdownTime: number = 0;\n"
  679. },
  680. {
  681. "date": 1694594404990,
  682. "content": "Index: \n===================================================================\n--- \n+++ \n@@ -46,8 +46,9 @@\n \n onLoad() {\n EventUtils.on(\"stopBlink\", this.onStopBlink, this);\n EventUtils.on(\"gameResult\", this.onGameResult, this);\n+ this.audio = this.node.getComponent(AudioSource);\n this.refrigeratorNode.getComponent(UIOpacity).opacity = 1;\n this.carNode.setPosition(v3(3000, this.carNode.position.y, 0));\n }\n \n"
  683. },
  684. {
  685. "date": 1694594442923,
  686. "content": "Index: \n===================================================================\n--- \n+++ \n@@ -1,5 +1,5 @@\n-import { _decorator, Component, Prefab, Node, instantiate, tween, Label, Tween, UIOpacity, v2, v3, AudioSource } from 'cc';\n+import { _decorator, Component, Prefab, Node, instantiate, tween, Label, Tween, UIOpacity, v2, v3, AudioSource, AudioClip } from 'cc';\n import { EventCustom } from '../Common/EventCustom';\n import { Global } from '../Common/Global';\n import { GameManager } from '../Manager/GameManager';\n import { EventUtils } from './EventUtils';\n@@ -32,8 +32,11 @@\n \n @property(Node)\n carFruitRoot: Node = null;\n \n+ @property(AudioClip)\n+ audioClipList: AudioClip[] = [];\n+\n audio: AudioSource = null;\n \n randomFruitCount: number = 0;\n selectCount: number = 0;\n"
  687. },
  688. {
  689. "date": 1694594485344,
  690. "content": "Index: \n===================================================================\n--- \n+++ \n@@ -219,9 +219,9 @@\n cdTween.removeSelf();\n cdTween = null;\n this.timeLabel.string = \"\";\n this.maskNode.active = false;\n- // 开始选择\n+\n this.startBlink();\n this.startSelect();\n GameDataManager.isClick = true;\n }\n"
  691. },
  692. {
  693. "date": 1694594553510,
  694. "content": "Index: \n===================================================================\n--- \n+++ \n@@ -219,9 +219,8 @@\n cdTween.removeSelf();\n cdTween = null;\n this.timeLabel.string = \"\";\n this.maskNode.active = false;\n-\n this.startBlink();\n this.startSelect();\n GameDataManager.isClick = true;\n }\n@@ -260,8 +259,9 @@\n \n onGameResult(isCorrect, fruitType) {\n EventUtils.dispatchEvent(\"SingleResult\", isCorrect)\n if (isCorrect) {\n+ this.audio.playOneShot(this.audioClipList[0]);\n if (this.levelNum < 3) {\n GameManager.getInstance().addScore(20);\n this._currentScore += 20;\n setTimeout(() => {\n"
  695. },
  696. {
  697. "date": 1694594562922,
  698. "content": "Index: \n===================================================================\n--- \n+++ \n@@ -285,8 +285,9 @@\n }\n }, 1.5 * 1000);\n }\n } else {\n+ this.audio.playOneShot(this.audioClipList[1]);\n if (this.levelNum < 3) {\n setTimeout(() => {\n this.createLevelData();\n }, 1.5 * 1000);\n"
  699. },
  700. {
  701. "date": 1694594652432,
  702. "content": "Index: \n===================================================================\n--- \n+++ \n@@ -49,16 +49,18 @@\n \n onLoad() {\n EventUtils.on(\"stopBlink\", this.onStopBlink, this);\n EventUtils.on(\"gameResult\", this.onGameResult, this);\n+ EventUtils.on(\"gameOver\", this.onGameOver, this);\n this.audio = this.node.getComponent(AudioSource);\n this.refrigeratorNode.getComponent(UIOpacity).opacity = 1;\n this.carNode.setPosition(v3(3000, this.carNode.position.y, 0));\n }\n \n onDestroy() {\n EventUtils.off(\"stopBlink\", this.onStopBlink, this);\n EventUtils.off(\"gameResult\", this.onGameResult, this);\n+ EventUtils.off(\"gameOver\", this.onGameOver, this);\n }\n \n initUI(gameData) {\n this._gameData = gameData;\n"
  703. },
  704. {
  705. "date": 1694594683590,
  706. "content": "Index: \n===================================================================\n--- \n+++ \n@@ -319,8 +319,12 @@\n root.addChild(fruitItem);\n }\n }\n \n+ onGameOver() {\n+ this.audio.playOneShot(this.audioClipList[2]);\n+ }\n+\n showTips(str) {\n let tip = new EventCustom(Global.EventType_ShowTips, true, str);\n this.node.dispatchEvent(tip);\n }\n"
  707. },
  708. {
  709. "date": 1694594852744,
  710. "content": "Index: \n===================================================================\n--- \n+++ \n@@ -68,8 +68,9 @@\n this.waitingTime = gameData[\"time\"] || 3;\n this.countdownTime = gameData[\"countdown\"] || 3;\n this._currentScore = 0;\n this._currentCarRootIndex = 1;\n+ GameDataManager.isClick = false;\n this.setRefrigerator();\n this.setCar();\n }\n \n"
  711. },
  712. {
  713. "date": 1694595296004,
  714. "content": "Index: \n===================================================================\n--- \n+++ \n@@ -267,16 +267,18 @@\n if (this.levelNum < 3) {\n GameManager.getInstance().addScore(20);\n this._currentScore += 20;\n setTimeout(() => {\n- this.generateCarFruit(this._currentCarRootIndex, fruitType);\n- this._currentCarRootIndex++;\n if (this._currentScore < this._gameData[\"targetScore\"]) {\n this.createLevelData();\n } else {\n this.endAnim();\n }\n }, 1.5 * 1000);\n+ setTimeout(() => {\n+ this.generateCarFruit(this._currentCarRootIndex, fruitType);\n+ this._currentCarRootIndex++;\n+ }, 0.5 * 1000);\n } else {\n GameManager.getInstance().addScore(10);\n setTimeout(() => {\n this.generateCarFruit(this._currentCarRootIndex, fruitType);\n"
  715. },
  716. {
  717. "date": 1694595307314,
  718. "content": "Index: \n===================================================================\n--- \n+++ \n@@ -280,16 +280,18 @@\n }, 0.5 * 1000);\n } else {\n GameManager.getInstance().addScore(10);\n setTimeout(() => {\n- this.generateCarFruit(this._currentCarRootIndex, fruitType);\n- this._currentCarRootIndex++;\n if (this._currentScore < this._gameData[\"targetScore\"]) {\n this.startSelect();\n } else {\n this.endAnim();\n }\n }, 1.5 * 1000);\n+ setTimeout(() => {\n+ this.generateCarFruit(this._currentCarRootIndex, fruitType);\n+ this._currentCarRootIndex++;\n+ }, 0.5 * 1000);\n }\n } else {\n this.audio.playOneShot(this.audioClipList[1]);\n if (this.levelNum < 3) {\n"
  719. }
  720. ],
  721. "date": 1694486060260,
  722. "name": "Commit-0",
  723. "content": "import { _decorator, Component } from 'cc';\nconst { ccclass, property } = _decorator;\n\n@ccclass('GameMain')\nexport class GameMain extends Component {\n \n start() {\n \n }\n\n /**\n * 初始化逻辑\n * 每次GameManager.StartGame()时都会调用\n */\n initUI() {\n\n }\n\n update(deltaTime: number) {\n\n }\n}\n\n\n"
  724. }
  725. ]
  726. }