task.js 42 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016101710181019102010211022102310241025102610271028102910301031103210331034103510361037103810391040104110421043104410451046104710481049105010511052105310541055105610571058105910601061106210631064106510661067106810691070107110721073107410751076107710781079108010811082108310841085108610871088108910901091109210931094109510961097109810991100110111021103110411051106110711081109111011111112111311141115111611171118111911201121112211231124112511261127112811291130113111321133113411351136113711381139114011411142114311441145114611471148114911501151115211531154115511561157115811591160116111621163116411651166116711681169117011711172117311741175117611771178117911801181118211831184118511861187118811891190119111921193119411951196119711981199120012011202120312041205120612071208120912101211121212131214121512161217121812191220122112221223
  1. window.task = {
  2. taskPrefab: [
  3. "prefab/taskPrefab",
  4. "prefab/taskPrefabfinger",
  5. "prefab/taskPrefabLuckInfo",
  6. "prefab/taskPrefabEveyDay",
  7. "prefab/taskPrefabreturn",
  8. "prefab/taskPrefabAdministration",
  9. "prefab/taskPrefabBuilding",
  10. "prefab/taskPrefabEnd",
  11. ],
  12. sharePrefab: [
  13. "prefab/share",
  14. "prefab/sharepublic",
  15. ],
  16. returnPrefab: [
  17. "prefab/taskPrefabreturnLuck",
  18. "prefab/taskPrefabreturnEveyDay",
  19. "prefab/taskPrefabreturnAdministration",
  20. "prefab/taskPrefabreturnBuilding",
  21. ],
  22. //建筑物的那个新手教学
  23. novice: [
  24. "prefab/taskPrefabnovice1",
  25. "prefab/taskPrefabnovice2",
  26. "prefab/taskPrefabnovice3",
  27. "prefab/taskPrefabnovice4",
  28. ],
  29. taskCursorName: [
  30. //提示 去点击转盘 的dialog
  31. "taskCursor1",
  32. //场景转盘按钮 上面的提示光圈
  33. "taskCursor2",
  34. //提示去点签到
  35. "taskCursor3",
  36. //提示去点签到
  37. "taskCursor4",
  38. //提示去点签到
  39. "taskCursor5",
  40. ],
  41. newTaskName: [
  42. //0黑背景0
  43. "prefab/taskPrefabAgb",
  44. //1欢迎来到《首富小镇》
  45. "prefab/taskPrefabStart",
  46. //2您新招聘的员工已经到位了
  47. "prefab/taskPrefabbuy",
  48. //3 5块钱买地
  49. "prefab/taskPrefabbuyBuyinggrain",
  50. //4
  51. "prefab/taskPrefabbuyBuyinggrainwait",
  52. //5每一个员工都需要有个休息的地方来回复体力
  53. "prefab/task/taskPrefab1",
  54. //6多开坑土地初期是一个赚钱的好办法
  55. "prefab/task/taskPrefab2",
  56. //7种下农田后
  57. "prefab/task/taskPrefab3",
  58. //8 哎呀!好像赚钱的速度好慢啊!这样什么时候可以成为《首富》
  59. "prefab/task/taskPrefab4",
  60. //9 再盖一个农舍吧
  61. "prefab/task/taskPrefabFarmhouse",
  62. //10 地里面有钻石
  63. "prefab/task/taskPrefab5",
  64. //11 收钻石 之后的提示
  65. "prefab/task/taskPrefab6",
  66. //12 去每日签到
  67. "prefab/task/taskPrefab7",
  68. //13 欢乐大转盘,抽奖抽到手软。
  69. "prefab/task/taskPrefab8",
  70. //14 先完成一个小目标 存款50W
  71. "prefab/task/taskPrefab9",
  72. //15 恭喜您的财富累计到达50W
  73. "prefab/task/taskPrefab10",
  74. //16 有了加工厂后,我们试试开出您的第一个商店
  75. "prefab/task/taskPrefab11",
  76. //17 有了加工厂后,我们试试开出您的第一个商店
  77. "prefab/task/taskPrefab12",
  78. //18 有了加工厂后,我们试试开出您的第一个商店
  79. "prefab/task/taskPrefab13",
  80. //19
  81. "prefab/task/taskPrefabVideo",
  82. ],
  83. //农舍 农田 的 虚影
  84. TiledTile: [
  85. "prefab/taskPrefabTiledTileFarmhouse",
  86. "prefab/taskPrefabTiledTileFarmland",
  87. ],
  88. //必须建造在虚影上面
  89. //如果为true 的话,就是进入虚影建造状态
  90. isMushBuildState: false,
  91. //虚影所在的位置
  92. virtualShadowPos: null,
  93. //虚影所在的位置的终点坐标
  94. virtualShadowPosEnd: null,
  95. TaskIconCount: [
  96. "prefab/taskPrefabTiledTileFarmhouse",
  97. ],
  98. itemPrefab: [
  99. "prefab/item/taskPrefabItem0",
  100. "prefab/item/taskPrefabItem1",
  101. "prefab/item/taskPrefabItemFarmhouse",
  102. "prefab/item/taskPrefabItem2",
  103. "prefab/item/taskPrefabItem3",
  104. "prefab/item/taskPrefabItem4",
  105. "prefab/item/taskPrefabItem5",
  106. "prefab/item/taskPrefabItem6",
  107. "prefab/item/taskPrefabItem7",
  108. "prefab/item/taskPrefabItem8",
  109. "prefab/item/taskPrefabItem9",
  110. "prefab/item/taskPrefabItem10",
  111. "prefab/item/taskPrefabItemShare",
  112. ],
  113. publicGive: [
  114. //种下田地
  115. 200,
  116. ],
  117. managerUi: null,
  118. //农田人物购买,只能触发一次
  119. taskGotoBuyOnly: false,
  120. // LIFE-CYCLE CALLBACKS:
  121. taskOnLoad() {
  122. this._init();
  123. //点钻石 之后的进入限定
  124. this.taskZSTag = false;
  125. this.taskCount = 0;
  126. this.taskCursor = this.taskCount;
  127. this.taskNodes = [];
  128. task.setOnClickTaskIcon(function () {
  129. task.showtaskPrefabView(task.taskCallBack);
  130. }.bind(this));
  131. },
  132. taskOnLoadno() {
  133. this.taskNodes = [];
  134. task.setOnClickTaskIcon(function () {
  135. task.showtaskPrefabView(task.taskCallBack);
  136. }.bind(this));
  137. },
  138. _init: function () {
  139. this.Canvas = cc.find("Canvas/UICamera");
  140. //管理建造 股市 转盘 什么的父类
  141. this.BelowTheMask = cc.find("Canvas/UICamera/BelowTheMask/TopButton");
  142. //外面管理的node
  143. this.personnelview = cc.find("Canvas/UICamera/BelowTheMask/BottomButton/personnel");
  144. //外面建造的node
  145. this.Buildingview = cc.find("Canvas/UICamera/BelowTheMask/BottomButton/Building");
  146. //外面股市的node
  147. this.EquityMarketview = cc.find("Canvas/UICamera/BelowTheMask/TopButton/EquityMarket");
  148. //外面转盘的node
  149. this.LuckDrawview = cc.find("Canvas/UICamera/BelowTheMask/TopButton/LuckDraw");
  150. //外面签到的node
  151. this.EveryDaySignview = cc.find("Canvas/UICamera/BelowTheMask/TopButton/EveryDaySign");
  152. //人才管理里面的招聘按钮
  153. this.RecruitButton = cc.find("Canvas/UICamera/PersonnelContainer/PersonnelView/WorkerASaleManage/Worker/Recruit/RecruitBtn");
  154. //里面的 住宅
  155. this.Env = cc.find("Canvas/UICamera/BuildingContainer/BuildingView/Menu/Env");
  156. //里面的 劳动
  157. this.Labour = cc.find("Canvas/UICamera/BuildingContainer/BuildingView/Menu/Labour");
  158. //里面的 商铺
  159. this.Shop = cc.find("Canvas/UICamera/BuildingContainer/BuildingView/Menu/Shop");
  160. //里面的 特殊
  161. this.SpeBuilding = cc.find("Canvas/UICamera/BuildingContainer/BuildingView/Menu/SpeBuilding");
  162. //todo 住宅
  163. //建造里面的农舍1
  164. this.Farmhouse = cc.find("Canvas/UICamera/BuildingContainer/BuildingView/ScrollContent/view/content/EnvContent/Farmhouse");
  165. //建造里面的农舍2
  166. this.Apartment = cc.find("Canvas/UICamera/BuildingContainer/BuildingView/ScrollContent/view/content/EnvContent/Apartment");
  167. //建造里面的农舍3
  168. this.Villa = cc.find("Canvas/UICamera/BuildingContainer/BuildingView/ScrollContent/view/content/EnvContent/Villa");
  169. //建造里面的道路
  170. this.Road = cc.find("Canvas/UICamera/BuildingContainer/BuildingView/ScrollContent/view/content/EnvContent/Road");
  171. //建造里面的铲子
  172. this.Shovel = cc.find("Canvas/UICamera/BuildingContainer/BuildingView/ScrollContent/view/content/EnvContent/Shovel");
  173. //建造里面的拆迁
  174. this.Hammer = cc.find("Canvas/UICamera/BuildingContainer/BuildingView/ScrollContent/view/content/EnvContent/Hammer");
  175. //todo 劳动
  176. //农田
  177. this.FamerLand = cc.find("Canvas/UICamera/BuildingContainer/BuildingView/ScrollContent/view/content/LabourContent/FamerLand");
  178. //树木
  179. this.LoggingYard = cc.find("Canvas/UICamera/BuildingContainer/BuildingView/ScrollContent/view/content/LabourContent/LoggingYard");
  180. //矿石
  181. this.MineField = cc.find("Canvas/UICamera/BuildingContainer/BuildingView/ScrollContent/view/content/LabourContent/MineField");
  182. //加工厂
  183. this.Factory = cc.find("Canvas/UICamera/BuildingContainer/BuildingView/ScrollContent/view/content/LabourContent/Factory");
  184. //todo 商铺
  185. //shop 1
  186. this.ConvenienceStore = cc.find("Canvas/UICamera/BuildingContainer/BuildingView/ScrollContent/view/content/ShopContent/ConvenienceStore");
  187. //shop 2
  188. this.FlowerShop = cc.find("Canvas/UICamera/BuildingContainer/BuildingView/ScrollContent/view/content/ShopContent/FlowerShop");
  189. //shop 3
  190. this.DessertShop = cc.find("Canvas/UICamera/BuildingContainer/BuildingView/ScrollContent/view/content/ShopContent/DessertShop");
  191. //shop 4
  192. this.FastFoodShop = cc.find("Canvas/UICamera/BuildingContainer/BuildingView/ScrollContent/view/content/ShopContent/FastFoodShop");
  193. //shop 5
  194. this.CoffeeShop = cc.find("Canvas/UICamera/BuildingContainer/BuildingView/ScrollContent/view/content/ShopContent/CoffeeShop");
  195. //shop 6
  196. this.DressShop = cc.find("Canvas/UICamera/BuildingContainer/BuildingView/ScrollContent/view/content/ShopContent/DressShop");
  197. //shop 7
  198. this.Bar = cc.find("Canvas/UICamera/BuildingContainer/BuildingView/ScrollContent/view/content/ShopContent/Bar");
  199. //todo 特殊
  200. //樱花树
  201. this.GreenBelt = cc.find("Canvas/UICamera/BuildingContainer/BuildingView/ScrollContent/view/content/SpeBuildingContent/GreenBelt");
  202. //喷泉
  203. this.Fountain = cc.find("Canvas/UICamera/BuildingContainer/BuildingView/ScrollContent/view/content/SpeBuildingContent/Fountain");
  204. //游乐场
  205. this.Playground = cc.find("Canvas/UICamera/BuildingContainer/BuildingView/ScrollContent/view/content/SpeBuildingContent/Playground");
  206. //医院
  207. this.Hospital = cc.find("Canvas/UICamera/BuildingContainer/BuildingView/ScrollContent/view/content/SpeBuildingContent/Hospital");
  208. //警察局
  209. this.PoliceOffice = cc.find("Canvas/UICamera/BuildingContainer/BuildingView/ScrollContent/view/content/SpeBuildingContent/PoliceOffice");
  210. //警察局
  211. this.Bank = cc.find("Canvas/UICamera/BuildingContainer/BuildingView/ScrollContent/view/content/SpeBuildingContent/Bank");
  212. this.ManagerViews = [];
  213. //0
  214. this.ManagerViews.push(this.personnelview);
  215. this.ManagerViews.push(this.Buildingview);
  216. this.ManagerViews.push(this.EquityMarketview);
  217. this.ManagerViews.push(this.LuckDrawview);
  218. this.ManagerViews.push(this.EveryDaySignview);
  219. //5
  220. this.ManagerViews.push(this.Env);
  221. this.ManagerViews.push(this.Labour);
  222. this.ManagerViews.push(this.Shop);
  223. this.ManagerViews.push(this.SpeBuilding);
  224. //住宅
  225. //9
  226. this.ManagerViews.push(this.Farmhouse);
  227. //10
  228. this.ManagerViews.push(this.Apartment);
  229. //11
  230. this.ManagerViews.push(this.Villa);
  231. //12
  232. this.ManagerViews.push(this.Road);
  233. //13
  234. this.ManagerViews.push(this.Shovel);
  235. //14
  236. this.ManagerViews.push(this.Hammer);
  237. //劳动
  238. //15 农舍
  239. this.ManagerViews.push(this.FamerLand);
  240. //16
  241. this.ManagerViews.push(this.LoggingYard);
  242. //17
  243. this.ManagerViews.push(this.MineField);
  244. //18
  245. this.ManagerViews.push(this.Factory);
  246. //商店
  247. //19
  248. this.ManagerViews.push(this.ConvenienceStore);
  249. //20
  250. this.ManagerViews.push(this.FlowerShop);
  251. //21
  252. this.ManagerViews.push(this.DessertShop);
  253. //22
  254. this.ManagerViews.push(this.FastFoodShop);
  255. //23
  256. this.ManagerViews.push(this.CoffeeShop);
  257. //24
  258. this.ManagerViews.push(this.DressShop);
  259. //25
  260. this.ManagerViews.push(this.Bar);
  261. //特殊
  262. //26 绿化带
  263. this.ManagerViews.push(this.GreenBelt);
  264. //27
  265. this.ManagerViews.push(this.Fountain);
  266. //28
  267. this.ManagerViews.push(this.Playground);
  268. //29
  269. this.ManagerViews.push(this.Hospital);
  270. //30
  271. this.ManagerViews.push(this.PoliceOffice);
  272. //31
  273. this.ManagerViews.push(this.Bank);
  274. this.taskTags = false;
  275. this.sharetime = 2000;
  276. this.addTaskCountClicktime = 2000;
  277. },
  278. //显示手
  279. showPointer: function (type, x, y, sc) {
  280. var s = 1;
  281. if (sc != null) {
  282. s = sc;
  283. }
  284. var height = this.ManagerViews[type].height / 2;
  285. var width = this.ManagerViews[type].width / 2;
  286. if (this.showPointerNode == null) {
  287. this.addTaskTipsNoArr(this.ManagerViews[type], task.taskPrefab[1], x, y, this.ManagerViews[type].name, function (nodePrefabs) {
  288. nodePrefabs.parent = this.ManagerViews[type];
  289. this.showPointerNode = nodePrefabs;
  290. this.showPointerNode.active = true;
  291. this.showPointerNode.scale = s;
  292. this.showPointerNode.x = x;
  293. this.showPointerNode.y = y;
  294. this.showPointerNode.y -= height - 30;
  295. this.showPointerNode.x += width - 30;
  296. }.bind(this));
  297. } else {
  298. this.showPointerNode.parent = this.ManagerViews[type];
  299. this.showPointerNode.active = true;
  300. this.showPointerNode.scale = s;
  301. this.showPointerNode.x = x;
  302. this.showPointerNode.y = y;
  303. this.showPointerNode.y -= height - 30;
  304. this.showPointerNode.x += width - 30;
  305. }
  306. // console.log("现在里面的数据是",this.showPointerNode);
  307. },
  308. //隐藏 手
  309. hidePointer: function () {
  310. if (this.showPointerNode != null) {
  311. this.showPointerNode.active = false;
  312. }
  313. },
  314. //重置一下建造的虚影的初始参数
  315. onShadowArchitectureReset() {
  316. task.isMushBuildState = false;
  317. task.virtualShadowPos = null;
  318. task.virtualShadowPosEnd = null;
  319. },
  320. //260,-860
  321. //可以显示虚影建筑提示
  322. showTiledTile: function (type, myx, myy, x, y) {
  323. task.isMushBuildState = true;
  324. task.virtualShadowPos = cc.v2(x + 1, y + 1);
  325. var MyMapNode = cc.find("Canvas/MyMapNode");
  326. //移动camera 对应位置
  327. cc.find('GameNode/ManageTask').getComponent('ManageTask').onMoveToTiledTile(x, y);
  328. //引导 农舍
  329. task.addTaskTips(MyMapNode, task.TiledTile[type], myx, myy, task.taskCursorName[4], function (nodePrefabs1) {
  330. // console.log("现在里面的数据是", nodePrefabs1);
  331. var nodePrefabss = UtilsPrefabs.getNode("nodes", nodePrefabs1);
  332. var TiledTile = nodePrefabss.getComponent("TiledTile");
  333. TiledTile.setTiledTilePos(x, y);
  334. }.bind(this));
  335. },
  336. showManagerhide: function () {
  337. this.removeTaskNodes();
  338. },
  339. //点击任务按钮时候,显示 任务列表
  340. showtaskPrefabView: function (onclick) {
  341. if (task.TaskIconCountClick >= 13) {
  342. task.SeneceTaskIconNode
  343. .getChildByName("SureBtn")
  344. .getChildByName("redtips").active = false;
  345. return;
  346. }
  347. this.addTaskTips(this.Canvas, "prefab/taskPrefabView", 0, 0, "taskPrefabView", function (nodePrefabs) {
  348. this.taskPrefabView = nodePrefabs;
  349. // 任务条目
  350. this.addItemtaskView(this.TaskIconCountClick, onclick);
  351. UtilsPrefabs.setOn(nodePrefabs.getChildByName("close"), function () {
  352. this.hidetaskPrefabView();
  353. }.bind(this))
  354. }.bind(this));
  355. },
  356. //任务按钮调用
  357. taskCallBack: function () {
  358. console.log('taskCallBack:', task.TaskIconCountClick);
  359. if (task.TaskIconCountClick == 0) {
  360. //农田
  361. dialogmanager.init(task.Canvas, function () {
  362. dialogmanager.creatorFarming();
  363. }.bind(this));
  364. dialogmanager.setOnCloseDialog(function () {
  365. //创建 农田 引导 去点建造
  366. task.showManagerhide();
  367. task.showTiledTile(1, 0, -50, 25, 25);
  368. task.onTaskFarmlandMask();
  369. }.bind(this));
  370. } else if (task.TaskIconCountClick == 1) {
  371. //招聘
  372. dialogmanager.init(task.Canvas, function () {
  373. dialogmanager.Recruit();
  374. }.bind(this));
  375. dialogmanager.setOnCloseDialog(function () {
  376. let _taskNodes = [];
  377. _taskNodes.push(task.personnelview);
  378. _taskNodes.push(task.RecruitButton);
  379. task.onInitTaskMask(_taskNodes);
  380. }.bind(this));
  381. } else if (task.TaskIconCountClick == 2) {//中间这部分全部直接跳转铺路教程
  382. //重新盖宿舍
  383. this.onTaskPaveRoadsDialog();
  384. } else if (task.TaskIconCountClick == 3) {
  385. //领取农田的钻石
  386. this.onTaskPaveRoadsDialog();
  387. } else if (task.TaskIconCountClick == 4) {
  388. //每日签到
  389. this.onTaskPaveRoadsDialog();
  390. } else if (task.TaskIconCountClick == 5) {
  391. //转盘
  392. this.onTaskPaveRoadsDialog();
  393. } else if (task.TaskIconCountClick == 6) {
  394. //目标赚3k
  395. this.onTaskPaveRoadsDialog();
  396. } else if (task.TaskIconCountClick == 7) {
  397. //创建一个加工厂
  398. this.onTaskPaveRoadsDialog();
  399. } else if (task.TaskIconCountClick == 8) {
  400. //创建一个便利店
  401. this.onTaskPaveRoadsDialog();
  402. } else if (task.TaskIconCountClick == 9) {
  403. //创建一个绿化带
  404. this.onTaskPaveRoadsDialog();
  405. } else if (task.TaskIconCountClick == 10) {
  406. this.onTaskPaveRoadsDialog();
  407. } else if (task.TaskIconCountClick == 12) {
  408. //最后分享任务
  409. dialogmanager.init(task.Canvas, function () {
  410. dialogmanager.Share1();
  411. task.SeneceTaskIconNode
  412. .getChildByName("SureBtn")
  413. .getChildByName("redtips").active = false;
  414. }.bind(this));
  415. dialogmanager.setOnCloseDialog(function () {
  416. UtilsPrefabs.startSharePrefab(function () {
  417. task._setTaskIconCountClick(13);
  418. setTimeout(() => {
  419. task.taskCallBack();
  420. }, 500);
  421. }.bind(this), function () {
  422. task._setTaskIconCountClick(13);
  423. setTimeout(() => {
  424. task.taskCallBack();
  425. }, 500);
  426. }.bind(this), function (node) {
  427. var anim = node.getComponent(cc.Animation);
  428. anim.play();
  429. node.getChildByName("SharePicBG").getChildByName('Ribbon-cutting').zIndex = 10000;
  430. node.getChildByName("LittleTitleLabel").getComponent(cc.Label).string = "新店开张!快邀请好友一起来剪彩吧!";
  431. node.getChildByName("gosharebtn").getChildByName("Btn_Share_Cutting").zIndex = 10000;
  432. }.bind(this));
  433. }.bind(this));
  434. } else if (task.TaskIconCountClick == 13) {
  435. //商人去农田购买,新手任务最后一步 todo...
  436. task._setTaskCount(2);
  437. } else if (task.TaskIconCountClick == 14) {
  438. //结束任务调用
  439. task.onSetTaskEnd();
  440. } else {//旧用户都是11结束,这里如果TaskIconCountClick不存在上面流程,默认设置为结束。 if (task.TaskIconCountClick == 11)
  441. if (task.SeneceTaskIconNode)
  442. task.SeneceTaskIconNode.getChildByName("SureBtn").getChildByName("redtips").active = false;
  443. //没有任务
  444. task.taskCursor = -1;
  445. //跳过教程的时候,设置结束
  446. task.TaskIconCountClick = 14
  447. task.onShadowArchitectureReset();
  448. }
  449. },
  450. onSetTaskEnd() {
  451. if (task.SeneceTaskIconNode)
  452. task.SeneceTaskIconNode.getChildByName("SureBtn").getChildByName("redtips").active = false;
  453. //农田购买
  454. if (task.TaskIconCountClick < 13) {
  455. task.TaskIconCountClick = 13;
  456. return;
  457. }
  458. //如果是商人部分,直接设置结束
  459. //没有任务
  460. task.taskCursor = -1;
  461. //跳过教程的时候,设置商人为最后一步
  462. task.TaskIconCountClick = 14
  463. task.onShadowArchitectureReset();
  464. },
  465. //农田模板
  466. onTaskFarmlandMask() {
  467. let _taskNodes = [];
  468. _taskNodes.push(task.Buildingview);
  469. _taskNodes.push(task.Labour);
  470. _taskNodes.push(task.FamerLand);
  471. task.onInitTaskMask(_taskNodes, 'Farmland');
  472. },
  473. //农舍模板
  474. onTaskBuildAHouseMask() {
  475. let _taskNodes = [];
  476. _taskNodes.push(task.Buildingview);
  477. _taskNodes.push(task.Farmhouse);
  478. task.onInitTaskMask(_taskNodes, 'House');
  479. },
  480. //铺路对话开始
  481. onTaskPaveRoadsDialog() {
  482. //铺路教程
  483. dialogmanager.init(task.Canvas, function () {
  484. dialogmanager.pave();
  485. // task.setListView(18);
  486. }.bind(this));
  487. dialogmanager.setOnCloseDialog(function () {
  488. task.showManagerhide();
  489. cc.loader.loadRes("prefab/taskPrefabTiledTileHighway", function (err, texture) {
  490. let _taskMask = cc.instantiate(texture);
  491. //添加进控制数组
  492. task.pushTaskNodes(_taskMask);
  493. //设置生成遮罩的节点
  494. _taskMask.parent = cc.find('Canvas/MyMapNode');
  495. let _tiled = GlobalD.TiledMap._tilePosFromLocation(_taskMask.getPosition());
  496. //移动camera 对应位置
  497. cc.find('GameNode/ManageTask').getComponent('ManageTask').onMoveToTiledTile(_tiled.x, _tiled.y);
  498. task.isMushBuildState = true;
  499. task.virtualShadowPos = cc.v2(_tiled.x, _tiled.y);
  500. let _taskNodes = [];
  501. _taskNodes.push(task.Buildingview);
  502. _taskNodes.push(task.Road);
  503. task.onInitTaskMask(_taskNodes, 'Highway');
  504. }.bind(this));
  505. }.bind(this));
  506. },
  507. //铺路模板
  508. onTaskPaveRoadsMask() {
  509. let _taskMask = task.getTaskNode('taskPrefabTiledTileHighway');
  510. if (!_taskMask || !task.isMushBuildState) return;
  511. let _tiled = GlobalD.TiledMap._tilePosFromLocation(_taskMask.getPosition());
  512. //移动camera 对应位置
  513. cc.find('GameNode/ManageTask').getComponent('ManageTask').onMoveToTiledTile(_tiled.x, _tiled.y);
  514. task.isMushBuildState = true;
  515. task.virtualShadowPos = cc.v2(_tiled.x, _tiled.y);
  516. let _taskNodes = [];
  517. _taskNodes.push(task.Buildingview);
  518. _taskNodes.push(task.Road);
  519. task.onInitTaskMask(_taskNodes, 'Highway');
  520. },
  521. setListView: function (num) {
  522. task.addTaskTips(this.Canvas, task.newTaskName[num], 0, 0, task.taskCursorName[0], function (nodePrefabs) {
  523. // console.log("是什么呢",nodePrefabs);
  524. this.ListView = nodePrefabs;
  525. this.addListView();
  526. }.bind(this));
  527. },
  528. addListView: function (ListView, callback) {
  529. var nodePrefabs = null;
  530. if (ListView != null) {
  531. nodePrefabs = ListView;
  532. } else {
  533. nodePrefabs = this.ListView;
  534. }
  535. var count = 0;
  536. this.layout = nodePrefabs.getChildByName("layout");
  537. // console.log("是什么呢", nodePrefabs);
  538. for (var i = 0; i < this.layout.children.length; i++) {
  539. var children = this.layout.children[i];
  540. children.active = false;
  541. }
  542. this.layout.children[count].active = true;
  543. // console.log("是什么呢",this.layout.children[count]);
  544. //黑底
  545. // this.nodePrefabsbg = nodePrefabs;
  546. UtilsPrefabs.setOn(nodePrefabs.getChildByName("SureBtn"), function () {
  547. count++;
  548. if (this.layout.children[count] == null) {
  549. if (callback != null) {
  550. callback();
  551. } else {
  552. task.removeTaskNode(task.taskCursorName[0]);
  553. this.startSharePrefab();
  554. }
  555. return;
  556. }
  557. for (var i = 0; i < this.layout.children.length; i++) {
  558. var children = this.layout.children[i];
  559. children.active = false;
  560. }
  561. this.layout.children[count].active = true;
  562. this.layout.children[count].getChildByName("curr").getComponent(cc.Label).string = "(" + (count + 1) + '/' + this.layout.children.length + ")";
  563. }.bind(this))
  564. },
  565. //显示 任务View
  566. hidetaskPrefabView: function () {
  567. this.removeNode(this.taskPrefabView);
  568. },
  569. addItemtaskView: function (num, onclick) {
  570. this.addTaskTips(this.taskPrefabView, this.itemPrefab[num], 0, 130, "taskPrefabItem", function (nodePrefabs) {
  571. // console.log("条目",nodePrefabs);
  572. var guideview = UtilsPrefabs.getNode("guideview", nodePrefabs);
  573. var guide = UtilsPrefabs.getNode("guide", guideview);
  574. UtilsPrefabs.setOn(guide, function () {
  575. // console.log("数组是很么",nodePrefabs);
  576. this.hidetaskPrefabView();
  577. if (onclick != null) {
  578. onclick(nodePrefabs);
  579. }
  580. }.bind(this))
  581. }.bind(this));
  582. },
  583. //页面上增加任务按钮
  584. addSeneceTaskIcon: function (callback) {
  585. this.addTaskTipsNoArr(this.BelowTheMask, "prefab/SeneceTaskIcon", 150, 400, "SeneceTaskIcon", function (nodePrefabs) {
  586. this.SeneceTaskIconNode = nodePrefabs;
  587. nodePrefabs.parent = this.BelowTheMask;
  588. //如果没有任务,去掉提示
  589. if (task.TaskIconCountClick >= 13) {
  590. this.SeneceTaskIconNode
  591. .getChildByName("SureBtn")
  592. .getChildByName("redtips").active = false;
  593. }
  594. UtilsPrefabs.setOn(nodePrefabs.getChildByName("SureBtn"), function () {
  595. // console.log("调用了么",this.BelowTheMask);
  596. if (this.onClickTaskIcon != null) {
  597. this.onClickTaskIcon(this.SeneceTaskIconNode);
  598. }
  599. }.bind(this));
  600. if (callback)
  601. callback();
  602. }.bind(this));
  603. },
  604. //点击了 任务按钮
  605. setOnClickTaskIcon: function (onClickTaskIcon) {
  606. this.onClickTaskIcon = onClickTaskIcon;
  607. },
  608. onClickTaskIcon: function () {
  609. },
  610. addTaskTips: function (node, PrefabsName, x, y, name, callback) {
  611. var _x = 0;
  612. var _y = 0;
  613. if (x != null) {
  614. _x = x;
  615. }
  616. if (y != null) {
  617. _y = y;
  618. }
  619. UtilsPrefabs
  620. .init(node)
  621. .addPrefabs(PrefabsName, null, function (nodePrefabs) {
  622. if (name != null) {
  623. nodePrefabs.name = name;
  624. }
  625. nodePrefabs.x = _x;
  626. nodePrefabs.y = _y;
  627. this.pushTaskNodes(nodePrefabs);
  628. if (callback != null) {
  629. callback(nodePrefabs);
  630. }
  631. }.bind(this));
  632. },
  633. addTaskTipsNoArr: function (node, PrefabsName, x, y, name, callback) {
  634. var _x = 0;
  635. var _y = 0;
  636. if (x != null) {
  637. _x = x;
  638. }
  639. if (y != null) {
  640. _y = y;
  641. }
  642. UtilsPrefabs
  643. .init(node)
  644. .addPrefabs(PrefabsName, null, function (nodePrefabs) {
  645. if (name != null) {
  646. nodePrefabs.name = name;
  647. }
  648. nodePrefabs.x = _x;
  649. nodePrefabs.y = _y;
  650. if (callback != null) {
  651. callback(nodePrefabs);
  652. }
  653. }.bind(this));
  654. },
  655. addTaskCount: function () {
  656. //0 提示 需要 去点 转盘
  657. //1 提示转盘 外框
  658. //2 删除手 和 提示转盘 外框
  659. this.taskCount++;
  660. this.taskCursor = this.taskCount;
  661. },
  662. //直接设置人物点
  663. _setTaskCount(num) {
  664. this.taskCount = num;
  665. this.taskCursor = this.taskCount;
  666. },
  667. //任务 增加索引
  668. addTaskIconCountClick: function () {
  669. //0 提示 需要 去点 转盘
  670. //1 提示转盘 外框
  671. //2 删除手 和 提示转盘 外框
  672. this.TaskIconCountClick++;
  673. cc.sys.localStorage.setItem('TaskIconCountClick', this.TaskIconCountClick);
  674. task.hidePointer();
  675. if (this.TaskIconCountClick != 4
  676. || this.TaskIconCountClick != 5
  677. ) {
  678. task.showtaskPrefabView(task.taskCallBack);
  679. }
  680. switch (this.TaskIconCountClick) {
  681. case 4:
  682. this.EveryDaySignview.active = true;
  683. break;
  684. }
  685. },
  686. _setTaskIconCountClick(num) {
  687. this.TaskIconCountClick = num;
  688. cc.sys.localStorage.setItem('TaskIconCountClick', this.TaskIconCountClick);
  689. // task.hidePointer();
  690. // if (this.TaskIconCountClick != 4 || this.TaskIconCountClick != 5) {
  691. // task.showtaskPrefabView(task.taskCallBack);
  692. // }
  693. if (this.TaskIconCountClick == 4) {
  694. this.EveryDaySignview.active = true;
  695. }
  696. },
  697. pushTaskNodes: function (node) {
  698. if (node != null) {
  699. // console.log("數組",task);
  700. this.taskNodes.push(node)
  701. }
  702. },
  703. removeTaskNodes: function () {
  704. for (var i = 0; i < this.taskNodes.length; i++) {
  705. if (cc.isValid(this.taskNodes[i])) {
  706. this.taskNodes[i].destroy();
  707. }
  708. }
  709. this.taskNodes = [];
  710. },
  711. removeTaskNode: function (name) {
  712. for (var i = 0; i < this.taskNodes.length; i++) {
  713. if (this.taskNodes[i].name == name) {
  714. if (cc.isValid(this.taskNodes[i])) {
  715. this.taskNodes[i].destroy();
  716. }
  717. }
  718. }
  719. },
  720. getTaskNode(name) {
  721. for (var i = 0; i < this.taskNodes.length; i++) {
  722. if (this.taskNodes[i].name == name) {
  723. if (cc.isValid(this.taskNodes[i])) {
  724. return this.taskNodes[i];
  725. }
  726. }
  727. }
  728. },
  729. removeNode: function (node) {
  730. if (node != null) {
  731. node.destroy();
  732. }
  733. },
  734. isShowTaskNode: function (name, b) {
  735. if (this.taskNodes.length <= 0) return;
  736. for (var i = 0; i < this.taskNodes.length; i++) {
  737. if (this.taskNodes[i].name == name) {
  738. this.taskNodes[i].active = b;
  739. }
  740. }
  741. },
  742. // 公用 提示框
  743. tipsNode: function (num, x, y, callback) {
  744. var _x = 0;
  745. var _y = 0;
  746. if (x != null) {
  747. _x = x;
  748. }
  749. if (y != null) {
  750. _y = y;
  751. }
  752. task.removeTaskNode(task.taskCursorName[0]);
  753. task.addTaskTips(this.Canvas, task.newTaskName[num], _x, _y, task.taskCursorName[0], function (nodePrefabs) {
  754. // console.log("是什么呢",nodePrefabs);
  755. //黑底
  756. // this.nodePrefabsbg = nodePrefabs;
  757. UtilsPrefabs.setOn(nodePrefabs.getChildByName("SureBtn"), function () {
  758. task.removeTaskNode(task.taskCursorName[0]);
  759. if (callback != null) {
  760. callback(nodePrefabs);
  761. }
  762. }.bind(this))
  763. }.bind(this));
  764. },
  765. // 万元户 50W
  766. task50W: function () {
  767. //50W 万元户任务
  768. if (task.TaskIconCountClick == 6) {
  769. if (this.task50wtag == null) {
  770. if (GlobalD.GameData.Golden >= 3000) {
  771. this.task50wtag = true;
  772. let Index = 9
  773. var BuildingStateArray = GlobalD.GameData.GetBuildingStateArray();
  774. BuildingStateArray[Index] = 1;
  775. let Building = this.managerUi.getComponent('ManageBuildings').BuildingArray[Index];
  776. Building.active = true;
  777. GlobalD.GameData.SetBuildingStateArray(BuildingStateArray);
  778. this.startSharePrefab(function (node) {
  779. }.bind(this));
  780. }
  781. }
  782. }
  783. },
  784. //弹出分享对话框
  785. startSharePrefab: function (callbackNode) {
  786. this.taskTags = false;
  787. UtilsPrefabs.startSharePrefab(function () {
  788. this.addTaskIconCountClick();
  789. }.bind(this), function () {
  790. this.addTaskIconCountClick();
  791. }.bind(this), function (node) {
  792. var anim = node.getComponent(cc.Animation);
  793. anim.play();
  794. var arr2 = [
  795. "SharePic",
  796. "Recruit",
  797. "Ribbon-cutting",
  798. ];
  799. //招聘
  800. if (this.TaskIconCountClick == 1) {
  801. node.getChildByName("SharePicBG").getChildByName(arr2[1]).zIndex = 10000;
  802. node.getChildByName("LittleTitleLabel").getComponent(cc.Label).string = "恭喜你又获得一名新员工!快邀请好友来帮忙审核!";
  803. node.getChildByName("gosharebtn").getChildByName("Btn_Share_Recruit").zIndex = 10000;
  804. }
  805. //获得房屋
  806. //恭喜获得幸运奖励!离首富又近了一步!
  807. else if (this.TaskIconCountClick == 2) {
  808. node.getChildByName("SharePicBG").getChildByName(arr2[0]).zIndex = 10000;
  809. node.getChildByName("LittleTitleLabel").getComponent(cc.Label).string = "乔迁之喜!让朋友来参观一下吧!";
  810. node.getChildByName("gosharebtn").getChildByName("Btn_Share_Other").zIndex = 10000;
  811. }
  812. //商店开业
  813. else if (this.TaskIconCountClick == 8) {
  814. node.getChildByName("SharePicBG").getChildByName(arr2[2]).zIndex = 10000;
  815. node.getChildByName("LittleTitleLabel").getComponent(cc.Label).string = "新店开张!快邀请好友一起来剪彩吧!";
  816. node.getChildByName("gosharebtn").getChildByName("Btn_Share_Cutting").zIndex = 10000;
  817. }
  818. }.bind(this));
  819. },
  820. taskShowBuildingView: function () {
  821. if (task.TaskIconCountClick == 7) {
  822. var BuildingView = cc.find("Canvas/UICamera/BuildingContainer/BuildingView");
  823. if (this.nodeHand != null) {
  824. task.removeNode(this.nodeHand)
  825. }
  826. task.addTaskTips(BuildingView, task.taskPrefab[1], -100, 350, task.taskCursorName[2], function (nodePrefabs) {
  827. //手指
  828. this.nodeHand = nodePrefabs;
  829. }.bind(this));
  830. }
  831. },
  832. //商铺 提示
  833. taskshops: function () {
  834. if (task.TaskIconCountClick == 8) {
  835. var BuildingView = cc.find("Canvas/UICamera/BuildingContainer/BuildingView");
  836. if (this.nodeHandshops != null) {
  837. task.removeNode(this.nodeHandshops)
  838. }
  839. task.addTaskTips(BuildingView, task.taskPrefab[1], 0, 330, task.taskCursorName[2], function (nodePrefabs) {
  840. //手指
  841. this.nodeHandshops = nodePrefabs;
  842. }.bind(this));
  843. }
  844. },
  845. //特殊 提示
  846. taskspecial: function () {
  847. if (task.TaskIconCountClick == 9) {
  848. var BuildingView = cc.find("Canvas/UICamera/BuildingContainer/BuildingView");
  849. if (this.nodeHandspecial != null) {
  850. task.removeNode(this.nodeHandspecial)
  851. task.removeNode(this.nodeHandspecial)
  852. }
  853. task.addTaskTips(BuildingView, task.taskPrefab[1], 100, 330, task.taskCursorName[2], function (nodePrefabs) {
  854. //手指
  855. this.nodeHandspecial = nodePrefabs;
  856. }.bind(this));
  857. }
  858. },
  859. taskGreenBeltShare: function () {
  860. //任务
  861. if (task.TaskIconCountClick == 9) {
  862. task.removeTaskNode(task.taskCursorName[4]);
  863. task.removeTaskNodes();
  864. //开始分享
  865. this.startSharePrefab();
  866. }
  867. },
  868. taskShare: function () {
  869. console.log('task.taskCursor = ', task.taskCursor);
  870. // console.log("走着了吗");
  871. if (task.taskCursor == 0) {
  872. task.clearNodeHandnodePrefabsnoviceend();
  873. task.addTaskCount();
  874. }
  875. //任务
  876. if (task.taskCursor == 1) {
  877. // cc.log("建筑物创建");
  878. task.removeTaskNode(task.taskCursorName[4]);
  879. task.removeTaskNodes();
  880. //新手引导第一部分,创建完房子之后
  881. //slam todo
  882. //直接设置增加农田
  883. task._setTaskCount(3);
  884. task.addSeneceTaskIcon();
  885. task._setTaskIconCountClick(0);
  886. task.taskCallBack();
  887. }
  888. },
  889. //旅行者 第一次 买农田
  890. buyFarming: function (callback) {
  891. dialogmanager.init(this.Canvas, function () {
  892. dialogmanager.buyFarming();
  893. //任务结束
  894. task.onSetTaskEnd();
  895. }.bind(this), function () {
  896. //任务结束
  897. task.onSetTaskEnd();
  898. }.bind(this), function () {
  899. //结束按钮
  900. if (callback != null) {
  901. callback();
  902. }
  903. }.bind(this));
  904. dialogmanager.setOnCloseDialog(function () {
  905. //对话结束回调
  906. if (callback != null) {
  907. callback();
  908. }
  909. }.bind(this));
  910. },
  911. //放置农田(现在为果树)之后
  912. Farming: function () {
  913. if (task.taskCursor == -1) return;
  914. // 种田之后
  915. task.showManagerhide();
  916. setTimeout(() => {
  917. //设置视频任务帮助
  918. this._setTaskIconCountClick(10);
  919. task.taskCallBack();
  920. }, 300);
  921. },
  922. //建造建工厂
  923. taskfactory: function () {
  924. if (task.TaskIconCountClick == 7) {
  925. // console.log("农田创建完毕");
  926. task.showManagerhide();
  927. // GlobalD.GameData.PlusGolden(task.publicGive[0]);
  928. this.startSharePrefab();
  929. }
  930. },
  931. clearNodeHandLabour: function () {
  932. if (this.nodeHandLabour != null) {
  933. task.removeNode(this.nodeHandLabour)
  934. }
  935. },
  936. clearNodeHandnodePrefabsnoviceend: function () {
  937. if (this.nodePrefabsnoviceend != null) {
  938. task.removeNode(this.nodePrefabsnoviceend)
  939. }
  940. },
  941. clearNodeHandshopsshow: function () {
  942. if (this.nodeHandshopsshow != null) {
  943. task.removeNode(this.nodeHandshopsshow)
  944. }
  945. },
  946. clearNodeHandGreenBelt: function () {
  947. if (this.nodeHandGreenBelt != null) {
  948. task.removeNode(this.nodeHandGreenBelt)
  949. }
  950. },
  951. taskZS: function () {
  952. if (task.TaskIconCountClick == 3 && !this.taskZSTag) {
  953. this.taskZSTag = true;
  954. task.showManagerhide();
  955. this.startSharePrefab();
  956. }
  957. },
  958. //盖完了 农舍之后
  959. taskFarmhouse: function () {
  960. if (task.TaskIconCountClick == 2) {
  961. // //开始分享
  962. this.startSharePrefab();
  963. }
  964. },
  965. //便利店 提示
  966. taskConvenienceStore: function () {
  967. if (task.TaskIconCountClick == 8) {
  968. // console.log("农田创建完毕");
  969. task.showManagerhide();
  970. this.startSharePrefab();
  971. }
  972. },
  973. //视频教程
  974. videoTutorial: function () {
  975. var Canvas = cc.find("Canvas/UICamera");
  976. task.addTaskTips(Canvas, task.newTaskName[18], 0, 0, task.taskCursorName[3], function (node) {
  977. UtilsWX.getSystemInfo(function (obj) {
  978. this.width = 0 - obj.windowWidth + 100;
  979. this.height = obj.windowHeight - 150;
  980. node.getChildByName("SureBtn").y = node.getChildByName("SureBtn").y + this.height;
  981. node.getChildByName("SureBtn").x = this.width;
  982. console.log("关闭按钮", node.getChildByName("SureBtn"));
  983. UtilsWX.createVideo();
  984. }.bind(this));
  985. UtilsPrefabs.setOn(node.getChildByName("SureBtn"), function () {
  986. task.removeTaskNode(task.taskCursorName[3]);
  987. UtilsWX.removeVideo();
  988. }.bind(this))
  989. }.bind(this));
  990. },
  991. showvideoTutorial: function () {
  992. var node = cc.find("Canvas/UICamera/taskPrefab13");
  993. node.x = 0;
  994. node.y = 0;
  995. UtilsWX.createVideo();
  996. UtilsPrefabs.setOn(node.getChildByName("SureBtn"), function () {
  997. UtilsWX.removeVideo();
  998. // node.active = false;
  999. node.x = -2000;
  1000. node.y = 0;
  1001. }.bind(this))
  1002. },
  1003. //视频教程
  1004. videoTutorialCreatorBtn: function () {
  1005. task.addTaskTipsNoArr(this.BelowTheMask, "prefab/videoTutorialCreatorBtn", -300, -360, "videoTutorialCreatorBtn", function (node) {
  1006. node.parent = this.BelowTheMask;
  1007. UtilsPrefabs.setOn(node.getChildByName("SureBtn"), function () {
  1008. task.showvideoTutorial();
  1009. }.bind(this))
  1010. }.bind(this));
  1011. },
  1012. //创建 帮助
  1013. CreatorBtnHelp: function (BelowTheMask) {
  1014. task.addTaskTipsNoArr(this.BelowTheMask, "prefab/videoTutorialCreatorBtn", -300, 280, "videoTutorialCreatorBtn", function (node) {
  1015. node.parent = this.BelowTheMask;//this.BelowTheMask;
  1016. // node.active = false;
  1017. this.BtnHelp = node;
  1018. UtilsPrefabs.setOn(node.getChildByName("SureBtn"), function () {
  1019. task.openHelp();
  1020. }.bind(this))
  1021. }.bind(this));
  1022. },
  1023. openHelp: function () {
  1024. // console.log("打开帮助");
  1025. task.addTaskTipsNoArr(this.Canvas, "prefab/help/taskPrefabViewhelp", 0, 0, "videoTutorialCreatorBtn", function (node) {
  1026. node.parent = this.Canvas;
  1027. // console.log("打开帮助node",node);
  1028. UtilsPrefabs.setOn(node.getChildByName("layout").getChildByName("close"), function () {
  1029. task.removeNode(node);
  1030. }.bind(this))
  1031. }.bind(this));
  1032. },
  1033. //初始化模板遮罩
  1034. onInitTaskMask(_taskNodes, _taskName) {
  1035. cc.loader.loadRes("prefab/task/Scene/TaskMask", function (err, texture) {
  1036. let _taskMask = cc.instantiate(texture);
  1037. //设置生成遮罩的节点
  1038. _taskMask.parent = cc.find('Canvas/UICamera');
  1039. //设置遮罩的适配目标
  1040. let _widget = _taskMask.getChildByName('Mask').getChildByName('Bg').getComponent(cc.Widget);
  1041. _widget.target = cc.find('Canvas');
  1042. let taskMaskScript = _taskMask.getComponent('TaskMask');
  1043. // console.log('_offset =', _offset, _Count, '=taskMaskScript.offsetCount', taskMaskScript.offsetCount);
  1044. taskMaskScript.onInitTaskMask(_taskNodes, _taskName);
  1045. }.bind(this));
  1046. },
  1047. };