GameRollNode.ts 22 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615
  1. import { _decorator, Component, Node, Prefab, instantiate, Vec3, tween, math, Game, UITransform, Tween, Label, UIOpacity, AudioClip} from 'cc';
  2. import { Item } from './Item';
  3. import { GameConstant } from './GameConstant';
  4. import { GameScene } from './GameScene';
  5. import { SoundManager } from './SoundManager';
  6. import { ResourceLoader } from './ResourceLoader';
  7. const { ccclass, property } = _decorator;
  8. @ccclass('GameRollNode')
  9. export class GameRollNode extends Component {
  10. @property(Prefab)
  11. item: Prefab = null;
  12. @property(Node)
  13. slotRollView: Node = null;
  14. @property(Node)
  15. rollSpine: Node = null;
  16. @property(Node)
  17. endNode: Node = null;
  18. @property(Node)
  19. winDetail: Node = null;
  20. @property(Node)
  21. winDetailIcons: Node = null;
  22. @property(Node)
  23. winDetailLabel: Node = null;
  24. @property(SoundManager)
  25. soundManager: SoundManager = null;
  26. public rollNodes = [];
  27. public rollNodeIcons = [];
  28. public resultRollNodes = [];
  29. public resultRollIcons = [];
  30. public resultValues = [];
  31. public resultIcons = [];
  32. public resultWildTimes = [];
  33. public tempValueIsHaveScatter = [];
  34. public rollBgIsScroll = [];
  35. public rollBgisStop = [];
  36. public isScroll = false;
  37. public startRollTime = 0;
  38. public isFast = false;
  39. public freeIconCount = 0;
  40. public isFastStop = false;
  41. public fastIndex = 0;
  42. public bGameEnd = true;
  43. public delayTime = 0;
  44. public bQuick = false;
  45. public hasSpecial = false;
  46. public isInScatterGame = false;
  47. public curDate;
  48. public rollResultData = {
  49. "m_desk_data": [[0,0,0,2,2,2],[2,2,2,2,2,2],[2,2,2,2,2,2],[2,2,2,2,2,2]],
  50. "m_wildTimes_data": [[0,0,0,0,0,0],[0,0,0,0,0,0],[0,0,0,0,0,0],[0,0,0,0,0,0]],
  51. "m_isSpecialGame": 0,
  52. "m_freeCount": 0,
  53. "m_freeCountAdd": 0,
  54. "m_betIndex": 0,
  55. "m_lottery_size": 0,
  56. "m_lCurScore":0,
  57. "m_line_icon": [[2,2,2,2,2,2],[2,2,2,2,2],[2,2,2,2],[2,2,2]],
  58. "m_line_size": [6,5,4,3],
  59. "m_line_icon_active": [[1,1,1,1,1,1],[1,1,1,1,1],[1,1,1,1],[1,1,1]],
  60. "m_line_times": [500,500,500,500],
  61. "m_line_index": [[0,1,2,3,4,5],[6,7,8,9,10,11],[12,13,14,15,16,17],[18,19,20,21,22,23]],
  62. };
  63. start() {
  64. for (let i = 0; i < GameConstant.MAX_COL; i++) {
  65. this.rollNodes[i] = this.slotRollView.getChildByName("roll" + i);
  66. this.resultRollNodes[i] = this.slotRollView.getChildByName("result_roll" + i);
  67. }
  68. let itemHeight = 190;
  69. let iconIndex = 0;
  70. for (let i = 0; i < this.rollNodes.length; i++) {
  71. this.rollNodeIcons[i] = [];
  72. this.resultValues[i] = [];
  73. this.resultRollIcons[i] = [];
  74. this.resultWildTimes[i] = [];
  75. for (let j = 0; j < GameConstant.COL_ITEM_LEN; j++) {
  76. let item = instantiate(this.item);
  77. item.position = new Vec3(0, (GameConstant.COL_ITEM_LEN / 2 - 0.5 - j) * itemHeight, 0);
  78. item.parent = this.rollNodes[i];
  79. this.rollNodeIcons[i][j] = item;
  80. let iconType = j >= 11 ? 2 : (2 + j);
  81. let resultItem = instantiate(this.item);
  82. resultItem.position = new Vec3(0, (GameConstant.COL_ITEM_LEN / 2 - 0.5 - j) * itemHeight, 0);
  83. resultItem.parent = this.resultRollNodes[i];
  84. resultItem.getComponent(Item).setIconType(GameConstant.getRandomNumber(2, GameConstant.MAX_ICON_TYPE), true);
  85. // resultItem.active = false;
  86. this.resultRollIcons[i][j] = resultItem;
  87. if (j >= 4 && j < 8) {
  88. this.resultValues[i][j - 4] = GameConstant.getRandomNumber(2, GameConstant.MAX_ICON_TYPE);
  89. // this.resultValues[i][j - 4] = this.rollResultData.m_desk_data[j - 4][i];
  90. resultItem.getComponent(Item).setIconType(this.resultValues[i][j - 4], true);
  91. }
  92. if (resultItem.getComponent(Item).getIconType() == GameConstant.ICON_TYPE.SYMBOL_WILD) {
  93. this.resultWildTimes[i][j] = GameConstant.WILD_TIMES[GameConstant.getRandomNumber(0, 3)];
  94. }
  95. }
  96. }
  97. for (let i = 0; i < GameConstant.MAX_COL; i++) {
  98. this.resultIcons[i] = [];
  99. for (let j = 0; j < GameConstant.MAX_ROW; j++) {
  100. let resultItem = instantiate(this.item);
  101. resultItem.position = new Vec3(this.rollNodes[i].position.x, (GameConstant.MAX_ROW / 2 - 0.5 - j) * itemHeight, 0);
  102. resultItem.parent = this.endNode;
  103. resultItem.getComponent(Item).setIconType(this.resultValues[i][j], true);//
  104. this.resultIcons[i][j] = resultItem;
  105. }
  106. }
  107. // this.slotRollView.parent.scale = new Vec3(0.1,0.1,0.1);
  108. this.endNode.active = true;
  109. }
  110. // 展示结果图标
  111. showResultIcons(i) {
  112. this.endNode.active = true;
  113. this.resultRollNodes[i].active = false;
  114. for (let j = 0; j < GameConstant.MAX_ROW; j++) {
  115. this.resultIcons[i][j].active = true;
  116. }
  117. }
  118. // 重置展示结果的图标状态
  119. resetResultIcons() {
  120. console.log("resetResultIcons");
  121. this.endNode.active = false;
  122. for (let i = 0; i < GameConstant.MAX_COL; i++) {
  123. for (let j = 0; j < GameConstant.MAX_ROW; j++) {
  124. this.resultIcons[i][j].getComponent(Item).showNormal();
  125. this.resultIcons[i][j].active = false;
  126. }
  127. }
  128. }
  129. // 设置图标为模糊图片
  130. resetRollingItemValue(i) {
  131. for(let j = 0; j < GameConstant.COL_ITEM_LEN; ++j) {
  132. var randType = GameConstant.getRandomNumber(2, GameConstant.MAX_ICON_TYPE)
  133. this.rollNodeIcons[i][j].getComponent(Item).setIconType(randType, false);
  134. this.resultRollIcons[i][j].getComponent(Item).setIconType(randType, false);
  135. }
  136. }
  137. // 开始转动函数
  138. startRollActions() {
  139. this.bGameEnd = false;
  140. this.isFastStop = false;
  141. // 停止结果细节的节点动作,并隐藏节点
  142. Tween.stopAllByTarget(this.winDetail);//.getComponent(UIOpacity)
  143. this.winDetail.active = false;
  144. Tween.stopAllByTarget(this.node);
  145. // 重置结果图标的状态
  146. this.resetResultIcons();
  147. // 重置转动状态参数
  148. for(let i = 0; i < GameConstant.MAX_COL; ++i) {
  149. this.tempValueIsHaveScatter[i] = false;
  150. this.rollBgIsScroll[i] = false;
  151. this.rollBgisStop[i] = false;
  152. }
  153. // 开始滚动
  154. for(let i = 0; i < GameConstant.MAX_COL; ++i) {
  155. let rollbg = this.resultRollNodes[i];
  156. // 展示滚动层,停止滚动层动作
  157. rollbg.active = true;
  158. Tween.stopAllByTarget(rollbg);
  159. this.rollNodes[i].y = rollbg.y + rollbg.getComponent(UITransform).height;
  160. // 开始转动前的上提动作
  161. tween(rollbg)
  162. .delay(0.2 * i)
  163. .by(0.2, {y: 60})
  164. .by(0.05, {y: -15})
  165. // .by(0.2, {y: 40}, {easing: 'sineOut'})
  166. // .by(0.2, {y: -20}, {easing: 'sineIn'})
  167. .call(()=>{
  168. this.rollNodes[i].y += 60;
  169. if (i == 0) {
  170. this.isScroll = true;
  171. }
  172. this.rollBgIsScroll[i] = true;
  173. })
  174. .delay(0.05)
  175. .call(()=>{
  176. this.resetRollingItemValue(i);
  177. })
  178. .start();
  179. }
  180. this.startRollTime = new Date().getTime();
  181. }
  182. // 每列转动结束的函数
  183. rollEnds(i) {
  184. if(i == 0) {
  185. this.node.parent.getComponent(GameScene).onGameEnd();
  186. }
  187. // 如果有两列有进入小游戏的特殊图标则快速转动
  188. let fastDelayTime = 0
  189. if(this.freeIconCount >= 2 && (i >= 3 && i < 6) && !this.isFastStop) {
  190. if (this.fastIndex != i) {
  191. this.fastIndex = i;
  192. this.isFast = true;
  193. fastDelayTime = 3;
  194. this.rollBgIsScroll[i] = true;
  195. this.rollSpine.x = this.rollNodes[i].x;
  196. this.rollSpine.active = true;
  197. this.soundManager.playEffect2(ResourceLoader.instance.getResource<AudioClip>("rollFast"));
  198. Tween.stopAllByTarget(this.node);
  199. tween(this.node)
  200. .delay(fastDelayTime)
  201. .call(()=>{
  202. this.rollBgisStop[i] = true;
  203. this.isFastStop = i == 5;
  204. })
  205. .start();
  206. return;
  207. } else {
  208. }
  209. }
  210. // 都停止了就展示结果
  211. if(i > 5) {
  212. this.isFast = false;
  213. this.isScroll = false;
  214. this.rollSpine.active = false;
  215. this.soundManager.stopEffect2();
  216. let delayTime = 200;
  217. this.delayShowPrizes(delayTime);
  218. return;
  219. }
  220. let isAppearScatter = false;
  221. //先统计Scatter数量
  222. for(let j = 0; j < GameConstant.MAX_ROW; ++j) {
  223. if(this.resultValues[i][j] == GameConstant.SPECIAL_ICON) {
  224. this.freeIconCount++;
  225. isAppearScatter = true;
  226. }
  227. }
  228. // 现逻辑
  229. let resultRollbg = this.resultRollNodes[i];
  230. let destY = 0;
  231. // 修改当前列结果展示图标
  232. for (let j = 0; j < GameConstant.MAX_ROW; j++) {
  233. this.rollNodeIcons[i][4 + j].getComponent(Item).setIconType(this.resultValues[i][j], false);
  234. this.resultRollIcons[i][4 + j].getComponent(Item).setIconType(this.resultValues[i][j], true, this.resultWildTimes[i][j]);
  235. this.resultIcons[i][j].getComponent(Item).setIconType(this.resultValues[i][j], true, this.resultWildTimes[i][j]);
  236. }
  237. for (let j = 0; j < this.resultRollIcons[i].length; j++) {
  238. this.resultRollIcons[i][j].getComponent(Item).setIconType(this.resultRollIcons[i][j].getComponent(Item).getIconType(), true);
  239. }
  240. var downTime = this.isFast ? 1.0 : 0.9;
  241. var upTime = this.isFast ? 0.15 : 0.1;
  242. // 滚动层正常停止动作
  243. tween(resultRollbg)
  244. .call(()=>{
  245. if (i + 1 <= 5) {
  246. this.rollBgisStop[i + 1] = true;
  247. }
  248. })
  249. .to(downTime, {y: destY - 40}, {easing: 'sineOut'})//, {easing: 'sineIn'}
  250. .call(()=>{
  251. this.soundManager.playEffect1(ResourceLoader.instance.getResource<AudioClip>("rollEnd"));
  252. })
  253. .to(upTime, {y: destY})//, {easing: 'sineOut'}
  254. .call(()=>{
  255. })
  256. .delay(0.1)
  257. .call(()=>{
  258. this.rollBgisStop[i] = false;
  259. this.showResultIcons(i);
  260. if (isAppearScatter) {
  261. this.soundManager.playEffect3(ResourceLoader.instance.getResource<AudioClip>("appear_bonus_icon"));
  262. }
  263. if (i == 5) {
  264. this.rollEnds(i + 1);
  265. }
  266. })
  267. .start();
  268. let rollbg = this.rollNodes[i]
  269. let dest = -2220;
  270. // 相同滚动层一起位移
  271. tween(rollbg)
  272. .to(downTime, {y: dest}, {easing: 'sineOut'})
  273. .delay(0.5)
  274. .call(()=>{
  275. this.rollNodes[i].active = true;
  276. this.rollNodes[i].y = 2220;
  277. })
  278. .start();
  279. }
  280. // 快速停止列
  281. justEnd(i) {
  282. if(i >= GameConstant.MAX_COL) {
  283. return;
  284. }
  285. let resultRollbg = this.resultRollNodes[i];
  286. Tween.stopAllByTarget(resultRollbg);
  287. resultRollbg.y = 0;//270
  288. Tween.stopAllByTarget(this.rollNodes[i]);
  289. this.rollNodes[i].y = 2220;
  290. //先统计Scatter数量
  291. let isAppearScatter = false;
  292. for(let j = 0; j < GameConstant.MAX_ROW; ++j) {
  293. if(this.resultValues[i][j] == GameConstant.SPECIAL_ICON) {
  294. this.freeIconCount++;
  295. isAppearScatter = true;
  296. }
  297. }
  298. let destY = 0;
  299. for (let j = 0; j < GameConstant.MAX_ROW; j++) {
  300. this.rollNodeIcons[i][4 + j].getComponent(Item).setIconType(this.resultValues[i][j], false);
  301. this.resultRollIcons[i][4 + j].getComponent(Item).setIconType(this.resultValues[i][j], true, this.resultWildTimes[i][j]);
  302. this.resultIcons[i][j].getComponent(Item).setIconType(this.resultValues[i][j], true, this.resultWildTimes[i][j]);
  303. }
  304. for (let j = 0; j < this.resultRollIcons[i].length; j++) {
  305. this.resultRollIcons[i][j].getComponent(Item).setIconType(this.resultRollIcons[i][j].getComponent(Item).getIconType(), true);
  306. }
  307. // 滚动层正常停止动作
  308. tween(resultRollbg)
  309. .to(0.2, {y: destY - 40})//, {easing: 'sineIn'}
  310. .to(0.05, {y: destY})//, {easing: 'sineOut'}
  311. .call(()=>{
  312. if (isAppearScatter) {
  313. this.soundManager.playEffect3(ResourceLoader.instance.getResource<AudioClip>("appear_bonus_icon"));
  314. }
  315. this.soundManager.playEffect2(ResourceLoader.instance.getResource<AudioClip>("skipend"));
  316. this.showResultIcons(i);
  317. })
  318. .start();
  319. }
  320. // 转动逻辑
  321. update(deltaTime: number) {
  322. if (!this.isScroll)
  323. return;
  324. for (let i = 0; i < GameConstant.MAX_COL; i++)
  325. {
  326. if (this.rollBgIsScroll[i]) {
  327. var interval = this.isFast ? GameConstant.ROLL_FAST_SPEED : GameConstant.ROLL_NORMAL_SPEED;
  328. this.rollNodes[i].y -= deltaTime * interval;
  329. this.resultRollNodes[i].y -= deltaTime * interval;
  330. if (this.rollNodes[i].y <= -2400) {
  331. this.rollNodes[i].y = this.resultRollNodes[i].y + this.rollNodes[i].getComponent(UITransform).height;
  332. }
  333. if (this.resultRollNodes[i].y <= -2400) {
  334. this.resultRollNodes[i].y = this.rollNodes[i].y + this.resultRollNodes[i].getComponent(UITransform).height;
  335. if (this.rollBgisStop[i]) {
  336. this.rollBgIsScroll[i] = false;
  337. this.rollBgisStop[i] = false;
  338. console.log("update enter rollEnds");
  339. this.rollEnds(i);
  340. }
  341. }
  342. }
  343. }
  344. }
  345. // 接收到结果数据之后设置客户端的结果数据
  346. setRollDatas(msg, bSpecialGame) {
  347. this.rollResultData = msg;
  348. for (let i = 0; i < GameConstant.MAX_ROW; i++) {
  349. for (let j = 0; j < GameConstant.MAX_COL; j++) {
  350. this.resultValues[j][i] = this.rollResultData.m_desk_data[i][j];
  351. this.resultWildTimes[j][i] = this.rollResultData.m_wildTimes_data[i][j];
  352. }
  353. }
  354. this.hasSpecial = this.rollResultData.m_isSpecialGame == 1;
  355. // console.log(this.resultValues);
  356. }
  357. // 展示结果函数
  358. openPrizes(justEnd, bQuick) {
  359. if(this.bGameEnd == true) {
  360. return;
  361. }
  362. let endTime = new Date().getTime();
  363. let leftTime = 0;//this._startRollTime - endTime + 500;
  364. this.delayTime = 0.2;
  365. if(justEnd) {
  366. this.delayTime = 0;
  367. }
  368. Tween.stopAllByTarget(this.node);
  369. this.bQuick = bQuick;
  370. this.freeIconCount = 0;
  371. //快速,并且前四排免费图标总数少于2
  372. if(justEnd) {
  373. // this.playEffect("skip");
  374. for(let i = 0; i < GameConstant.MAX_COL; ++i) {
  375. if (i == 0) this.isScroll = false;
  376. this.rollBgIsScroll[i] = false;
  377. this.rollBgisStop[i] = false;
  378. this.justEnd(i);
  379. if(i >= 5) {
  380. this.delayShowPrizes(200);
  381. }
  382. }
  383. return;
  384. }
  385. tween(this.node)
  386. .delay(leftTime/1000)
  387. .call(()=>{
  388. this.rollBgisStop[0] = true;
  389. })
  390. .start()
  391. }
  392. // 转动结束之后的最终函数
  393. delayShowPrizes(delayTime) {
  394. let extraDelayTime = 0.5
  395. if(this.rollResultData.m_isSpecialGame == 1) {
  396. extraDelayTime = 4.2
  397. }
  398. // for (let i = 0; i < GameConstant.MAX_COL; i++) {
  399. // console.log("delayShowPrizes this.rollBG[i].y = " + this.rollNodes[i].y + ", this.resultRollBg[i].y = " + this.resultRollNodes[i].y);
  400. // }
  401. tween(this.node)
  402. .delay(delayTime / 1000)
  403. .call(()=>{
  404. // this.beforeShowPrize();
  405. })
  406. .delay(0.3)
  407. .call(()=>{
  408. if (this.rollResultData.m_line_size.length > 0)
  409. this.soundManager.playEffect2(ResourceLoader.instance.getResource<AudioClip>("showPrize"));
  410. if (this.hasSpecial){
  411. this.showPrizes();
  412. this.showSpecialPrize();
  413. this.node.parent.getComponent(GameScene).showGameWinScore();
  414. } else {
  415. this.bGameEnd = true;
  416. this.showPrizes();
  417. this.node.parent.getComponent(GameScene).showGameWinScore();
  418. }
  419. })
  420. .delay(extraDelayTime)
  421. .call(()=>{
  422. this.node.parent.getComponent(GameScene).showGameEnd();
  423. })
  424. .start()
  425. }
  426. // beforeShowPrize() {
  427. // for(let i = 0; i < GameConstant.MAX_COL; ++i) {
  428. // for(let j = 0; j < GameConstant.MAX_ROW; ++j) {
  429. // if (this.resultIcons[i][j].getComponent(Item).getIconType() == GameConstant.SPECIAL_ICON)
  430. // continue;
  431. // this.resultIcons[i][j].getComponent(Item).showNormal();
  432. // }
  433. // }
  434. // }
  435. // 展示图标动画
  436. showPrizes() {
  437. for(let i = 0; i < GameConstant.MAX_COL; ++i) {
  438. for(let j = 0; j < GameConstant.MAX_ROW; ++j) {
  439. if (this.rollResultData.m_line_icon_active[j][i] > 0) {
  440. this.resultIcons[i][j].getComponent(Item).showLightAni();
  441. }
  442. }
  443. }
  444. if (this.rollResultData.m_line_size.length > 0) {
  445. tween(this.node)
  446. .delay(2.5)
  447. .call(()=>{
  448. this.showLines(0);
  449. })
  450. .start();
  451. }
  452. }
  453. // 每条线的动画展示和下面的中奖细节展示
  454. showLines(iIndex) {
  455. this.soundManager.playEffect2(ResourceLoader.instance.getResource<AudioClip>("showLine"), 0.25);
  456. if(iIndex >= this.rollResultData.m_line_index.length) {
  457. this.showPrizes();
  458. return;
  459. }
  460. this.winDetail.active = !this.isInScatterGame;
  461. this.showWinDetail(iIndex);
  462. let count = this.rollResultData.m_line_index[iIndex];
  463. for (let i = 0; i < this.rollResultData.m_line_index[iIndex].length; i++) {
  464. var x = Math.floor(this.rollResultData.m_line_index[iIndex][i] / GameConstant.MAX_COL);
  465. var y = this.rollResultData.m_line_index[iIndex][i] % GameConstant.MAX_COL;
  466. this.resultIcons[y][x].getComponent(Item).showLightAni();
  467. }
  468. tween(this.node)
  469. .delay(2)
  470. .call(()=>{
  471. this.showLines(iIndex + 1);
  472. })
  473. .start();
  474. }
  475. // 展示中奖细节
  476. showWinDetail(iIndex) {
  477. let isPlaying = false;
  478. this.winDetailIcons.removeAllChildren();
  479. let iconWidth = 0;
  480. let normalIconW = 0;
  481. let leftIndex = this.rollResultData.m_line_icon[iIndex].length / 2;
  482. for(let k = 0; k < this.rollResultData.m_line_icon[iIndex].length; ++k) {
  483. let resultType = this.rollResultData.m_line_icon[iIndex][k];
  484. let icon = instantiate(this.item);
  485. var x = Math.floor(this.rollResultData.m_line_index[iIndex][k] / GameConstant.MAX_COL);
  486. var y = this.rollResultData.m_line_index[iIndex][k] % GameConstant.MAX_COL;
  487. icon.getComponent(Item).setIconType(resultType, true , this.resultWildTimes[y][x]);
  488. icon.scale = new Vec3(0.15, 0.15, 0.15);
  489. icon.parent = this.winDetailIcons;
  490. icon.active = true;
  491. normalIconW = (icon.getComponent(UITransform).width + 0) * icon.scale.x + 10;
  492. icon.x = normalIconW * (-(leftIndex - k) + 0.5) + 0;
  493. iconWidth += normalIconW;
  494. }
  495. this.winDetailLabel.x = iconWidth / 2;
  496. let singleLineBet = this.node.parent.getComponent(GameScene).getSingleLineBet();
  497. let score = this.rollResultData.m_line_times[iIndex] * singleLineBet;
  498. let str = GameConstant.formatNumber(score);
  499. this.winDetailLabel.getComponent(Label).string = str;
  500. this.winDetailLabel.getComponent(Label).updateRenderData(true);
  501. this.winDetail.getComponent(UIOpacity).opacity = 0;
  502. tween(this.winDetail.getComponent(UIOpacity))
  503. .call(()=>{
  504. let interval = (-this.winDetailLabel.getComponent(UITransform).width) / 2;
  505. this.winDetailIcons.x = interval;
  506. this.winDetailLabel.x = this.winDetailIcons.x + iconWidth / 2;
  507. })
  508. .to(0.3, {opacity: 255})
  509. .delay(1.5)
  510. .to(0.3, {opacity: 0})
  511. .start()
  512. }
  513. // 展示特殊图标
  514. showSpecialPrize() {
  515. console.log("showSpecialPrize");
  516. this.soundManager.playEffect1(ResourceLoader.instance.getResource<AudioClip>("showSpecial"));
  517. for(let i = 0; i < GameConstant.MAX_COL; ++i) {
  518. for(let j = 0; j < GameConstant.MAX_ROW; ++j) {
  519. this.resultIcons[i][j].getComponent(Item).showSpecialAni();
  520. }
  521. }
  522. }
  523. }