RichPanel.ts 41 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016101710181019102010211022102310241025102610271028102910301031103210331034103510361037103810391040104110421043104410451046104710481049105010511052105310541055105610571058105910601061106210631064106510661067106810691070107110721073107410751076107710781079108010811082108310841085108610871088108910901091109210931094109510961097109810991100110111021103110411051106110711081109111011111112111311141115111611171118111911201121112211231124112511261127112811291130113111321133113411351136113711381139114011411142114311441145114611471148114911501151115211531154115511561157115811591160116111621163116411651166116711681169117011711172
  1. import { HTTP_TYPE } from "../datas/CommonData";
  2. import { RichData, RichPropItemParam } from "../datas/RichData";
  3. import Main from "../Main";
  4. import { GameController } from "../manager/GameController";
  5. import GameM, { AUDIO_TYPE, VIDEO_TYPE } from "../manager/GameM";
  6. import GuideMng from "../manager/GuideMng";
  7. import HttpM from "../manager/HttpM";
  8. import UiM from "../manager/UiM";
  9. import RoadItem from "../other/item/RoadItem";
  10. import Roads from "../other/item/Roads";
  11. import { EventMng } from "../tools/EventMng";
  12. import MyExtends, { PlayerPrefs } from "../tools/MyExtends";
  13. import BasePanel from "../uiFrames/BasePanel";
  14. import UIMng, { PanelType } from "../uiFrames/UIMng";
  15. import Random from "../utils/Random";
  16. import Sciencen_M from "../utils/Sciencen_M";
  17. import { Utils } from "../utils/Utils";
  18. import EffectNode from "./EffectNode";
  19. const { ccclass, property } = cc._decorator;
  20. @ccclass
  21. export default class RichPanel extends BasePanel {
  22. @property(cc.Node)
  23. bgRoot: cc.Node = null;
  24. @property(cc.Node)
  25. bg: cc.Node = null;
  26. @property(cc.Node)
  27. mapBgParent: cc.Node = null;
  28. @property(cc.Node)
  29. bgObj: cc.Node = null;
  30. @property(cc.Node)
  31. roadParent: cc.Node = null;
  32. @property(cc.Node)
  33. tipQiPao: cc.Node = null;
  34. @property(cc.Node)
  35. diceNode: cc.Node = null;
  36. @property(cc.Sprite)
  37. diceTouchImg: cc.Sprite = null;
  38. @property(cc.Node)
  39. diceNo1: cc.Node = null;
  40. @property(cc.Node)
  41. diceNo2: cc.Node = null;
  42. @property(cc.Node)
  43. diceDoubleSign: cc.Node = null;
  44. @property(cc.Label)
  45. txtDiceNum: cc.Label = null;
  46. @property(cc.Node)
  47. diceNode1: cc.Node = null;
  48. @property(cc.Sprite)
  49. diceSliderImg: cc.Sprite = null;
  50. @property(cc.Node)
  51. diceSliderSign: cc.Node = null;
  52. @property(cc.Label)
  53. txtDiceNumSign: cc.Label = null;
  54. @property(cc.Node)
  55. diceNode2: cc.Node = null;
  56. @property(cc.Sprite)
  57. diceSliderImg2: cc.Sprite = null;
  58. @property(cc.Node)
  59. diceSliderSign2: cc.Node = null;
  60. @property(cc.Label)
  61. txtDiceNumSign2: cc.Label = null;
  62. @property(cc.Node)
  63. timeRevertNode: cc.Node = null;
  64. @property(cc.Label)
  65. txtUpdate: cc.Label = null;
  66. @property(cc.Node)
  67. doubleNode: cc.Node = null;
  68. @property(cc.Sprite)
  69. doubleSliderImg: cc.Sprite = null;
  70. @property(cc.Node)
  71. doubleFullSgin: cc.Node = null;
  72. @property(cc.Node)
  73. ctrlNode: cc.Node = null;
  74. @property(cc.Sprite)
  75. ctrlSliderImg: cc.Sprite = null;
  76. @property(cc.Node)
  77. ctrlFullSgin: cc.Node = null;
  78. @property(cc.Node)
  79. ctrlFreeBtn: cc.Node = null;
  80. @property(cc.Node)
  81. headNode: cc.Node = null;
  82. @property(cc.Node)
  83. headQiPao: cc.Node = null;
  84. @property(cc.RichText)
  85. txtHeadQiPao: cc.RichText = null;
  86. @property(cc.Node)
  87. touchValid: cc.Node = null;
  88. @property(cc.Sprite)
  89. touchValidSlider: cc.Sprite = null;
  90. @property(sp.Skeleton)
  91. touchSpine: sp.Skeleton = null;
  92. @property(cc.Node)
  93. finger: cc.Node = null;
  94. @property(sp.Skeleton)
  95. diceSpine: sp.Skeleton = null;
  96. @property(cc.Sprite)
  97. diceCur: cc.Sprite = null;
  98. @property(sp.Skeleton)
  99. tangSpine: sp.Skeleton = null;
  100. @property(cc.Node)
  101. private tsQipao: cc.Node = null;
  102. @property(cc.Label)
  103. private tsDice: cc.Label = null;
  104. @property(cc.Node)
  105. bookBtnImg: cc.Node = null;
  106. @property(cc.Label)
  107. txtBook: cc.Label = null;
  108. @property(cc.Node)
  109. pointBook: cc.Node = null;
  110. @property(cc.Node)
  111. eft_ctrlCard: cc.Node = null;
  112. @property(cc.Node)
  113. eft_doubleCard: cc.Node = null;
  114. @property(cc.Node)
  115. eft_cszNode: cc.Node = null;
  116. @property(sp.Skeleton)
  117. eft_cszSpine: sp.Skeleton = null;
  118. @property(cc.Node)
  119. eft_csz1: cc.Node = null;
  120. @property(cc.Node)
  121. eft_csz2: cc.Node = null;
  122. @property(cc.Label)
  123. eft_csztxt: cc.Label = null;
  124. @property(cc.Node)
  125. eft_particle: cc.Node = null;
  126. @property(cc.Node)
  127. panel_gift: cc.Node = null;
  128. @property(cc.Node)
  129. panel_gift_panel: cc.Node = null;
  130. @property(cc.Node)
  131. gift_titles: cc.Node[] = [];
  132. //@property(cc.Label)
  133. //txtTilteGift: cc.Label = null;
  134. @property(cc.Label)
  135. txtGiftType: cc.Label = null;
  136. @property(cc.Label)
  137. txtGiftDice: cc.Label = null;
  138. @property(cc.Node)
  139. inputMask: cc.Node = null;
  140. @property(cc.Prefab)
  141. pfb_Road: cc.Prefab = null;
  142. isDiceTimer: boolean = false;
  143. diceMinTime: number = 1;
  144. diceMaxTime: number = 10;
  145. diceSpeed: number = 0.4;
  146. diceTimer: number = 0;
  147. //diceSlider: number = 0;
  148. speed: number = 1
  149. //骰子恢复
  150. isRevertDice: boolean = false;
  151. revertTimer: number = 0;
  152. lastStandMode: number = 0;
  153. curStepNum: number = 0;
  154. needStepNum: number = 1;
  155. isNewPlayGift: boolean = false;
  156. private isGoldDice: boolean = false;
  157. private isInit: boolean = false;
  158. onLoad() {
  159. this.diceNode.on(cc.Node.EventType.TOUCH_START, this.OnDiceTouchStart, this);
  160. this.diceNode.on(cc.Node.EventType.TOUCH_END, this.OnDiceTouchEnd, this);
  161. this.diceNode.on(cc.Node.EventType.TOUCH_CANCEL, this.OnDiceTouchEnd, this);
  162. this.bgRoot.on(cc.Node.EventType.TOUCH_CANCEL, this.OnScreenTouch, this);
  163. this.diceMinTime = RichData.Ins.richItemCardCfg.diceChargeMin;
  164. this.diceMaxTime = RichData.Ins.richItemCardCfg.diceChargeMax;
  165. this.diceSpeed = RichData.Ins.richItemCardCfg.diceSpeed;
  166. //this.tsQipao = this.tangSpine.node.getChildByName("qipao");
  167. //this.tsDice = this.tangSpine.node.getChildByName("qipao/dice").getComponent(cc.Sprite);
  168. //console.log("0--------->Child Name:" + this.tsDice.spriteFrame.name);
  169. console.log("this.di---------------------------" + this.diceMinTime + " Max:" + this.diceMaxTime + " Speed:" + this.diceSpeed);
  170. EventMng.Register_Event("NewPlayGift", this.NewPlayGift, this);
  171. }
  172. OnEnter() {
  173. this.Init();
  174. this.node.active = true;
  175. RichData.Ins.isOpenRichPanel = true;
  176. GameM.audioM.setPauseMusic();
  177. GameM.audioM.playMateEffect(AUDIO_TYPE.sutrabgm, true);
  178. this.CheckCanCollectBook();
  179. }
  180. OnExit() {
  181. this.node.active = false;
  182. this.tipQiPao.active = false;
  183. RichData.Ins.isOpenRichPanel = false;
  184. GameController.Ins.SwitchAudio(3);
  185. UiM.Instance.hallNode.getComponent(Main).UpdateRichManQipao();
  186. }
  187. update(dt) {
  188. this.TimerDiceTouch(dt);
  189. this.TimerRevertDice(dt);
  190. }
  191. Init() {
  192. if (!this.isInit) {
  193. this.isInit = true;
  194. let road = cc.instantiate(this.pfb_Road);
  195. this.roadParent.addChild(road);
  196. let roadsScr = road.getComponent(Roads);
  197. RichData.Ins.MapInit(this, this.bgRoot, this.bg, roadsScr);
  198. this.UpdateInfo();
  199. this.PanelActiveInit();
  200. this.CheckNewDayGift();
  201. } else {
  202. //页面刷新
  203. RichData.Ins.RichPanelUpdateInit();
  204. }
  205. //HttpM.Instance.SendData(HTTP_TYPE.richManInitCardInfo, {}, (res) => {
  206. // console.log("--->Init Info:", res);
  207. // //if (res.data != null && res.data.code == 1) {
  208. // // UIMng.Ins.GetPanel(PanelType.RichCollectPanel).OnEnter(res.data.fairyjadec);
  209. // //} else {
  210. // // console.log("request fail : msg:" + res.errmsg);
  211. // //}
  212. //}, null, (res) => {
  213. // console.log("--->Init Info Error:", res);
  214. //}, null, false);
  215. }
  216. CheckNewDayGift() {
  217. if (RichData.Ins.newPlayer == 1) {
  218. PlayerPrefs.SetInt("RichNewDay", (new Date()).getDate());
  219. this.isNewPlayGift = true;
  220. this.txtDiceNum.string = (RichData.Ins.diceTotalNum - RichData.Ins.richItemCardCfg.diceNewPlayer) + "";
  221. //this.scheduleOnce(() => {
  222. // //引导取经 大富翁
  223. // GuideMng.Ins.CheckRichGuide26();
  224. // //GuideMng.Ins.CheckRichGuide21();
  225. //}, 0.15);
  226. } else {
  227. let d = new Date();
  228. if (PlayerPrefs.GetInt("RichNewDay", -1) != d.getDate()) {
  229. this.isNewPlayGift = false;
  230. this.gift_titles[0].active = false;
  231. this.gift_titles[1].active = true;
  232. this.txtGiftType.string = "每天都会赠送哦!";
  233. this.txtGiftDice.string = "x" + RichData.Ins.richItemCardCfg.diceDailyNum;
  234. this.panel_gift_panel.scale = 0;
  235. this.panel_gift.active = true;
  236. cc.tween(this.panel_gift_panel).to(0.2, { scale: 1 }, { easing: "backOut" })
  237. .call(() => {
  238. })
  239. .start();
  240. PlayerPrefs.SetInt("RichNewDay", d.getDate());
  241. }
  242. }
  243. //if (PlayerPrefs.GetInt("RichNewDay", 0) == 0) {
  244. // PlayerPrefs.SetInt("RichNewDay", (new Date()).getDate());
  245. // console.log("----Rich Day:" + PlayerPrefs.GetInt("RichNewDay"));
  246. // this.isNewPlayGift = true;
  247. // this.txtDiceNum.string = (RichData.Ins.diceTotalNum - RichData.Ins.richItemCardCfg.diceNewPlayer) + "";
  248. //} else {
  249. // let d = new Date();
  250. // if (PlayerPrefs.GetInt("RichNewDay", 0) != d.getDate()) {
  251. // this.isNewPlayGift = false;
  252. // this.gift_titles[0].active = false;
  253. // this.gift_titles[1].active = true;
  254. // this.txtGiftType.string = "每天都会赠送哦!";
  255. // this.txtGiftDice.string = "x" + RichData.Ins.richItemCardCfg.diceDailyNum;
  256. // this.panel_gift_panel.scale = 0;
  257. // this.panel_gift.active = true;
  258. // cc.tween(this.panel_gift_panel).to(0.2, { scale: 1 }, { easing: "backOut" })
  259. // .call(() => {
  260. // })
  261. // .start();
  262. // PlayerPrefs.SetInt("RichNewDay", d.getDate());
  263. // }
  264. //}
  265. }
  266. NewPlayGift() {
  267. if (RichData.Ins.newPlayer == 1) {
  268. this.gift_titles[0].active = true;
  269. this.gift_titles[1].active = false;
  270. this.txtGiftType.string = "获得新玩家专享奖励";
  271. this.txtGiftDice.string = "x" + RichData.Ins.richItemCardCfg.diceNewPlayer;
  272. this.panel_gift_panel.scale = 0;
  273. this.panel_gift.active = true;
  274. cc.tween(this.panel_gift_panel).to(0.2, { scale: 1 }, { easing: "backOut" })
  275. .call(() => {
  276. })
  277. .start();
  278. }
  279. }
  280. UpdateInfo() {
  281. this.txtDiceNum.string = RichData.Ins.diceTotalNum + "";
  282. //this.txtBook.string = RichData.Ins.scriptureNum + "";
  283. this.txtBook.string = Sciencen_M.instance.format(RichData.Ins.scriptureNum.toString()) + "/" + Sciencen_M.instance.format(RichData.Ins.scriptureNextNum.toString());
  284. if (RichData.Ins.diceTotalNum > 0) {
  285. this.diceNo1.active = false;
  286. this.diceNo2.active = false;
  287. this.diceTouchImg.node.active = true;
  288. } else {
  289. this.diceNo1.active = true;
  290. this.diceNo2.active = false;
  291. this.diceTouchImg.node.active = false;
  292. }
  293. if (RichData.Ins.doubleRemain > 0) {
  294. this.diceDoubleSign.active = true;
  295. this.headQiPao.active = true;
  296. this.txtHeadQiPao.string = "<b width=5>双倍奖励\n只有<color=red><size=30>" + RichData.Ins.doubleRemain + "次</size></color>了!</b>";
  297. if (!this.isGoldDice) {
  298. cc.loader.loadRes("xiyou/richman/dice_gold" + this.needStepNum, cc.SpriteFrame, (err, assets) => {
  299. if (err) {
  300. cc.error(err);
  301. return;
  302. }
  303. this.diceCur.spriteFrame = assets;
  304. this.isGoldDice = true;
  305. })
  306. }
  307. }
  308. else {
  309. this.diceDoubleSign.active = false;
  310. this.headQiPao.active = false;
  311. if (this.isGoldDice) {
  312. cc.loader.loadRes("xiyou/richman/dice_nor" + this.needStepNum, cc.SpriteFrame, (err, assets) => {
  313. if (err) {
  314. cc.error(err);
  315. return;
  316. }
  317. this.diceCur.spriteFrame = assets;
  318. this.isGoldDice = false;
  319. })
  320. }
  321. }
  322. this.ctrlSliderImg.fillRange = RichData.Ins.remoteCtrlNum / 3;
  323. this.ctrlFullSgin.active = RichData.Ins.remoteCtrlNum == 3;
  324. this.ctrlFreeBtn.active = RichData.Ins.remoteCtrlNum <= 0;
  325. this.doubleSliderImg.fillRange = RichData.Ins.doubleNum / 3;
  326. //console.log("-----------------------------" + (RichData.Ins.doubleNum / 3));
  327. this.doubleFullSgin.active = RichData.Ins.doubleNum == 3;
  328. //let url;
  329. //if (this.diceDoubleSign.active)
  330. // url = "xiyou/richman/dice_gold6";
  331. //else
  332. // url = "xiyou/richman/dice_nor6";
  333. ////url += Math.floor(this.diceSliderImg.fillRange / (1 / 6)) + 1;
  334. //
  335. //cc.loader.loadRes(url, cc.SpriteFrame, (err, assets) => {
  336. // if (err) {
  337. // cc.error(err);
  338. // return;
  339. // }
  340. // this.diceTouchImg.spriteFrame = assets;
  341. //})
  342. }
  343. /**更新恢复骰子*/
  344. CheckUpdateRevertTime() {
  345. if (RichData.Ins.diceSingleRecoverTime != 0) {
  346. this.timeRevertNode.active = true;
  347. //let targetTime=new Date(RichData.Ins.diceRecoverTime);
  348. let deltaTime = RichData.Ins.diceSingleRecoverTime - (new Date()).getTime();
  349. console.log("----Update Revert Time:" + deltaTime + " ms:" + (deltaTime / 1000));
  350. //let time = Math.floor(deltaTime * 0.001) % (3600 / RichData.Ins.richItemCardCfg.diceRecover);
  351. //this.revertTimer = time == 0 ? (3600 / RichData.Ins.richItemCardCfg.diceRecover) : time;
  352. RichData.Ins.revertTimer = deltaTime * 0.001;
  353. //this.revertTimer = deltaTime * 0.001;
  354. //TEST
  355. //this.revertTimer = 1;
  356. this.isRevertDice = true;
  357. } else {
  358. this.isRevertDice = false;
  359. RichData.Ins.revertTimer = 0;
  360. //this.revertTimer = 0;
  361. this.timeRevertNode.active = false;
  362. }
  363. }
  364. CheckUpdateRevering() {
  365. return this.isRevertDice;
  366. }
  367. /**检查加载地图*/
  368. CheckLoadMap() {
  369. let type = RichData.Ins.CheckLoadMapType();
  370. if (type != 0) {
  371. let road = cc.instantiate(this.pfb_Road);
  372. this.roadParent.addChild(road);
  373. if (type == 1)
  374. road.setSiblingIndex(0);
  375. let roadsScr = road.getComponent(Roads);
  376. RichData.Ins.LoadMap(type, roadsScr);
  377. }
  378. }
  379. /**加载背景地图*/
  380. LoadMapBg(pos: cc.Vec2) {
  381. let bg = cc.instantiate(this.bgObj);
  382. this.mapBgParent.addChild(bg);
  383. bg.setPosition(pos);
  384. }
  385. TimerDiceTouch(dt) {
  386. if (this.isDiceTimer) {
  387. this.diceTimer += dt;
  388. if (this.touchValidSlider.fillRange >= 1) {
  389. //松开后消失
  390. // if (this.touchValid.active) {
  391. // this.touchValid.active = false;
  392. // this.touchSpine.node.active = true;
  393. // this.touchSpine.setAnimation(0, "animation", false);
  394. // setTimeout(() => {
  395. // this.touchSpine.node.active = false;
  396. // }, 1000);
  397. // }
  398. }
  399. else { this.touchValidSlider.fillRange = this.diceTimer / this.diceMinTime; }
  400. //this.diceSlider += dt;
  401. //slider1
  402. this.diceSliderSign.x = -165 + this.diceSliderImg.fillRange * 330;
  403. this.txtDiceNumSign.string = (Math.floor(this.diceSliderImg.fillRange / (1 / 6)) + 1) + "";
  404. //slider2
  405. this.diceSliderSign2.x = -165 + this.diceSliderImg2.fillRange * 330;
  406. this.txtDiceNumSign2.string = (Math.floor(this.diceSliderImg2.fillRange / (1 / 6)) + 1) + "";
  407. if (this.diceTimer >= this.diceMaxTime) {
  408. EffectNode.instance.PlayTip("投掷时间过长,系统自动掷出");
  409. this.DiceAniSuccessEnd();
  410. }
  411. }
  412. }
  413. TimerRevertDice(dt) {
  414. if (this.isRevertDice) {
  415. RichData.Ins.revertTimer -= dt;
  416. //this.revertTimer -= dt;
  417. if (RichData.Ins.revertTimer <= 0) {
  418. this.isRevertDice = false;
  419. RichData.Ins.revertTimer = 0;
  420. RichData.Ins.UpdateItemCard(0, 1, 0, 0, 0, 0, 0);
  421. this.timeRevertNode.active = false;
  422. }
  423. this.txtUpdate.string = MyExtends.TimeToFormat(RichData.Ins.revertTimer, 3);
  424. }
  425. }
  426. TimerTipQipao(dt) {
  427. }
  428. DiceAniFailEnd() {
  429. this.isDiceTimer = false;
  430. this.diceTimer = 0;
  431. cc.Tween.stopAllByTarget(this.diceSliderImg);
  432. cc.Tween.stopAllByTarget(this.diceSliderImg2);
  433. this.diceSpine.clearTrack(0);
  434. this.diceSpine.node.active = false;
  435. this.diceCur.node.active = true;
  436. this.diceSliderImg.fillRange = 0;
  437. this.diceSliderImg2.fillRange = 0;
  438. this.touchValid.active = false;
  439. this.diceSliderSign.x = -165;
  440. this.txtDiceNumSign.string = "0";
  441. this.diceSliderSign2.x = -165;
  442. this.txtDiceNumSign2.string = "0";
  443. console.log("Cur Dice Num:" + (Math.floor(this.diceSliderImg.fillRange / (1 / 6)) + 1));
  444. GameM.audioM.stopLoopEffect();
  445. }
  446. /**骰子 投掷成功*/
  447. DiceAniSuccessEnd() {
  448. this.isDiceTimer = false;
  449. this.diceTimer = 0;
  450. cc.Tween.stopAllByTarget(this.diceSliderImg);
  451. cc.Tween.stopAllByTarget(this.diceSliderImg2);
  452. this.diceSpine.clearTrack(0);
  453. this.diceSpine.node.active = false;
  454. //this.touchValid.active = false;
  455. if (this.touchValid.active) {
  456. this.touchValid.active = false;
  457. this.touchSpine.node.active = true;
  458. this.touchSpine.setAnimation(0, "animation", false);
  459. setTimeout(() => {
  460. this.touchSpine.node.active = false;
  461. }, 1000);
  462. }
  463. this.diceSliderSign.x = -165 + this.diceSliderImg.fillRange * 330;
  464. this.txtDiceNumSign.string = (Math.floor(this.diceSliderImg.fillRange / (1 / 6)) + 1) + "";
  465. this.diceSliderSign2.x = -165 + this.diceSliderImg2.fillRange * 330;
  466. this.txtDiceNumSign2.string = (Math.floor(this.diceSliderImg2.fillRange / (1 / 6)) + 1) + "";
  467. let url;
  468. if (this.diceDoubleSign.active)
  469. url = "xiyou/richman/dice_gold";
  470. else
  471. url = "xiyou/richman/dice_nor";
  472. let dicenum = 0;
  473. if (this.diceNode1.active)
  474. dicenum = Math.floor(this.diceSliderImg.fillRange / (1 / 6)) + 1;
  475. else
  476. dicenum = Math.floor(this.diceSliderImg2.fillRange / (1 / 6)) + 1;
  477. url += dicenum;
  478. cc.loader.loadRes(url, cc.SpriteFrame, (err, assets) => {
  479. if (err) {
  480. cc.error(err);
  481. return;
  482. }
  483. this.diceCur.spriteFrame = assets;
  484. this.diceTouchImg.spriteFrame = assets;
  485. this.diceCur.node.active = true;
  486. })
  487. this.tsDice.node.scaleX = Math.abs(this.tsDice.node.scaleX) * (this.tangSpine.node.scaleX > 0 ? 1 : -1);
  488. this.tsDice.string = "前进" + dicenum + "步";
  489. console.log("Cur Dice Num:" + dicenum);
  490. this.inputMask.active = true;
  491. console.log("Dice End: " + true);
  492. this.CloudAni(dicenum);
  493. //this.scheduleOnce(() => {
  494. // this.StartMove(dicenum);
  495. //}, 1);
  496. RichData.Ins.UseDice();
  497. //this.UpdateInfo();
  498. GameM.audioM.stopLoopEffect();
  499. }
  500. /**遥控卡 使用成功
  501. * @param diceNum 遥控选择的骰子点数
  502. */
  503. UseCtrlCardEnd(diceNum: number) {
  504. this.inputMask.active = true;
  505. this.tsDice.node.scaleX = Math.abs(this.tsDice.node.scaleX) * (this.tangSpine.node.scaleX > 0 ? 1 : -1);
  506. this.tsDice.string = "前进" + diceNum + "步";
  507. console.log("Ctrl End: " + true);
  508. this.CloudAni(diceNum);
  509. //this.scheduleOnce(() => {
  510. // this.StartMove(diceNum);
  511. //}, 1);
  512. }
  513. CloudAni(dicenum: number) {
  514. this.tsQipao.opacity = 0;
  515. this.tsQipao.active = true;
  516. let a1 = cc.fadeTo(0.3, 255);
  517. let a2 = cc.delayTime(0.8);
  518. let a3 = cc.fadeTo(0.3, 0);
  519. let a4 = cc.callFunc(() => {
  520. this.tsQipao.active = false;
  521. this.StartMove(dicenum);
  522. });
  523. this.tsQipao.runAction(cc.sequence(a1, a2, a3, a4));
  524. }
  525. step = 0;
  526. StartMove(diceNum: number) {
  527. //this.diceCur.node.active = false;
  528. //this.inputMask.active = false;
  529. this.needStepNum = diceNum;// (Math.floor(this.diceSliderImg.fillRange / (1 / 6)) + 1);
  530. //if (this.step == 0)
  531. //this.needStepNum = 1; //TEST
  532. //else if (this.step == 1)
  533. // this.needStepNum = 2;
  534. //else if (this.step == 2)
  535. // this.needStepNum = 6;
  536. //else if (this.step == 3)
  537. // this.needStepNum = 3;
  538. //this.step++;
  539. //this.needStepNum = 6;
  540. if (this.needStepNum > 0) {
  541. this.curStepNum = 0;
  542. //let roads = RichData.Ins.GetMoveRoads(this.needStepNum * (Random.GetBool() ? 1 : -1));
  543. let roads = RichData.Ins.GetMoveRoads(this.needStepNum);
  544. console.log("Road::::", roads);
  545. let pos = MyExtends.convetOtherNodeSpaceAR(roads[roads.length - 1].node, this.bgRoot);
  546. //let deltaLen = roads[roads.length - 1].node.y - this.tangSpine.node.y;
  547. console.log("------------> " + pos.y);
  548. if (pos.y > 0) {
  549. let a1 = cc.moveBy(0.5 * this.needStepNum, 0, -pos.y);
  550. let a2 = cc.callFunc(() => { console.log("start move end"); });
  551. this.bg.runAction(cc.sequence(a1, a2));
  552. RichData.Ins.CheckLoadMapBg(cc.v2(0, this.bg.y - pos.y));
  553. }
  554. this.MoveAni(roads);
  555. } else {
  556. console.log("you dice 0 step")
  557. }
  558. }
  559. MoveAni(roads: RoadItem[]) {
  560. //this.curMoveNum++;
  561. this.tangSpine.node.active = true;
  562. let pos = MyExtends.convetOtherNodeSpaceAR(roads[this.curStepNum].node, this.bg);
  563. console.log("Last::::: " + this.lastStandMode + " Mode::::: " + roads[this.curStepNum].standMode);
  564. if (this.lastStandMode != roads[this.curStepNum].standMode) {
  565. this.lastStandMode = roads[this.curStepNum].standMode;
  566. if (roads[this.curStepNum].standMode == 1) {
  567. this.tangSpine.node.scaleX = 1;
  568. //this.tangSpine.setAnimation(0, "walk", true);
  569. }
  570. else if (roads[this.curStepNum].standMode == 2) {
  571. this.tangSpine.node.scaleX = 1;
  572. //this.tangSpine.setAnimation(0, "b_walk", true);
  573. }
  574. else {
  575. this.tangSpine.node.scaleX = -1;
  576. //this.tangSpine.setAnimation(0, "b_walk", true);
  577. }
  578. }
  579. cc.tween(this.tangSpine.node)
  580. .to(0.5, { position: pos })
  581. .call(() => {
  582. //roads[this.curStepNum].ActiveLight(false);
  583. this.curStepNum++;
  584. if (this.curStepNum >= this.needStepNum) {
  585. console.log("Move End: " + false);
  586. this.lastStandMode = 0;
  587. if (roads[this.curStepNum - 1].standMode == 1) {
  588. this.tangSpine.node.scaleX = 1;
  589. //this.tangSpine.setAnimation(0, "idle", true);
  590. }
  591. else if (roads[this.curStepNum - 1].standMode == 2) {
  592. this.tangSpine.node.scaleX = 1;
  593. //this.tangSpine.setAnimation(0, "b_idle", true);
  594. }
  595. else {
  596. this.tangSpine.node.scaleX = -1;
  597. //this.tangSpine.setAnimation(0, "b_idle", true);
  598. }
  599. RichData.Ins.UpdatePlayPos();
  600. this.CheckLoadMap();
  601. //棋盘道具检测
  602. roads[this.curStepNum - 1].CheckReward();
  603. this.UpdateInfo();
  604. console.log("move end");
  605. } else {
  606. this.MoveAni(roads);
  607. }
  608. })
  609. .start();
  610. cc.tween(this.tangSpine.node)
  611. .delay(0.25)
  612. .call(() => {
  613. console.log("length: " + roads.length + " num: " + this.curStepNum);
  614. if (this.curStepNum < roads.length)
  615. roads[this.curStepNum].ActiveLight(false);
  616. })
  617. .start();
  618. GameM.audioM.playEffect(AUDIO_TYPE.sutrawalk);
  619. }
  620. /**整个移动结束*/
  621. MoveEnd() {
  622. this.inputMask.active = false;
  623. //引导取经 大富翁
  624. //GuideMng.Ins.CheckRichGuide22();
  625. }
  626. DiceAni() {
  627. this.speed = Random.Range(90, 110, false) / 100;
  628. if (this.diceNode1.active) {
  629. cc.tween(this.diceSliderImg)
  630. .to(this.diceSpeed * this.speed, { fillRange: 1 })
  631. .call(() => {
  632. this.diceSliderImg.fillRange = 0;
  633. //this.speed = Random.Range(90, 110, false) / 100;//* (Random.GetBool() ? 1 : -1);
  634. //console.log("Speed:" + this.speed);
  635. this.DiceAni();
  636. GameM.audioM.playEffect(AUDIO_TYPE.sutratouchborder);
  637. })
  638. .start();
  639. } else {
  640. cc.tween(this.diceSliderImg2)
  641. .to(this.diceSpeed * this.speed, { fillRange: 1 })
  642. .call(() => {
  643. this.diceSliderImg2.fillRange = 0;
  644. //this.speed = Random.Range(90, 110, false) / 100;//* (Random.GetBool() ? 1 : -1);
  645. //console.log("Speed:" + this.speed);
  646. this.DiceAni();
  647. GameM.audioM.playEffect(AUDIO_TYPE.sutratouchborder);
  648. })
  649. .start();
  650. }
  651. }
  652. OnDiceTouchStart() {
  653. if (RichData.Ins.IsCanDice()) {
  654. this.diceSliderImg.fillRange = 0;
  655. this.diceSliderImg2.fillRange = 0;
  656. this.diceTimer = 0;
  657. this.isDiceTimer = true;
  658. this.diceSpine.node.active = true;
  659. if (RichData.Ins.doubleRemain > 0) {
  660. this.diceSpine.clearTrack(0);
  661. this.diceSpine.setToSetupPose();
  662. this.diceSpine.setAnimation(0, "animation2", true);
  663. }
  664. else {
  665. this.diceSpine.clearTrack(0);
  666. this.diceSpine.setToSetupPose();
  667. this.diceSpine.setAnimation(0, "animation", true);
  668. }
  669. this.diceCur.node.active = false;
  670. this.touchValid.active = true;
  671. this.touchValidSlider.fillRange = 0;
  672. this.DiceAni();
  673. GameM.audioM.playLoopEffect(AUDIO_TYPE.sutradice);
  674. } else {
  675. console.log("you can not dice");
  676. //打开获取骰子方法界面
  677. UIMng.Ins.AsyncGetPanel(PanelType.RichPropPanel, (panel) => {
  678. panel.OnEnter(3);
  679. });
  680. //UIMng.Ins.GetPanel(PanelType.RichPropPanel).OnEnter(3);
  681. }
  682. }
  683. OnDiceTouchEnd() {
  684. this.isDiceTimer = false;
  685. if (this.diceTimer > this.diceMinTime && this.diceTimer < this.diceMaxTime) {
  686. this.DiceAniSuccessEnd();
  687. } else {
  688. this.DiceAniFailEnd();
  689. if (RichData.Ins.IsCanDice())
  690. EffectNode.instance.PlayTip("请长按超过" + this.diceMinTime + "秒才能投掷");
  691. //this.isDiceTimer = false;
  692. //this.diceTimer = 0;
  693. //cc.Tween.stopAllByTarget(this.diceSliderImg);
  694. }
  695. //let p = new RichPropItemParam();
  696. //p.diceDailyNum = 0;
  697. //RichData.Ins.UpdateItemCardNew(p);
  698. //RichData.Ins.GetASubject();
  699. //this.PlayCSZEft(3);
  700. //RichData.Ins.TESTPlayDoubleEft();
  701. // UIMng.Ins.AsyncGetPanel(PanelType.AdRbPanel, (panel) => {
  702. // panel.OnEnter();
  703. // });
  704. }
  705. OnScreenTouch() {
  706. if (this.finger.active)
  707. this.finger.active = false;
  708. //console.log("----------------OnScreenTouch");
  709. }
  710. /**
  711. * 显示气泡
  712. * @param context 提示上下文
  713. */
  714. DisplayTipQiPao(context: string, pos: cc.Vec2) {
  715. this.unschedule(this.CloseTipQiPao);
  716. this.tipQiPao.setPosition(pos);
  717. this.tipQiPao.active = true;
  718. this.tipQiPao.getComponentInChildren(cc.Label).string = context;
  719. this.scheduleOnce(this.CloseTipQiPao, 2);
  720. }
  721. CloseTipQiPao() {
  722. this.tipQiPao.active = false;
  723. }
  724. async Play2RewardEft() {
  725. let eftNode = cc.instantiate(await Utils.loadResPromise("prefabs/item/Rich2RwdDiceEft"));
  726. eftNode.parent = this.diceTouchImg.node;
  727. eftNode.setPosition(0, 0);
  728. //let time = eftNode.getComponent(sp.Skeleton).findAnimation("animation").duration;
  729. //console.log("-------------Time:" + time);
  730. let a = setTimeout(() => {
  731. eftNode.destroy();
  732. eftNode = null;
  733. }, 1160);
  734. }
  735. /**
  736. * 播放传送阵文字效果
  737. * @param stepNum 传送的格数 +为前进 -为后退
  738. */
  739. PlayCSZEft(stepNum: number) {
  740. cc.Tween.stopAllByTarget(this.eft_cszNode);
  741. this.eft_cszNode.x = -750;
  742. this.eft_csztxt.string = Math.abs(stepNum) + "";
  743. if (stepNum > 0) {
  744. this.eft_csz1.active = true;
  745. this.eft_csz2.active = false;
  746. } else {
  747. this.eft_csz1.active = false;
  748. this.eft_csz2.active = true;
  749. }
  750. //this.eft_cszSpine.node.active = true;
  751. //console.log("---Time1 "+this.eft_cszSpine.findAnimation("qianjin").duration)
  752. //console.log("---Time2 "+this.eft_cszSpine.findAnimation("houtui").duration)
  753. this.eft_cszNode.active = true;
  754. this.eft_cszSpine.setAnimation(0, "qianjin", false);
  755. cc.tween(this.eft_cszNode)
  756. .to(0.2, { position: cc.v2(0, this.eft_cszNode.y) })
  757. .delay(1.5)
  758. .call(() => {
  759. this.eft_cszSpine.setAnimation(0, "houtui", false);
  760. })
  761. .to(0.2, { position: cc.v2(750, this.eft_cszNode.y) })
  762. .call(() => {
  763. this.eft_cszNode.active = false;
  764. //this.eft_cszSpine.node.active = false;
  765. })
  766. .start();
  767. }
  768. /**
  769. * 播放粒子特效
  770. * @param proptype 道具类型 10001 金币 10002 红包币 10004 武将宝盒 20001 加速卡 20002 转盘卡 20003 夺宝券 20006 天赋石 30001 骰子 30002 遥控卡 30003 传送阵 30004 经书 30005 双倍卡
  771. * @param type 播放类型 1 飞头像 2 飞骰子 3 飞遥控 4 飞双倍 5 飞经书
  772. * @param startpos 开始位置
  773. * @param cb 回调
  774. */
  775. PlayParticleEft(proptype: number, type: number, startpos: cc.Vec2, cb: Function = null) {
  776. //let eft = new cc.Node("eft");
  777. //let eftimg = eft.addComponent(cc.Sprite);
  778. //cc.loader.loadRes("xiyou/icon/reward" + proptype, cc.SpriteFrame, (error, assets) => {
  779. // if (error != null) {
  780. // return;
  781. // }
  782. // eftimg.spriteFrame = assets;
  783. //});
  784. //eft.parent = GameController.Ins.Canvas;
  785. //let eft = cc.instantiate(this.eft_particle);
  786. //eft.parent = GameController.Ins.Canvas;
  787. //eft.setPosition(startpos);
  788. //eft.active = true;
  789. let endPos = cc.v2();
  790. let anitype = 6;
  791. switch (proptype) {
  792. case 10001: anitype = 0;
  793. break;
  794. case 10002: anitype = 1;
  795. break;
  796. case 20001: anitype = 10;
  797. break;
  798. case 20002: anitype = 11;
  799. break;
  800. case 20003: anitype = 12;
  801. break;
  802. case 20006: anitype = 13;
  803. break;
  804. case 30001: anitype = 6;
  805. break;
  806. case 30002: anitype = 7;
  807. break;
  808. case 30004: anitype = 9;
  809. break;
  810. case 30005: anitype = 8;
  811. break;
  812. }
  813. switch (type) {
  814. case 1:
  815. endPos = MyExtends.convetOtherNodeSpaceAR(this.headNode, this.node);
  816. break;
  817. case 2:
  818. endPos = MyExtends.convetOtherNodeSpaceAR(this.diceTouchImg.node, this.node);
  819. break;
  820. case 3:
  821. endPos = MyExtends.convetOtherNodeSpaceAR(this.ctrlSliderImg.node, this.node);
  822. break;
  823. case 4:
  824. endPos = MyExtends.convetOtherNodeSpaceAR(this.doubleSliderImg.node, this.node);
  825. break;
  826. case 5:
  827. endPos = MyExtends.convetOtherNodeSpaceAR(this.txtBook.node, this.node);
  828. break;
  829. }
  830. EffectNode.instance.PlayCoinAnim(anitype, 6, startpos, true, endPos, () => {
  831. switch (type) {
  832. case 1:
  833. break;
  834. case 2:
  835. this.diceCur.node.runAction(cc.sequence(cc.scaleTo(0.15, 1.1), cc.scaleTo(0.15, 1)));
  836. this.txtDiceNum.node.runAction(cc.sequence(cc.scaleTo(0.15, 1.1), cc.scaleTo(0.15, 1)));
  837. break;
  838. case 3:
  839. break;
  840. case 4:
  841. break;
  842. case 5:
  843. this.txtBook.node.runAction(cc.sequence(cc.scaleTo(0.15, 1.1), cc.scaleTo(0.15, 1)));
  844. this.bookBtnImg.runAction(cc.sequence(cc.scaleTo(0.15, 1.1), cc.scaleTo(0.15, 1)));
  845. break;
  846. }
  847. if (cb != null)
  848. cb();
  849. this.UpdateInfo();
  850. });
  851. GameM.audioM.playEffect(AUDIO_TYPE.sutraitemfly);
  852. }
  853. /**红点控制 是否有经书可以兑换红包币*/
  854. CheckCanCollectBook() {
  855. RichData.Ins.CheckCanCollect((isCanCollect) => {
  856. console.log("------->CheckCanCollectBook: " + isCanCollect);
  857. this.pointBook.active = isCanCollect;
  858. });
  859. //this.diceSpine.setCompleteListener(()=>{
  860. //
  861. //});
  862. //let entry=this.diceSpine.setAnimation(0,"animaiton",false);
  863. //this.diceSpine.setTrackEventListener(entry,()=>{});
  864. }
  865. /**操作界面初始化*/
  866. PanelActiveInit() {
  867. if (RichData.Ins.remoteCtrlNum > 0)
  868. PlayerPrefs.SetInt("RichCtrl", 1);
  869. if (RichData.Ins.doubleNum > 0)
  870. PlayerPrefs.SetInt("RichDouble", 1);
  871. this.ctrlNode.active = PlayerPrefs.GetInt("RichCtrl", 0) == 1;
  872. this.doubleNode.active = PlayerPrefs.GetInt("RichDouble", 0) == 1;
  873. this.diceNode1.active = PlayerPrefs.GetInt("RichCtrl", 0) == 1 || PlayerPrefs.GetInt("RichDouble", 0) == 1;
  874. this.diceNode2.active = !this.diceNode1.active;
  875. }
  876. /**操作界面激活
  877. * @param type 激活类型 1 获取遥控卡激活 2 获取双倍卡激活
  878. */
  879. CheckPanelActive(type: number) {
  880. if (type == 1) {
  881. if (PlayerPrefs.GetInt("RichCtrl", 0) == 0) {
  882. PlayerPrefs.SetInt("RichCtrl", 1);
  883. this.ctrlNode.active = true;
  884. if (!this.diceNode1.active) {
  885. this.diceNode1.active = true;
  886. this.diceNode2.active = false;
  887. }
  888. if (!this.finger.active) {
  889. this.finger.setPosition(this.ctrlNode.getPosition());
  890. this.finger.active = true;
  891. }
  892. }
  893. } else if (type == 2) {
  894. if (PlayerPrefs.GetInt("RichDouble", 0) == 0) {
  895. PlayerPrefs.SetInt("RichDouble", 1);
  896. this.doubleNode.active = true;
  897. if (!this.diceNode1.active) {
  898. this.diceNode1.active = true;
  899. this.diceNode2.active = false;
  900. }
  901. if (!this.finger.active) {
  902. this.finger.setPosition(this.doubleNode.getPosition());
  903. this.finger.active = true;
  904. }
  905. }
  906. }
  907. }
  908. Click_CtrlBtn() {
  909. if (RichData.Ins.remoteCtrlNum <= 0) {
  910. UIMng.Ins.AsyncGetPanel(PanelType.RichPropPanel, (panel) => {
  911. panel.OnEnter(4);
  912. });
  913. //UIMng.Ins.GetPanel(PanelType.RichPropPanel).OnEnter(4);
  914. //GameM.audioM.playEffect(AUDIO_TYPE.sutraitemfly);
  915. } else {
  916. if (RichData.Ins.diceTotalNum > 0) {
  917. //this.inputMask.active = true;
  918. //this.eft_ctrlCard.setPosition(MyExtends.convetOtherNodeSpaceAR(this.ctrlSliderImg.node, this.node));
  919. //this.eft_ctrlCard.active = true;
  920. //this.eft_ctrlCard.scale = 1;
  921. //this.eft_ctrlCard.angle = 0;
  922. //let a1 = cc.moveTo(0.5, cc.v2());
  923. //let a2 = cc.scaleTo(0.5, 3).easing(cc.easeQuadraticActionIn());
  924. //let a3 = cc.rotateTo(0.5, 1440);
  925. //let b = cc.callFunc(() => {
  926. // this.inputMask.active = false;
  927. // this.eft_ctrlCard.active = false;
  928. UIMng.Ins.AsyncGetPanel(PanelType.RichPropPanel, (panel) => {
  929. panel.OnEnter(1);
  930. });
  931. //UIMng.Ins.GetPanel(PanelType.RichPropPanel).OnEnter(1);
  932. //});
  933. //this.eft_ctrlCard.runAction(cc.sequence(cc.spawn(a1, a2, a3), b));
  934. }
  935. else {
  936. EffectNode.instance.PlayTip("骰子不足");
  937. }
  938. }
  939. //RichData.Ins.GetBossRewards();
  940. //RichData.Ins.UpdateItemCard(5,20,1,1,1,1);
  941. if (this.finger.active)
  942. this.finger.active = false;
  943. GameM.audioM.playEffect(AUDIO_TYPE.button);
  944. }
  945. Click_DoubleBtn() {
  946. if (RichData.Ins.doubleNum > 0) {
  947. //this.inputMask.active = true;
  948. //this.eft_doubleCard.setPosition(MyExtends.convetOtherNodeSpaceAR(this.doubleSliderImg.node, this.node));
  949. //this.eft_doubleCard.active = true;
  950. //this.eft_doubleCard.scale = 1;
  951. //this.eft_doubleCard.angle = 0;
  952. //let a1 = cc.moveTo(0.5, cc.v2());
  953. //let a2 = cc.scaleTo(0.5, 3).easing(cc.easeQuadraticActionIn());
  954. //let a3 = cc.rotateTo(0.5, 1440);
  955. //let b = cc.callFunc(() => {
  956. // this.inputMask.active = false;
  957. // this.eft_doubleCard.active = false;
  958. UIMng.Ins.AsyncGetPanel(PanelType.RichPropPanel, (panel) => {
  959. panel.OnEnter(2);
  960. });
  961. //UIMng.Ins.GetPanel(PanelType.RichPropPanel).OnEnter(2);
  962. //});
  963. //this.eft_doubleCard.runAction(cc.sequence(cc.spawn(a1, a2, a3), b));
  964. //GameM.audioM.playEffect(AUDIO_TYPE.sutraitemfly);
  965. } else {
  966. EffectNode.instance.PlayTip("击杀BOSS可以掉落双倍卡");
  967. }
  968. //RichData.Ins.GetASubject();
  969. //RichData.Ins.GetBossRewards();
  970. //if (RichData.Ins.doubleRemain > 0) {
  971. // RichData.Ins.UpdateItemCard(0, 0, 0, 0, 0, 0, -1);
  972. //}
  973. //RichData.Ins.CheckDoubleEft();
  974. //this.Play2RewardEft();
  975. if (this.finger.active)
  976. this.finger.active = false;
  977. GameM.audioM.playEffect(AUDIO_TYPE.button);
  978. }
  979. Click_BookBtn() {
  980. RichData.Ins.BookCollectInit();
  981. //RichData.Ins.RichDataInit();
  982. GameM.audioM.playEffect(AUDIO_TYPE.button);
  983. }
  984. Click_HelpBtn() {
  985. UIMng.Ins.AsyncGetPanel(PanelType.RichHelpPanel, (panel) => {
  986. panel.OnEnter();
  987. });
  988. //UIMng.Ins.GetPanel(PanelType.RichHelpPanel).OnEnter();
  989. GameM.audioM.playEffect(AUDIO_TYPE.button);
  990. }
  991. Click_BackBtn() {
  992. this.OnExit();
  993. GameM.audioM.playEffect(AUDIO_TYPE.button);
  994. }
  995. Click_GiftCloseBtn() {
  996. this.panel_gift.active = false;
  997. if (this.isNewPlayGift) {
  998. GuideMng.Ins.CheckRichGuide27();
  999. RichData.Ins.PlayParticleEft(30001, 2, this.node);
  1000. //this.txtDiceNum.string = RichData.Ins.diceTotalNum + "";
  1001. } else {
  1002. RichData.Ins.PlayParticleEft(30001, 2, this.node);
  1003. }
  1004. }
  1005. }
  1006. /*
  1007. IT 2.35
  1008. Program Files 3.38
  1009. Program Files 86 4.76
  1010. ProgramData 1.42
  1011. Windows 23.7
  1012. Windows.old 34.7 (占用 28.9)
  1013. 用户 31.5 (占用 25.9)
  1014. hiberfil.sys 6.38
  1015. pagefile.sys 10
  1016. */