GuideMng.ts 21 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596
  1. import Main from "../Main";
  2. import { GuideStep, GuideTask } from "../other/guide/GuideFile";
  3. import GuideRunner from "../other/guide/GuideRunner";
  4. import ZnhTest from "../other/guide/ZnhTest";
  5. import { EventMng } from "../tools/EventMng";
  6. import { PlayerPrefs } from "../tools/MyExtends";
  7. import AdM from "./AdM";
  8. import GameM from "./GameM";
  9. import UiM from "./UiM";
  10. const { ccclass, property } = cc._decorator;
  11. @ccclass
  12. export default class GuideMng {
  13. private static _ins: GuideMng;
  14. public static get Ins(): GuideMng {
  15. if (this._ins == null) {
  16. console.log("Guide cons");
  17. this._ins = new GuideMng();
  18. }
  19. return this._ins;
  20. }
  21. Destroy() {
  22. GuideMng._ins = null;
  23. }
  24. private guideFile: any = null;
  25. private guideTask1: GuideTask = null;
  26. private guideTask2: GuideTask = null;
  27. private guideTask3: GuideTask = null;
  28. private guideTask4: GuideTask = null;
  29. private guideTask5: GuideTask = null;
  30. private guideTask6: GuideTask = null;
  31. private guideTask7: GuideTask = null;
  32. private guideTask8: GuideTask = null;
  33. private guideTask9: GuideTask = null;
  34. private guideTask10: GuideTask = null;
  35. private guideTask11: GuideTask = null;
  36. private guideTask12: GuideTask = null;
  37. private guideTask13: GuideTask = null;
  38. private guideTask14: GuideTask = null;
  39. private guideTask15: GuideTask = null;
  40. private guideTask16: GuideTask = null;
  41. /**财神降临 财神献礼*/
  42. private guideTask17: GuideTask = null;
  43. private guideTask18: GuideTask = null;
  44. private guideTask19: GuideTask = null;
  45. /**取经引导 20-25*/
  46. private guideTask20: GuideTask = null;
  47. //public znhTest: Main = null;
  48. private guideRunner: GuideRunner = null;
  49. private guideNode: cc.Node = null;
  50. private curGuidePause: boolean = false;
  51. isGuiding: boolean = false;
  52. get IsGuideing() {
  53. return this.isGuiding;
  54. }
  55. private steps: GuideStep[] = null;
  56. private step: GuideStep = null;
  57. private curStepIndex: number = 0;
  58. private isOpenGuide: boolean = true;
  59. private curGuideId: number = 0;
  60. get CurGuideId(): number {
  61. return this.curGuideId;
  62. }
  63. set CurGuideId(value) {
  64. this.curGuideId = value;
  65. }
  66. constructor() {
  67. this.Init();
  68. }
  69. Init() {
  70. this.guideFile = cc.loader.getRes("configs/guide").json;
  71. //console.log("Guide File:" + JSON.stringify(this.guideFile));
  72. this.guideTask1 = (this.guideFile.task.task1) as GuideTask;
  73. this.guideTask2 = (this.guideFile.task.task2) as GuideTask;
  74. this.guideTask3 = (this.guideFile.task.task3) as GuideTask;
  75. this.guideTask4 = (this.guideFile.task.task4) as GuideTask;
  76. this.guideTask5 = (this.guideFile.task.task5) as GuideTask;
  77. this.guideTask6 = (this.guideFile.task.task6) as GuideTask;
  78. this.guideTask7 = (this.guideFile.task.task7) as GuideTask;
  79. this.guideTask8 = (this.guideFile.task.task8) as GuideTask;
  80. this.guideTask9 = (this.guideFile.task.task9) as GuideTask;
  81. this.guideTask10 = (this.guideFile.task.task10) as GuideTask;
  82. this.guideTask11 = (this.guideFile.task.task11) as GuideTask;
  83. this.guideTask12 = (this.guideFile.task.task12) as GuideTask;
  84. this.guideTask13 = (this.guideFile.task.task13) as GuideTask;
  85. this.guideTask14 = (this.guideFile.task.task14) as GuideTask;
  86. this.guideTask15 = (this.guideFile.task.task15) as GuideTask;
  87. this.guideTask16 = (this.guideFile.task.task16) as GuideTask;
  88. this.guideTask17 = (this.guideFile.task.task17) as GuideTask;
  89. this.guideTask18 = (this.guideFile.task.task18) as GuideTask;
  90. this.guideTask19 = (this.guideFile.task.task19) as GuideTask;
  91. //console.log("Task2:", this.guideTask2);
  92. }
  93. /**1 新用户首次引导*/
  94. CheckGuide1() {
  95. if (GameM.commonData.isAuth) {
  96. return
  97. }
  98. let isGuide = PlayerPrefs.GetInt("GGuide1", 0) == 1;
  99. if (!isGuide && this.isOpenGuide) {
  100. this.curGuideId = 1;
  101. this.CheckCreateGuide();
  102. this.SetTask(this.guideTask1);
  103. PlayerPrefs.SetInt("GGuide" + this.curGuideId, 1);
  104. AdM.onSendEvent(`guide_${this.curGuideId}`, `引导${this.curGuideId}`, 'guide');
  105. }
  106. }
  107. /**2 五福引导 弃用*/
  108. CheckFiveluckGuide2() {
  109. let isGuide = PlayerPrefs.GetInt("GGuide2", 0) == 1;
  110. if (!isGuide && this.isOpenGuide) {
  111. this.curGuideId = 2;
  112. this.CheckCreateGuide();
  113. this.SetTask(this.guideTask2);
  114. //PlayerPrefs.SetInt("GGuide" + this.curGuideId, 2);
  115. AdM.onSendEvent(`guide_${this.curGuideId}`, `引导${this.curGuideId}`, 'guide');
  116. }
  117. }
  118. /**3 伙伴引导*/
  119. CheckMateGuide3() {
  120. let isGuide = PlayerPrefs.GetInt("GGuide3", 0) == 1;
  121. if (!isGuide && this.isOpenGuide) {
  122. this.curGuideId = 3;
  123. this.CheckCreateGuide();
  124. this.SetTask(this.guideTask3);
  125. PlayerPrefs.SetInt("GGuide" + this.curGuideId, 2);
  126. AdM.onSendEvent(`guide_${this.curGuideId}`, `引导${this.curGuideId}`, 'guide');
  127. }
  128. }
  129. /**4 战斗引导*/
  130. CheckFightGuide4() {
  131. let isGuide = PlayerPrefs.GetInt("GGuide4", 0) == 1;
  132. if (!isGuide && this.isOpenGuide) {
  133. this.curGuideId = 4;
  134. this.CheckCreateGuide();
  135. this.SetTask(this.guideTask4);
  136. //PlayerPrefs.SetInt("GGuide" + this.curGuideId, 2);
  137. AdM.onSendEvent(`guide_${this.curGuideId}`, `引导${this.curGuideId}`, 'guide');
  138. }
  139. }
  140. /**5 探索引导*/
  141. CheckInvestGuide5() {
  142. let isGuide = PlayerPrefs.GetInt("GGuide5", 0) == 1;
  143. if (!isGuide && this.isOpenGuide) {
  144. this.curGuideId = 5;
  145. this.CheckCreateGuide();
  146. this.SetTask(this.guideTask5);
  147. PlayerPrefs.SetInt("GGuide" + this.curGuideId, 1);
  148. AdM.onSendEvent(`guide_${this.curGuideId}`, `引导${this.curGuideId}`, 'guide');
  149. }
  150. }
  151. /**6 夺宝引导 6 和 13*/
  152. CheckTreasureGuide6() {
  153. let isGuide = PlayerPrefs.GetInt("GGuide6", 0) == 1;
  154. if (!isGuide && this.isOpenGuide) {
  155. this.curGuideId = 6;
  156. this.CheckCreateGuide();
  157. this.SetTask(this.guideTask6);
  158. AdM.onSendEvent(`guide_${this.curGuideId}`, `引导${this.curGuideId}`, 'guide');
  159. }
  160. }
  161. /**7 钱庄引导*/
  162. CheckBankGuide7() {
  163. let isGuide = PlayerPrefs.GetInt("GGuide7", 0) == 1;
  164. if (!isGuide && this.isOpenGuide) {
  165. this.curGuideId = 7;
  166. this.CheckCreateGuide();
  167. this.SetTask(this.guideTask7);
  168. AdM.onSendEvent(`guide_${this.curGuideId}`, `引导${this.curGuideId}`, 'guide');
  169. }
  170. }
  171. /**8 日常任务引导*/
  172. CheckTaskGuide8() {
  173. let isGuide = PlayerPrefs.GetInt("GGuide8", 0) == 1;
  174. if (!isGuide && this.isOpenGuide) {
  175. this.curGuideId = 8;
  176. this.CheckCreateGuide();
  177. this.SetTask(this.guideTask8);
  178. PlayerPrefs.SetInt("GGuide" + this.curGuideId, 1);
  179. AdM.onSendEvent(`guide_${this.curGuideId}`, `引导${this.curGuideId}`, 'guide');
  180. }
  181. }
  182. /**9 登录豪礼引导*/
  183. CheckDailyGuide9() {
  184. let isGuide = PlayerPrefs.GetInt("GGuide9", 0) == 1;
  185. if (!isGuide && this.isOpenGuide) {
  186. this.curGuideId = 9;
  187. this.CheckCreateGuide();
  188. this.SetTask(this.guideTask9);
  189. PlayerPrefs.SetInt("GGuide" + this.curGuideId, 2);
  190. AdM.onSendEvent(`guide_${this.curGuideId}`, `引导${this.curGuideId}`, 'guide');
  191. }
  192. }
  193. /**10 提现引导*/
  194. CheckCashGuide10() {
  195. let isGuide = PlayerPrefs.GetInt("GGuide10", 0) == 1;
  196. if (!isGuide && this.isOpenGuide) {
  197. this.curGuideId = 10;
  198. this.CheckCreateGuide();
  199. this.SetTask(this.guideTask10);
  200. PlayerPrefs.SetInt("GGuide" + this.curGuideId, 1);
  201. AdM.onSendEvent(`guide_${this.curGuideId}`, `引导${this.curGuideId}`, 'guide');
  202. }
  203. }
  204. /**11 点击武将生产金币*/
  205. CheckStrikeGuide11() {
  206. let isGuide = PlayerPrefs.GetInt("GGuide11", 0) == 1;
  207. if (!isGuide && this.isOpenGuide) {
  208. let name = UiM.Instance.hallNode.getComponent(Main).GetRoleSpaceIndex();
  209. console.log("-->StrikeGuideName:" + name);
  210. this.UpdateGuideStrikeFile(name);
  211. //this.CheckUnlockStrike();
  212. this.curGuideId = 11;
  213. this.CheckCreateGuide();
  214. this.SetTask(this.guideTask11);
  215. PlayerPrefs.SetInt("GGuide" + this.curGuideId, 1);
  216. AdM.onSendEvent(`guide_${this.curGuideId}`, `引导${this.curGuideId}`, 'guide');
  217. }
  218. }
  219. /**12 五福提现引导*/
  220. CheckFiveluck2Guide12() {
  221. let isGuide = PlayerPrefs.GetInt("GGuide12", 0) == 1;
  222. if (!isGuide && this.isOpenGuide) {
  223. this.curGuideId = 12;
  224. this.CheckCreateGuide();
  225. this.SetTask(this.guideTask12);
  226. PlayerPrefs.SetInt("GGuide" + this.curGuideId, 2);
  227. AdM.onSendEvent(`guide_${this.curGuideId}`, `引导${this.curGuideId}`, 'guide');
  228. }
  229. }
  230. /**13 夺宝引导 6 和 13*/
  231. CheckTreasureGuide13() {
  232. let isGuide = PlayerPrefs.GetInt("GGuide13", 0) == 1;
  233. if (!isGuide && this.isOpenGuide) {
  234. this.curGuideId = 13;
  235. this.CheckCreateGuide();
  236. this.SetTask(this.guideTask13);
  237. AdM.onSendEvent(`guide_${this.curGuideId}`, `引导${this.curGuideId}`, 'guide');
  238. }
  239. }
  240. /**14 提现功能开启引导*/
  241. CheckCashGuide14() {
  242. let isGuide = PlayerPrefs.GetInt("GGuide14", 0) == 1;
  243. if (!isGuide && this.isOpenGuide) {
  244. this.curGuideId = 14;
  245. this.CheckCreateGuide();
  246. this.SetTask(this.guideTask14);
  247. PlayerPrefs.SetInt("GGuide" + this.curGuideId, 2);
  248. AdM.onSendEvent(`guide_${this.curGuideId}`, `引导${this.curGuideId}`, 'guide');
  249. }
  250. }
  251. /**15 转盘开启引导*/
  252. CheckTurntableGuide15() {
  253. let isGuide = PlayerPrefs.GetInt("GGuide15", 0) == 1;
  254. if (!isGuide && this.isOpenGuide) {
  255. this.curGuideId = 15;
  256. this.CheckCreateGuide();
  257. this.SetTask(this.guideTask15);
  258. PlayerPrefs.SetInt("GGuide" + this.curGuideId, 2);
  259. AdM.onSendEvent(`guide_${this.curGuideId}`, `引导${this.curGuideId}`, 'guide');
  260. }
  261. }
  262. /**16 登录豪礼引导*/
  263. CheckDailyGuide16() {
  264. let isGuide = PlayerPrefs.GetInt("GGuide16", 0) == 1;
  265. if (!isGuide && this.isOpenGuide) {
  266. this.curGuideId = 16;
  267. this.CheckCreateGuide();
  268. this.SetTask(this.guideTask16);
  269. PlayerPrefs.SetInt("GGuide" + this.curGuideId, 2);
  270. AdM.onSendEvent(`guide_${this.curGuideId}`, `引导${this.curGuideId}`, 'guide');
  271. }
  272. }
  273. /**17 财神点击引导*/
  274. CheckWealthGuide17() {
  275. let isGuide = PlayerPrefs.GetInt("GGuide17", 0) == 1;
  276. if (!isGuide && this.isOpenGuide) {
  277. this.curGuideId = 17;
  278. this.CheckCreateGuide();
  279. this.SetTask(this.guideTask17);
  280. PlayerPrefs.SetInt("GGuide" + this.curGuideId, 2);
  281. AdM.onSendEvent(`guide_${this.curGuideId}`, `引导${this.curGuideId}`, 'guide');
  282. }
  283. }
  284. /**18 财神领取献礼引导*/
  285. CheckWealthGiftGuide18() {
  286. let isGuide = PlayerPrefs.GetInt("GGuide18", 0) == 1;
  287. if (!isGuide && this.isOpenGuide) {
  288. this.curGuideId = 18;
  289. this.CheckCreateGuide();
  290. this.SetTask(this.guideTask18);
  291. PlayerPrefs.SetInt("GGuide" + this.curGuideId, 2);
  292. AdM.onSendEvent(`guide_${this.curGuideId}`, `引导${this.curGuideId}`, 'guide');
  293. }
  294. }
  295. /**19 明日提现引导*/
  296. CheckNextDailyCashGuide19() {
  297. let isGuide = PlayerPrefs.GetInt("GGuide19", 0) == 1;
  298. if (!isGuide && this.isOpenGuide) {
  299. this.curGuideId = 19;
  300. this.CheckCreateGuide();
  301. this.SetTask(this.guideTask19);
  302. PlayerPrefs.SetInt("GGuide" + this.curGuideId, 1);
  303. AdM.onSendEvent(`guide_${this.curGuideId}`, `引导${this.curGuideId}`, 'guide');
  304. }
  305. }
  306. //------------------------------------------------------------------------------------------------
  307. /**20 取经引导 取经引导,开启*/
  308. CheckRichGuide20() {
  309. let isGuide = PlayerPrefs.GetInt("GGuide20", 0) == 1;
  310. if (!isGuide && this.isOpenGuide) {
  311. this.guideTask20 = (this.guideFile.task.task20) as GuideTask;
  312. this.curGuideId = 20;
  313. this.CheckCreateGuide();
  314. this.SetTask(this.guideTask20);
  315. PlayerPrefs.SetInt("GGuide" + this.curGuideId, 1);
  316. AdM.onSendEvent(`guide_${this.curGuideId}`, `引导${this.curGuideId}`, 'guide');
  317. }
  318. }
  319. /**21 取经引导 取经引导,掷骰子1 弃用 放在 27 中*/
  320. CheckRichGuide21() {
  321. let isGuide = PlayerPrefs.GetInt("GGuide21", 0) == 1;
  322. if (!isGuide && this.isOpenGuide) {
  323. this.guideTask20 = (this.guideFile.task.task21) as GuideTask;
  324. this.curGuideId = 21;
  325. this.CheckCreateGuide();
  326. this.SetTask(this.guideTask20);
  327. PlayerPrefs.SetInt("GGuide" + this.curGuideId, 1);
  328. AdM.onSendEvent(`guide_${this.curGuideId}`, `引导${this.curGuideId}`, 'guide');
  329. }
  330. }
  331. /**22 取经引导 取经引导,掷骰子2*/
  332. CheckRichGuide22() {
  333. let isGuide = PlayerPrefs.GetInt("GGuide22", 0) == 1;
  334. if (!isGuide && this.isOpenGuide) {
  335. this.guideTask20 = (this.guideFile.task.task22) as GuideTask;
  336. this.curGuideId = 22;
  337. this.CheckCreateGuide();
  338. this.SetTask(this.guideTask20);
  339. PlayerPrefs.SetInt("GGuide" + this.curGuideId, 1);
  340. AdM.onSendEvent(`guide_${this.curGuideId}`, `引导${this.curGuideId}`, 'guide');
  341. }
  342. }
  343. /**23 取经引导 取经引导,经书引导*/
  344. CheckRichGuide23() {
  345. let isGuide = PlayerPrefs.GetInt("GGuide23", 0) == 1;
  346. if (!isGuide && this.isOpenGuide) {
  347. this.guideTask20 = (this.guideFile.task.task23) as GuideTask;
  348. this.curGuideId = 23;
  349. this.CheckCreateGuide();
  350. this.SetTask(this.guideTask20);
  351. PlayerPrefs.SetInt("GGuide" + this.curGuideId, 2);
  352. AdM.onSendEvent(`guide_${this.curGuideId}`, `引导${this.curGuideId}`, 'guide');
  353. }
  354. }
  355. /**24 取经引导 取经引导,遥控卡引导*/
  356. CheckRichGuide24() {
  357. let isGuide = PlayerPrefs.GetInt("GGuide24", 0) == 1;
  358. if (!isGuide && this.isOpenGuide) {
  359. this.guideTask20 = (this.guideFile.task.task24) as GuideTask;
  360. this.curGuideId = 24;
  361. this.CheckCreateGuide();
  362. this.SetTask(this.guideTask20);
  363. PlayerPrefs.SetInt("GGuide" + this.curGuideId, 1);
  364. AdM.onSendEvent(`guide_${this.curGuideId}`, `引导${this.curGuideId}`, 'guide');
  365. }
  366. }
  367. /**25 取经引导 取经引导,双倍卡引导*/
  368. CheckRichGuide25() {
  369. let isGuide = PlayerPrefs.GetInt("GGuide25", 0) == 1;
  370. if (!isGuide && this.isOpenGuide) {
  371. this.guideTask20 = (this.guideFile.task.task25) as GuideTask;
  372. this.curGuideId = 25;
  373. this.CheckCreateGuide();
  374. this.SetTask(this.guideTask20);
  375. PlayerPrefs.SetInt("GGuide" + this.curGuideId, 1);
  376. AdM.onSendEvent(`guide_${this.curGuideId}`, `引导${this.curGuideId}`, 'guide');
  377. }
  378. }
  379. /**26 取经引导 取经引导,欢迎引导*/
  380. CheckRichGuide26() {
  381. let isGuide = PlayerPrefs.GetInt("GGuide26", 0) == 1;
  382. if (!isGuide && this.isOpenGuide) {
  383. this.guideTask20 = (this.guideFile.task.task26) as GuideTask;
  384. this.curGuideId = 26;
  385. this.CheckCreateGuide();
  386. this.SetTask(this.guideTask20);
  387. PlayerPrefs.SetInt("GGuide" + this.curGuideId, 1);
  388. AdM.onSendEvent(`guide_${this.curGuideId}`, `引导${this.curGuideId}`, 'guide');
  389. }
  390. }
  391. /**27 取经引导 取经引导,欢迎引导2*/
  392. CheckRichGuide27() {
  393. let isGuide = PlayerPrefs.GetInt("GGuide27", 0) == 1;
  394. if (!isGuide && this.isOpenGuide) {
  395. this.guideTask20 = (this.guideFile.task.task27) as GuideTask;
  396. this.curGuideId = 27;
  397. this.CheckCreateGuide();
  398. this.SetTask(this.guideTask20);
  399. PlayerPrefs.SetInt("GGuide" + this.curGuideId, 1);
  400. AdM.onSendEvent(`guide_${this.curGuideId}`, `引导${this.curGuideId}`, 'guide');
  401. }
  402. }
  403. /**28 看视频领红包引导1*/
  404. CheckAdRbGuide28() {
  405. let isGuide = PlayerPrefs.GetInt("GGuide28", 0) == 1;
  406. if (!isGuide && this.isOpenGuide) {
  407. this.guideTask20 = (this.guideFile.task.task28) as GuideTask;
  408. this.curGuideId = 28;
  409. this.CheckCreateGuide();
  410. this.SetTask(this.guideTask20);
  411. PlayerPrefs.SetInt("GGuide" + this.curGuideId, 1);
  412. AdM.onSendEvent(`guide_${this.curGuideId}`, `引导${this.curGuideId}`, 'guide');
  413. }
  414. }
  415. /**29 看视频领红包引导2*/
  416. CheckAdRbGuide29() {
  417. let isGuide = PlayerPrefs.GetInt("GGuide29", 0) == 1;
  418. if (!isGuide && this.isOpenGuide) {
  419. this.guideTask20 = (this.guideFile.task.task29) as GuideTask;
  420. this.curGuideId = 29;
  421. this.CheckCreateGuide();
  422. this.SetTask(this.guideTask20);
  423. PlayerPrefs.SetInt("GGuide" + this.curGuideId, 1);
  424. AdM.onSendEvent(`guide_${this.curGuideId}`, `引导${this.curGuideId}`, 'guide');
  425. }
  426. }
  427. //CheckGuide2() {
  428. // let isGuide = PlayerPrefs.GetInt("GGuide2", 0) == 1;
  429. // if (!isGuide && this.isOpenGuide) {
  430. // this.curGuideId = 2;
  431. // this.CheckCreateGuide();
  432. // this.SetTask(this.guideTask2);
  433. // }
  434. //}
  435. /**解锁点击生产金币功能*/
  436. CheckUnlockStrike() {
  437. let isGuide = PlayerPrefs.GetInt("GGuide2", 0) == 1;
  438. if (!isGuide && this.isOpenGuide) {
  439. console.log("-->Task2:", this.guideTask2);
  440. this.curGuideId = 2;
  441. this.CheckCreateGuide();
  442. this.SetTask(this.guideTask2);
  443. }
  444. }
  445. /**点击生产金币 是否解锁*/
  446. IsUnlockStrike() {
  447. return PlayerPrefs.GetInt("GGuide2", 0) == 1;
  448. }
  449. /**更新 点击生产金币引导文件参数*/
  450. UpdateGuideStrikeFile(carSpaceName: string) {
  451. this.guideTask11.steps[0].args[0] = "HallNode/CarPark/" + carSpaceName + "/chewei";
  452. this.guideTask11.steps[1].args[0] = "HallNode/CarPark/" + carSpaceName + "/chewei";
  453. this.guideTask11.steps[2].args[0] = "HallNode/CarPark/" + carSpaceName + "/chewei";
  454. this.guideTask11.steps[3].args[0] = "HallNode/CarPark/" + carSpaceName + "/chewei";
  455. }
  456. NextGuide() {
  457. this.curStepIndex++;
  458. if (this.curStepIndex >= this.steps.length) {
  459. this.guideRunner.GuideEnd();
  460. PlayerPrefs.SetInt("GGuide" + this.curGuideId, 1);
  461. this.isGuiding = false;
  462. //取经 新手福利
  463. if (this.curGuideId == 26) {
  464. EventMng.Execute_Event("NewPlayGift");
  465. }
  466. this.curGuideId = 0;
  467. } else {
  468. this.step = this.steps[this.curStepIndex];
  469. this.guideRunner.RunGuide(this.step);
  470. }
  471. }
  472. /** 结束此步引导 */
  473. FinishGuide() {
  474. this.guideRunner.Click_CloseBtn();
  475. }
  476. ResumeGuide() {
  477. if (this.curGuidePause) {
  478. this.curGuidePause = false;
  479. this.NextGuide();
  480. }
  481. }
  482. PauseGuide() {
  483. this.curGuidePause = true;
  484. }
  485. CheckCreateGuide() {
  486. if (this.guideRunner == null) {
  487. //this.guideNode = this.znhTest.GetGuide();
  488. this.guideNode = UiM.Instance.hallNode.getComponent(Main).GetGuide();
  489. this.guideNode.parent = cc.find("Canvas");
  490. this.guideRunner = this.guideNode.getComponent(GuideRunner);
  491. console.log("---------------");
  492. }
  493. }
  494. SetTask(task: GuideTask) {
  495. this.steps = task.steps;
  496. this.curStepIndex = 0;
  497. this.step = this.steps[this.curStepIndex];
  498. this.guideRunner.RunGuide(this.step);
  499. this.isGuiding = true;
  500. }
  501. }