bundle.js 193 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054105510561057105810591060106110621063106410651066106710681069107010711072107310741075107610771078107910801081108210831084108510861087108810891090109110921093109410951096109710981099110011011102110311041105110611071108110911101111111211131114111511161117111811191120112111221123112411251126112711281129113011311132113311341135113611371138113911401141114211431144114511461147114811491150115111521153115411551156115711581159116011611162116311641165116611671168116911701171117211731174117511761177117811791180118111821183118411851186118711881189119011911192119311941195119611971198119912001201120212031204120512061207120812091210121112121213121412151216121712181219122012211222122312241225122612271228122912301231123212331234123512361237123812391240124112421243124412451246124712481249125012511252125312541255125612571258125912601261126212631264126512661267126812691270127112721273127412751276127712781279128012811282128312841285128612871288128912901291129212931294129512961297129812991300130113021303130413051306130713081309131013111312131313141315131613171318131913201321132213231324132513261327132813291330133113321333133413351336133713381339134013411342134313441345134613471348134913501351135213531354135513561357135813591360136113621363136413651366136713681369137013711372137313741375137613771378137913801381138213831384138513861387138813891390139113921393139413951396139713981399140014011402140314041405140614071408140914101411141214131414141514161417141814191420142114221423142414251426142714281429143014311432143314341435143614371438143914401441144214431444144514461447144814491450145114521453145414551456145714581459146014611462146314641465146614671468146914701471147214731474147514761477147814791480148114821483148414851486148714881489149014911492149314941495149614971498149915001501150215031504150515061507150815091510151115121513151415151516151715181519152015211522152315241525152615271528152915301531153215331534153515361537153815391540154115421543154415451546154715481549155015511552155315541555155615571558155915601561156215631564156515661567156815691570157115721573157415751576157715781579158015811582158315841585158615871588158915901591159215931594159515961597159815991600160116021603160416051606160716081609161016111612161316141615161616171618161916201621162216231624162516261627162816291630163116321633163416351636163716381639164016411642164316441645164616471648164916501651165216531654165516561657165816591660166116621663166416651666166716681669167016711672167316741675167616771678167916801681168216831684168516861687168816891690169116921693169416951696169716981699170017011702170317041705170617071708170917101711171217131714171517161717171817191720172117221723172417251726172717281729173017311732173317341735173617371738173917401741174217431744174517461747174817491750175117521753175417551756175717581759176017611762176317641765176617671768176917701771177217731774177517761777177817791780178117821783178417851786178717881789179017911792179317941795179617971798179918001801180218031804180518061807180818091810181118121813181418151816181718181819182018211822182318241825182618271828182918301831183218331834183518361837183818391840184118421843184418451846184718481849185018511852185318541855185618571858185918601861186218631864186518661867186818691870187118721873187418751876187718781879188018811882188318841885188618871888188918901891189218931894189518961897189818991900190119021903190419051906190719081909191019111912191319141915191619171918191919201921192219231924192519261927192819291930193119321933193419351936193719381939194019411942194319441945194619471948194919501951195219531954195519561957195819591960196119621963196419651966196719681969197019711972197319741975197619771978197919801981198219831984198519861987198819891990199119921993199419951996199719981999200020012002200320042005200620072008200920102011201220132014201520162017201820192020202120222023202420252026202720282029203020312032203320342035203620372038203920402041204220432044204520462047204820492050205120522053205420552056205720582059206020612062206320642065206620672068206920702071207220732074207520762077207820792080208120822083208420852086208720882089209020912092209320942095209620972098209921002101210221032104210521062107210821092110211121122113211421152116211721182119212021212122212321242125212621272128212921302131213221332134213521362137213821392140214121422143214421452146214721482149215021512152215321542155215621572158215921602161216221632164216521662167216821692170217121722173217421752176217721782179218021812182218321842185218621872188218921902191219221932194219521962197219821992200220122022203220422052206220722082209221022112212221322142215221622172218221922202221222222232224222522262227222822292230223122322233223422352236223722382239224022412242224322442245224622472248224922502251225222532254225522562257225822592260226122622263226422652266226722682269227022712272227322742275227622772278227922802281228222832284228522862287228822892290229122922293229422952296229722982299230023012302230323042305230623072308230923102311231223132314231523162317231823192320232123222323232423252326232723282329233023312332233323342335233623372338233923402341234223432344234523462347234823492350235123522353235423552356235723582359236023612362236323642365236623672368236923702371237223732374237523762377237823792380238123822383238423852386238723882389239023912392239323942395239623972398239924002401240224032404240524062407240824092410241124122413241424152416241724182419242024212422242324242425242624272428242924302431243224332434243524362437243824392440244124422443244424452446244724482449245024512452245324542455245624572458245924602461246224632464246524662467246824692470247124722473247424752476247724782479248024812482248324842485248624872488248924902491249224932494249524962497249824992500250125022503250425052506250725082509251025112512251325142515251625172518251925202521252225232524252525262527252825292530253125322533253425352536253725382539254025412542254325442545254625472548254925502551255225532554255525562557255825592560256125622563256425652566256725682569257025712572257325742575257625772578257925802581258225832584258525862587258825892590259125922593259425952596259725982599260026012602260326042605260626072608260926102611261226132614261526162617261826192620262126222623262426252626262726282629263026312632263326342635263626372638263926402641264226432644264526462647264826492650265126522653265426552656265726582659266026612662266326642665266626672668266926702671267226732674267526762677267826792680268126822683268426852686268726882689269026912692269326942695269626972698269927002701270227032704270527062707270827092710271127122713271427152716271727182719272027212722272327242725272627272728272927302731273227332734273527362737273827392740274127422743274427452746274727482749275027512752275327542755275627572758275927602761276227632764276527662767276827692770277127722773277427752776277727782779278027812782278327842785278627872788278927902791279227932794279527962797279827992800280128022803280428052806280728082809281028112812281328142815281628172818281928202821282228232824282528262827282828292830283128322833283428352836283728382839284028412842284328442845284628472848284928502851285228532854285528562857285828592860286128622863286428652866286728682869287028712872287328742875287628772878287928802881288228832884288528862887288828892890289128922893289428952896289728982899290029012902290329042905290629072908290929102911291229132914291529162917291829192920292129222923292429252926292729282929293029312932293329342935293629372938293929402941294229432944294529462947294829492950295129522953295429552956295729582959296029612962296329642965296629672968296929702971297229732974297529762977297829792980298129822983298429852986298729882989299029912992299329942995299629972998299930003001300230033004300530063007300830093010301130123013301430153016301730183019302030213022302330243025302630273028302930303031303230333034303530363037303830393040304130423043304430453046304730483049305030513052305330543055305630573058305930603061306230633064306530663067306830693070307130723073307430753076307730783079308030813082308330843085308630873088308930903091309230933094309530963097309830993100310131023103310431053106310731083109311031113112311331143115311631173118311931203121312231233124312531263127312831293130313131323133313431353136313731383139314031413142314331443145314631473148314931503151315231533154315531563157315831593160316131623163316431653166316731683169317031713172317331743175317631773178317931803181318231833184318531863187318831893190319131923193319431953196319731983199320032013202320332043205320632073208320932103211321232133214321532163217321832193220322132223223322432253226322732283229323032313232323332343235323632373238323932403241324232433244324532463247324832493250325132523253325432553256325732583259326032613262326332643265326632673268326932703271327232733274327532763277327832793280328132823283328432853286328732883289329032913292329332943295329632973298329933003301330233033304330533063307330833093310331133123313331433153316331733183319332033213322332333243325332633273328332933303331333233333334333533363337333833393340334133423343334433453346334733483349335033513352335333543355335633573358335933603361336233633364336533663367336833693370337133723373337433753376337733783379338033813382338333843385338633873388338933903391339233933394339533963397339833993400340134023403340434053406340734083409341034113412341334143415341634173418341934203421342234233424342534263427342834293430343134323433343434353436343734383439344034413442344334443445344634473448344934503451345234533454345534563457345834593460346134623463346434653466346734683469347034713472347334743475347634773478347934803481348234833484348534863487348834893490349134923493349434953496349734983499350035013502350335043505350635073508350935103511351235133514351535163517351835193520352135223523352435253526352735283529353035313532353335343535353635373538353935403541354235433544
  1. var laya = (function (exports) {
  2. 'use strict';
  3. class GameConfig {
  4. constructor() { }
  5. static init() {
  6. var reg = Laya.ClassUtils.regClass;
  7. }
  8. }
  9. GameConfig.width = 720;
  10. GameConfig.height = 1280;
  11. GameConfig.scaleMode = "fixedwidth";
  12. GameConfig.screenMode = "none";
  13. GameConfig.alignV = "top";
  14. GameConfig.alignH = "left";
  15. GameConfig.startScene = "MainScene.scene";
  16. GameConfig.sceneRoot = "";
  17. GameConfig.debug = false;
  18. GameConfig.stat = false;
  19. GameConfig.physicsDebug = false;
  20. GameConfig.exportSceneToJson = true;
  21. GameConfig.init();
  22. class CheckMain {
  23. }
  24. CheckMain.Creat = false;
  25. class Main {
  26. constructor() {
  27. if (CheckMain.Creat)
  28. return;
  29. CheckMain.Creat = true;
  30. if (window["Laya3D"])
  31. Laya3D.init(GameConfig.width, GameConfig.height);
  32. else
  33. Laya.init(GameConfig.width, GameConfig.height, Laya["WebGL"]);
  34. Laya["Physics"] && Laya["Physics"].enable();
  35. Laya["DebugPanel"] && Laya["DebugPanel"].enable();
  36. Laya.stage.scaleMode = GameConfig.scaleMode;
  37. Laya.stage.screenMode = GameConfig.screenMode;
  38. Laya.stage.alignV = GameConfig.alignV;
  39. Laya.stage.alignH = GameConfig.alignH;
  40. Laya.URL.exportSceneToJson = GameConfig.exportSceneToJson;
  41. if (GameConfig.debug || Laya.Utils.getQueryString("debug") == "true")
  42. Laya.enableDebugPanel();
  43. if (GameConfig.physicsDebug && Laya["PhysicsDebugDraw"])
  44. Laya["PhysicsDebugDraw"].enable();
  45. if (GameConfig.stat)
  46. Laya.Stat.show();
  47. Laya.alertGlobalError = true;
  48. if (Laya.Browser.onWeiXin) {
  49. Laya.Browser.window.wx.showShareMenu({
  50. withShareTicket: true
  51. });
  52. Laya.Browser.window.wx.onShareAppMessage(function () {
  53. return {
  54. title: "试一下你的脑力能到第几关",
  55. imageUrl: "Game/res/Share/fx.png",
  56. };
  57. });
  58. Laya.Browser.window.wx.onShow((option) => {
  59. var shareTicket = option.shareTicket;
  60. var userId = option.query.userId;
  61. var shareTitle = option.query.shareTitle;
  62. Main.SceneNum = option.scene;
  63. WXSDK.querychannel = option.query.channel;
  64. WXSDK.shareOpenId = option.query.userId;
  65. console.log("option---", option);
  66. console.log("scene:", option.scene);
  67. if (WXSDK.querychannel != null) {
  68. console.log("onShow channel is:", WXSDK.querychannel);
  69. }
  70. if (option.referrerInfo) {
  71. WXSDK.referrerInfoappId = option.referrerInfo.appId;
  72. console.log("onShow appId is:", option.referrerInfo.appId);
  73. }
  74. });
  75. const updateManager = Laya.Browser.window.wx.getUpdateManager();
  76. updateManager.onCheckForUpdate(function (res) {
  77. console.log("最新版本:" + res.hasUpdate);
  78. });
  79. updateManager.onUpdateReady(function () {
  80. Laya.Browser.window.wx.showModal({
  81. showCancel: false,
  82. title: '更新提示',
  83. content: '新版本已经准备好,是否重启应用?',
  84. success(res) {
  85. updateManager.applyUpdate();
  86. },
  87. fail(res) {
  88. updateManager.applyUpdate();
  89. }
  90. });
  91. });
  92. }
  93. Laya.ResourceVersion.enable("version.json", Laya.Handler.create(this, this.onVersionLoaded), Laya.ResourceVersion.FILENAME_VERSION);
  94. }
  95. onVersionLoaded() {
  96. Laya.AtlasInfoManager.enable("fileconfig.json", Laya.Handler.create(this, this.onConfigLoaded));
  97. }
  98. onConfigLoaded() {
  99. new LoadView();
  100. }
  101. }
  102. Main.Ver = "1.0.0";
  103. Main.CFG = "123";
  104. Main.SceneNum = "000";
  105. new Main();
  106. var AccountUser;
  107. (function (AccountUser) {
  108. AccountUser[AccountUser["buyed_kun"] = 0] = "buyed_kun";
  109. AccountUser[AccountUser["diamond"] = 1] = "diamond";
  110. AccountUser[AccountUser["equip_themes"] = 2] = "equip_themes";
  111. AccountUser[AccountUser["favorite_times"] = 3] = "favorite_times";
  112. AccountUser[AccountUser["game_times"] = 4] = "game_times";
  113. AccountUser[AccountUser["get_themes"] = 5] = "get_themes";
  114. AccountUser[AccountUser["list_kun"] = 6] = "list_kun";
  115. AccountUser[AccountUser["moeny"] = 7] = "moeny";
  116. AccountUser[AccountUser["progress_themes"] = 8] = "progress_themes";
  117. AccountUser[AccountUser["revival"] = 9] = "revival";
  118. AccountUser[AccountUser["stage"] = 10] = "stage";
  119. })(AccountUser || (AccountUser = {}));
  120. class PlayerData {
  121. constructor(_token, _config, _appSetting, _user, _userbase, _useInvite, _user_stage = null, _user_sign, _user_achievement, lottery) {
  122. this.openid = "";
  123. this.userId = "";
  124. this.jianglidic = {};
  125. this.shitidic = {};
  126. this.chengjiuliebiao = {};
  127. this.zhengshu = _token;
  128. this.netzheshe = _appSetting;
  129. this.account = _user;
  130. this.accountssss = _userbase;
  131. this.qiandao = _user_sign;
  132. this.renwu = _user_achievement;
  133. this.userId = this.account["user_id"];
  134. this.openid = this.accountssss["openid"];
  135. this.m_invite = _useInvite;
  136. this.lottery = lottery;
  137. console.log("user_id:" + this.userId);
  138. }
  139. GainCollocation(_type) {
  140. return this.peizhis[_type];
  141. }
  142. GainAccount(_type) {
  143. return this.account[_type];
  144. }
  145. get fenxiang() {
  146. return this.netzheshe["share"] == "1";
  147. }
  148. get fenxiangneirong() {
  149. return this.netzheshe["sharecontent"];
  150. }
  151. get fuhuocishu() {
  152. return Number(this.netzheshe["revivenum"]);
  153. }
  154. get wudishijian() {
  155. return Number(this.netzheshe["Invincibletime"]);
  156. }
  157. get wudaoshijian() {
  158. return Number(this.netzheshe["cheattime"]);
  159. }
  160. get banner() {
  161. return this.netzheshe["banner"] == "1";
  162. }
  163. get video() {
  164. return this.netzheshe["video"] == "1";
  165. }
  166. get wudao() {
  167. return this.netzheshe["cheat"] == "1";
  168. }
  169. get jiancechangjin() {
  170. return this.netzheshe["checkscence"] == 1;
  171. }
  172. get reviverate() {
  173. return Number(this.netzheshe["revive"]);
  174. }
  175. get uintid() {
  176. return this.netzheshe["uintid"];
  177. }
  178. get music() {
  179. return this.netzheshe["music"] == "1";
  180. }
  181. get skin() {
  182. return this.netzheshe["skinget"] == "1";
  183. }
  184. get aicheatspeed() {
  185. return Number(this.netzheshe["aicheatspeed"]);
  186. }
  187. get aispeedtime() {
  188. return Number(this.netzheshe["aispeedtime"]);
  189. }
  190. get videoshare() {
  191. return this.netzheshe["videoshare"] == "1";
  192. }
  193. get trial() {
  194. return this.netzheshe["trial"] == "1";
  195. }
  196. get invite() {
  197. return this.netzheshe["invite"] == 1;
  198. }
  199. get re() {
  200. return this.netzheshe["re"] == 1;
  201. }
  202. get autosign() {
  203. return this.netzheshe["autosign"] == 1;
  204. }
  205. get showgift() {
  206. return this.netzheshe["showgift"] == 1;
  207. }
  208. get showshop() {
  209. return this.netzheshe["showshop"] == 1;
  210. }
  211. get lotteryTimer() {
  212. if (this.netzheshe["lotteryTimer"])
  213. return Number(this.netzheshe["lotteryTimer"]);
  214. return 0;
  215. }
  216. get falldownline() {
  217. return this.netzheshe["FallDownLine"];
  218. }
  219. get Restitution() {
  220. return this.netzheshe["restitution"];
  221. }
  222. get MergeSpeed() {
  223. return this.netzheshe["MergeSpeed"];
  224. }
  225. get CheckLose() {
  226. return this.netzheshe["CheckLose"];
  227. }
  228. get Save() {
  229. return this.netzheshe["Save"];
  230. }
  231. get GuideHeight() {
  232. return this.netzheshe["GuideHeight"];
  233. }
  234. get ShakeNum() {
  235. return this.netzheshe["ShakeNum"];
  236. }
  237. get touchsize() {
  238. return Number(this.netzheshe["touchsize"]);
  239. }
  240. get touchsmoothness() {
  241. return Number(this.netzheshe["touchsmoothness"]);
  242. }
  243. GainQinDao(_key) {
  244. return this.qiandao[_key];
  245. }
  246. GainShiTi(_key, shuxing) {
  247. return this.shitidic[_key][shuxing];
  248. }
  249. GainJiangLi(_rewardid) {
  250. var reward = this.jianglidic[_rewardid];
  251. return reward;
  252. }
  253. GetPropNum(_index) {
  254. var type = this.account["functions"];
  255. var num = type[_index.toString()];
  256. if (num) {
  257. return num;
  258. }
  259. else {
  260. return 0;
  261. }
  262. }
  263. HasRole(_id) {
  264. var data = this.GainAccount("get_themes");
  265. for (var i = 0; i < data.length; i++) {
  266. var hd = data[i];
  267. if (_id == hd) {
  268. return true;
  269. }
  270. }
  271. return false;
  272. }
  273. HasGun(_id) {
  274. var data = this.GainAccount("functions");
  275. for (var i = 0; i < data.length; i++) {
  276. var hd = data[i];
  277. if (_id == hd) {
  278. return true;
  279. }
  280. }
  281. return false;
  282. }
  283. GetProgress(_id) {
  284. var config = this.account["progress_themes"];
  285. var progress = config[_id] ? config[_id] : 0;
  286. return progress;
  287. }
  288. GetJiangLiLieBiao() {
  289. var peiz = this.GainCollocation("rewards");
  290. for (var key in peiz) {
  291. this.jianglidic[peiz[key].id] = peiz[key];
  292. }
  293. }
  294. GetShiTiLieBiao() {
  295. var peiz = this.GainCollocation("entity");
  296. for (var key in peiz) {
  297. this.shitidic[peiz[key].entity_id] = peiz[key];
  298. }
  299. }
  300. GetChengJiuLieBiao() {
  301. var shujiu = this.GainCollocation("achievement");
  302. var aadsadsdas = {};
  303. for (var key1 in shujiu) {
  304. var type1 = shujiu[key1].type;
  305. if (aadsadsdas[type1]) {
  306. continue;
  307. }
  308. var fasas = [];
  309. for (var key2 in shujiu) {
  310. var type2 = shujiu[key2].type;
  311. if (type1 == type2) {
  312. fasas.push(shujiu[key2]);
  313. }
  314. }
  315. aadsadsdas[type1] = fasas;
  316. }
  317. this.chengjiuliebiao = aadsadsdas;
  318. }
  319. }
  320. var HttpRequest = Laya.HttpRequest;
  321. var Event = Laya.Event;
  322. const BlastToMergeApi = "https://btmapi.xwxgame.com/";
  323. class BlastToMerge {
  324. }
  325. BlastToMerge.DengLu = "user/login";
  326. BlastToMerge.KaiShi = "game/start";
  327. BlastToMerge.JieShu = "game/play";
  328. BlastToMerge.Use = "game/use";
  329. BlastToMerge.GetProgress = "game/progress";
  330. BlastToMerge.Save = "game/save";
  331. BlastToMerge.WithDraw = "qtt/withdraw";
  332. BlastToMerge.CheckCoin = "qtt/balance";
  333. BlastToMerge.GetCoin = "qtt/rewards";
  334. BlastToMerge.QianDao = "sign/sign";
  335. BlastToMerge.Chengjiu = "achievement/getRewards";
  336. BlastToMerge.Config = "config/table";
  337. BlastToMerge.FenXiang = "fission/share";
  338. BlastToMerge.LiXian = "fission/offline";
  339. BlastToMerge.vd = "fission/vd";
  340. BlastToMerge.FuHuo = "game/revival";
  341. BlastToMerge.gadagdag = "treasure/click";
  342. BlastToMerge.Invite = "invite/getRewards";
  343. BlastToMerge.Lottery = "lottery/lottery";
  344. BlastToMerge.ShareGetSkin = "theme/fission";
  345. BlastToMerge.WearEquip = "theme/equip";
  346. BlastToMerge.BuyEquip = "theme/buy";
  347. BlastToMerge.ShouQuan = "user/auth";
  348. BlastToMerge.JinBi = "user/sync";
  349. class ServerManager {
  350. constructor() { }
  351. static get Instance() {
  352. if (ServerManager.ins) {
  353. return ServerManager.ins;
  354. }
  355. else {
  356. return new ServerManager();
  357. }
  358. }
  359. Login(progresscb, completecb, errorcb) {
  360. var Account = AccountManager.Instance;
  361. var ver = Main.Ver;
  362. let Data = `code=${Account.code}&nickname=${Account.nickName}&avatar=${Account.avatarUrl}&gender=${Account.gender}&country=${Account.country}&province=${Account.province}&city=${Account.city}& device=${Account.device}$&share_id=${Account.share_id}&scene=${Account.scene}&v=${ver}`;
  363. let httpRequest = new HttpRequest();
  364. httpRequest.once(Event.PROGRESS, this, this.Progress, [progresscb, httpRequest]);
  365. httpRequest.once(Event.COMPLETE, this, this.Complete, [completecb, httpRequest]);
  366. httpRequest.once(Event.ERROR, this, this.Errorcb, [errorcb, httpRequest]);
  367. httpRequest.send(BlastToMergeApi + BlastToMerge.DengLu, Data, "post", "text");
  368. }
  369. Progress(_progresscb, _httpreq) {
  370. if (_progresscb) {
  371. _progresscb.run();
  372. }
  373. }
  374. Complete(_completecb, _httpreq) {
  375. let data = JSON.parse(_httpreq.data);
  376. console.log(data);
  377. if (data["code"] != "0") {
  378. console.log("登录异常错误!错误信息sssssssss:", _httpreq.data["code"]);
  379. return;
  380. }
  381. console.log("-----------sss", data["t"]);
  382. AccountManager.Instance.SFSFSF = data["t"];
  383. this.RessetConfig(data, _completecb);
  384. }
  385. RessetConfig(data, completecb) {
  386. AccountManager.Instance.ReSetting(data, (flag) => {
  387. if (flag) {
  388. completecb.runWith(data);
  389. }
  390. else {
  391. this.RessetConfig(data, completecb);
  392. }
  393. });
  394. }
  395. Errorcb(_errorcb, _httpreq) {
  396. if (_errorcb != null) {
  397. _errorcb.runWith(_httpreq);
  398. }
  399. }
  400. SendHttp(protocol, param, completecb, errorcb, hasToken = true) {
  401. let sfaasfsfa = "";
  402. let daadsads = BlastToMergeApi + protocol;
  403. if (hasToken == true) {
  404. sfaasfsfa = `token=${AccountManager.Instance.curplayerData.zhengshu}&`;
  405. }
  406. if (protocol == BlastToMerge.KaiShi || protocol == BlastToMerge.JieShu || protocol == BlastToMerge.vd || protocol == BlastToMerge.Lottery) {
  407. let asddsa = "abcdefghijkimnopqrstuvwxyz0123456789";
  408. let adsassda = "{";
  409. let saafsafs = "";
  410. for (let i = 0; i < 4; i++) {
  411. saafsafs += asddsa[Math.floor(Math.random() * 100) % asddsa.length];
  412. }
  413. for (let i = 0; i < param.length; i++) {
  414. for (let key in param[i]) {
  415. adsassda += `\"${key}\":\"${param[i][key]}\"`;
  416. }
  417. if (i < param.length - 1) {
  418. adsassda += ",";
  419. }
  420. else {
  421. adsassda += "}";
  422. }
  423. }
  424. sfaasfsfa += "_r=" + saafsafs + this.SFGSGSG(adsassda);
  425. }
  426. else {
  427. if (param != null) {
  428. for (let i = 0; i < param.length; i++) {
  429. for (let key in param[i]) {
  430. let val = param[i][key];
  431. sfaasfsfa += `${key}=${val}`;
  432. if (i < param.length - 1) {
  433. sfaasfsfa += "&";
  434. }
  435. }
  436. }
  437. }
  438. }
  439. let httpRequest = new HttpRequest();
  440. httpRequest.once(Event.COMPLETE, this, this.onHttpRequestComplete, [completecb, errorcb, httpRequest]);
  441. httpRequest.once(Event.ERROR, this, this.Errorcb, [errorcb, httpRequest]);
  442. httpRequest.send(daadsads, sfaasfsfa, "post", "text");
  443. }
  444. onHttpRequestComplete(succeedcb, failurecb, httpRequest) {
  445. let data = JSON.parse(httpRequest.data);
  446. if (data["code"] == 0) {
  447. AccountManager.Instance.ReSetting(data);
  448. if (succeedcb != null) {
  449. succeedcb.runWith(data);
  450. }
  451. }
  452. else {
  453. if (failurecb != null) {
  454. failurecb.runWith(data);
  455. }
  456. console.log("Error! Http request complete error, code: " + data["code"] + " message: " + data["message"]);
  457. }
  458. }
  459. SFGSGSG(str) {
  460. var c1, c2, c3;
  461. var SFSFFSFSFSFS = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/";
  462. var i = 0, len = str.length, SFFSSFFS = '';
  463. while (i < len) {
  464. c1 = str.charCodeAt(i++) & 0xff;
  465. if (i == len) {
  466. SFFSSFFS += SFSFFSFSFSFS.charAt(c1 >> 2);
  467. SFFSSFFS += SFSFFSFSFSFS.charAt((c1 & 0x3) << 4);
  468. SFFSSFFS += "==";
  469. break;
  470. }
  471. c2 = str.charCodeAt(i++);
  472. if (i == len) {
  473. SFFSSFFS += SFSFFSFSFSFS.charAt(c1 >> 2);
  474. SFFSSFFS += SFSFFSFSFSFS.charAt(((c1 & 0x3) << 4) | ((c2 & 0xF0) >> 4));
  475. SFFSSFFS += SFSFFSFSFSFS.charAt((c2 & 0xF) << 2);
  476. SFFSSFFS += "=";
  477. break;
  478. }
  479. c3 = str.charCodeAt(i++);
  480. SFFSSFFS += SFSFFSFSFSFS.charAt(c1 >> 2);
  481. SFFSSFFS += SFSFFSFSFSFS.charAt(((c1 & 0x3) << 4) | ((c2 & 0xF0) >> 4));
  482. SFFSSFFS += SFSFFSFSFSFS.charAt(((c2 & 0xF) << 2) | ((c3 & 0xC0) >> 6));
  483. SFFSSFFS += SFSFFSFSFSFS.charAt(c3 & 0x3F);
  484. }
  485. return SFFSSFFS;
  486. }
  487. }
  488. class AccountManager {
  489. constructor(_code, _userinfo, _nickname, _avatarurl, _gender, _province, _city, _country, _device, _shareid, _scene, _v) {
  490. this.createTime = Laya.timer.currTimer;
  491. AccountManager.ins = this;
  492. this.code = _code;
  493. this.userInfo = _userinfo;
  494. this.nickName = _nickname;
  495. this.avatarUrl = _avatarurl;
  496. this.gender = _gender;
  497. this.province = _province;
  498. this.city = _city;
  499. this.country = _country;
  500. this.device = _device;
  501. this.share_id = _shareid;
  502. this.scene = _scene;
  503. this.v = _v;
  504. }
  505. static get Instance() {
  506. if (AccountManager.ins == null) {
  507. new AccountManager("222222", "你找谁?", "1233", "123", 1, "中国", "上海", "上海", "iphone6s", "123", "123", "123");
  508. }
  509. return AccountManager.ins;
  510. }
  511. ReSetting(data, cb = null) {
  512. var zhengshu = data["token"];
  513. var netset = data["app_setting"];
  514. var user = data["user"];
  515. var jichu = data["user_base"];
  516. var qiandao = data["user_sign"];
  517. var chengjiu = data["user_achievement"];
  518. var invite = data["user_invite"];
  519. var lottery = data["user_lottery"];
  520. if (this.curplayerData == null) {
  521. this.curplayerData = new PlayerData(zhengshu, null, netset, user, jichu, invite, null, qiandao, chengjiu, lottery);
  522. this.JundgCfg(data.table_version, cb);
  523. }
  524. else {
  525. if (netset) {
  526. this.curplayerData.netzheshe = netset;
  527. }
  528. if (user) {
  529. this.curplayerData.account = user;
  530. }
  531. if (jichu) {
  532. this.curplayerData.accountssss = jichu;
  533. }
  534. if (qiandao) {
  535. this.curplayerData.qiandao = qiandao;
  536. }
  537. if (chengjiu) {
  538. this.curplayerData.renwu = chengjiu;
  539. }
  540. }
  541. }
  542. JundgCfg(ver, callball) {
  543. var cfg = Laya.LocalStorage.getJSON(Main.CFG);
  544. if (cfg) {
  545. if (cfg.VER == ver) {
  546. console.log("已经拥有,不用更新");
  547. this.SetCfg(cfg);
  548. if (callball)
  549. callball(true);
  550. }
  551. else {
  552. console.log("cfg存在但是过期了");
  553. Laya.LocalStorage.removeItem(Main.CFG);
  554. ServerManager.Instance.SendHttp(BlastToMerge.Config, null, Laya.Handler.create(this, (data) => {
  555. data.configs.VER = ver;
  556. Laya.LocalStorage.setJSON(Main.CFG, data.configs);
  557. this.SetCfg(data.configs);
  558. if (callball)
  559. callball(true);
  560. }), Laya.Handler.create(this, (data) => {
  561. console.log("配置获取失败" + data);
  562. if (callball)
  563. callball(false);
  564. return;
  565. }));
  566. }
  567. }
  568. else {
  569. console.log("本地没有cfg");
  570. ServerManager.Instance.SendHttp(BlastToMerge.Config, null, Laya.Handler.create(this, (data) => {
  571. data.configs.VER = ver;
  572. Laya.LocalStorage.setJSON(Main.CFG, data.configs);
  573. this.SetCfg(data.configs);
  574. if (callball)
  575. callball(true);
  576. }), Laya.Handler.create(this, (data) => {
  577. console.log("配置获取失败" + data);
  578. }));
  579. }
  580. }
  581. SetCfg(data) {
  582. this.curplayerData.peizhis = data;
  583. this.curplayerData.GetJiangLiLieBiao();
  584. this.curplayerData.GetShiTiLieBiao();
  585. this.curplayerData.GetChengJiuLieBiao();
  586. }
  587. RessetConfig() {
  588. ServerManager.Instance.SendHttp(BlastToMerge.Config, null, Laya.Handler.create(this, (data) => {
  589. this.curplayerData.peizhis = data["configs"];
  590. this.curplayerData.GetJiangLiLieBiao();
  591. this.curplayerData.GetShiTiLieBiao();
  592. this.curplayerData.GetChengJiuLieBiao();
  593. }), null);
  594. }
  595. get ServerTime() {
  596. let time = Laya.timer.currTimer;
  597. let stime = this.SFSFSF + Math.ceil((time - this.createTime) / 1000);
  598. return stime;
  599. }
  600. }
  601. class RankPan {
  602. constructor() {
  603. this.Width = 0;
  604. this.Height = 0;
  605. this.shareCanvas = Laya.Browser.window.sharedCanvas;
  606. this.ShareSprite = new Laya.Sprite();
  607. this.ShareSprite.zOrder = 1008;
  608. this.ShareSprite.pos(0, 0);
  609. this.ShareSprite.cacheAs = "normal";
  610. Laya.stage.addChild(this.ShareSprite);
  611. this.SSSS = new Laya.Texture2D();
  612. this.TTTT = new Laya.Texture(this.SSSS);
  613. }
  614. ShuShi(_width = 720, _heigth = 1280) {
  615. this.Width = Laya.stage.width;
  616. this.Height = Laya.stage.height;
  617. this.shareCanvas.width = _width;
  618. this.shareCanvas.height = _heigth;
  619. }
  620. open() {
  621. Laya.timer.frameLoop(10, this, this.gengxin);
  622. this.ShareSprite.visible = true;
  623. }
  624. close() {
  625. Laya.timer.clear(this, this.gengxin);
  626. this.ShareSprite.visible = false;
  627. }
  628. gengxin() {
  629. this.HuaTu();
  630. }
  631. HuaTu() {
  632. this.SSSS.loadImageSource(this.shareCanvas);
  633. this.TTTT.setTo(this.SSSS);
  634. this.ShareSprite.graphics.clear();
  635. this.ShareSprite.graphics.drawTexture(this.TTTT, 0, 0, this.TTTT.width, this.TTTT.height);
  636. }
  637. draw2d() {
  638. this.AAAA.drawImage(this.shareCanvas, 0, 0, this.shareCanvas.width, this.shareCanvas.height);
  639. }
  640. }
  641. class RankSDK {
  642. constructor() { }
  643. static ShuShi() {
  644. if (!Laya.Browser.onWeiXin)
  645. return;
  646. this.SetScreen();
  647. this.RankPan = new RankPan();
  648. this.RankPan.ShuShi();
  649. }
  650. static OpenRank(keyName = "Level") {
  651. if (Laya.Browser.onWeiXin) {
  652. this.Send(keyName, "show_friend_rank");
  653. console.log("打开排行榜---openrank");
  654. }
  655. }
  656. static Leftpe() {
  657. if (Laya.Browser.onWeiXin)
  658. this.Send("", "show_up_page");
  659. }
  660. static Rightpe() {
  661. if (Laya.Browser.onWeiXin)
  662. this.Send("", "show_next_page");
  663. }
  664. static OpenPan() {
  665. console.log("Laya.Browser.onWeiXin", Laya.Browser.onWeiXin);
  666. if (Laya.Browser.window.wx)
  667. this.RankPan.open();
  668. }
  669. static ClosePan() {
  670. if (Laya.Browser.onWeiXin)
  671. this.RankPan.close();
  672. }
  673. static SetScreen() {
  674. if (!Laya.Browser.onWeiXin)
  675. return;
  676. let width = Laya.stage.width;
  677. let height = Laya.stage.height;
  678. let data = { width: width, height: height };
  679. this.Send("", "canvase_width_height", data);
  680. }
  681. static Send(keyName, action, data) {
  682. console.log("消息发送成功0---send");
  683. Laya.Browser.window.wx.postMessage({
  684. keyName: keyName,
  685. action: action,
  686. data: data
  687. });
  688. console.log("消息发送成功---send");
  689. }
  690. static SetStage(keyName, value, callBack = null) {
  691. let obj = [{
  692. key: keyName,
  693. value: value
  694. }];
  695. Laya.Browser.window.wx.setUserCloudStorage({
  696. KVDataList: obj,
  697. success: function (res) {
  698. console.log("数据上传成功" + res);
  699. if (callBack) {
  700. callBack();
  701. }
  702. },
  703. fail: function (res) {
  704. console.log("数据上传失败" + res);
  705. if (callBack) {
  706. callBack();
  707. }
  708. }
  709. });
  710. }
  711. }
  712. class WXSDK {
  713. constructor() {
  714. WXSDK.ins = this;
  715. }
  716. static get Instance() {
  717. if (WXSDK.ins) {
  718. return WXSDK.ins;
  719. }
  720. else {
  721. return new WXSDK();
  722. }
  723. }
  724. static Init() {
  725. Laya.Browser.window.wx.showShareMenu({
  726. withShareTicket: true
  727. });
  728. Laya.Browser.window.wx.onShareAppMessage(function () {
  729. return {
  730. title: "",
  731. imageUrl: "gameResources/res/share/sharepictrue.png",
  732. };
  733. });
  734. Laya.Browser.window.wx.onShow((option) => {
  735. var shareTicket = option.shareTicket;
  736. var userId = option.query.userId;
  737. var shareTitle = option.query.shareTitle;
  738. Main.SceneNum = option.scene;
  739. WXSDK.querychannel = option.query.channel;
  740. WXSDK.shareOpenId = option.query.userId;
  741. console.log("option---", option);
  742. console.log("scene:", option.scene);
  743. if (WXSDK.querychannel != null) {
  744. console.log("onShow channel is:", WXSDK.querychannel);
  745. }
  746. if (option.referrerInfo) {
  747. WXSDK.referrerInfoappId = option.referrerInfo.appId;
  748. console.log("onShow appId is:", option.referrerInfo.appId);
  749. }
  750. });
  751. }
  752. static DengLu(_complete) {
  753. var that = this;
  754. Laya.Browser.window.wx.login({
  755. success: function (res) {
  756. if (res.code) {
  757. console.log("微信登陆成功----");
  758. that.codeValue = res.code;
  759. RankSDK.ShuShi();
  760. console.log("shareid:" + WXSDK.shareOpenId);
  761. new AccountManager(res.code, "", "", "", 0, "", "", "", "", WXSDK.shareOpenId, WXSDK.shareOpenId, Main.Ver);
  762. _complete(res);
  763. }
  764. else {
  765. WXSDK.DengLu(WXSDK.DengLu);
  766. console.log('wx no code' + res.errMsg);
  767. }
  768. },
  769. fail: function (res) { console.log("wx.login: failed, res=" + res); }
  770. });
  771. }
  772. static ShowTxt(text) {
  773. if (Laya.Browser.window.wx) {
  774. Laya.Browser.window.wx.showToast({ title: text });
  775. }
  776. else {
  777. console.log(text);
  778. }
  779. }
  780. static ShortShake() {
  781. Laya.Browser.window.wx.vibrateShort({});
  782. }
  783. static LongShake() {
  784. Laya.Browser.window.wx.vibrateLong({});
  785. }
  786. static Shake(_short = true) {
  787. if (Laya.Browser.onWeiXin && WXSDK.shake) {
  788. if (_short) {
  789. this.ShortShake();
  790. }
  791. else {
  792. this.LongShake();
  793. }
  794. }
  795. }
  796. static LoadSubPackage(name, _complete) {
  797. if (Laya.Browser.onWeiXin) {
  798. const loadTask = Laya.Browser.window.wx.loadSubpackage({
  799. name: 'Game',
  800. success: function (res) {
  801. _complete && _complete(true);
  802. console.log("分包加载成功");
  803. },
  804. fail: function (res) {
  805. _complete && _complete(false);
  806. console.log("分包加载失败");
  807. }
  808. });
  809. }
  810. else {
  811. console.log("未进行分包加载");
  812. _complete && _complete(true);
  813. }
  814. }
  815. static UpdateScore(_level) {
  816. var kvDataList = new Array();
  817. let date = new Date().getTime();
  818. var myValue = JSON.stringify({
  819. "wxgame": {
  820. "Level": _level,
  821. "update_time": date.toString(),
  822. }
  823. });
  824. kvDataList.push({ key: "Level", value: myValue });
  825. if (Laya.Browser.onWeiXin) {
  826. Laya.Browser.window.wx.setUserCloudStorage({
  827. KVDataList: kvDataList,
  828. success: r => {
  829. console.log("KVDATALIST---", kvDataList);
  830. console.log("上传分数成功:" + _level);
  831. }
  832. });
  833. }
  834. }
  835. IsNeedUpdate() {
  836. if (!Laya.Browser.onWeiXin)
  837. return;
  838. const updateManager = Laya.Browser.window.wx.getUpdateManager();
  839. updateManager.onCheckForUpdate(function (res) {
  840. console.log("最新版本:" + res.hasUpdate);
  841. });
  842. updateManager.onUpdateReady(function () {
  843. Laya.Browser.window.wx.showModal({
  844. showCancel: false,
  845. title: '更新提示',
  846. content: '新版本已经准备好,是否重启应用?',
  847. success(res) {
  848. updateManager.applyUpdate();
  849. },
  850. fail(res) {
  851. updateManager.applyUpdate();
  852. }
  853. });
  854. });
  855. }
  856. }
  857. WXSDK.codeValue = "";
  858. WXSDK.shareOpenId = "";
  859. WXSDK.openId = 0;
  860. WXSDK.shareScene = "";
  861. WXSDK.uid = "123";
  862. WXSDK.querychannel = "";
  863. WXSDK.referrerInfoappId = "";
  864. WXSDK.shake = true;
  865. var REG = Laya.ClassUtils.regClass;
  866. var ui;
  867. (function (ui) {
  868. class FailureViewUI extends Laya.Scene {
  869. constructor() { super(); }
  870. createChildren() {
  871. super.createChildren();
  872. this.createView(FailureViewUI.uiView);
  873. }
  874. }
  875. FailureViewUI.uiView = { "type": "Scene", "props": { "width": 720, "height": 1280 }, "compId": 2, "child": [{ "type": "Image", "props": { "y": 0, "x": 0, "var": "BG", "top": 0, "skin": "WinView/black.png", "sizeGrid": "12,14,14,13", "right": 0, "left": 0, "bottom": 0 }, "compId": 8 }, { "type": "Image", "props": { "y": 525, "x": 360, "width": 720, "skin": "ReviveView/fuhuo-1-1.png", "height": 994, "anchorY": 0.5, "anchorX": 0.5 }, "compId": 5, "child": [{ "type": "Image", "props": { "y": 252, "x": 285, "skin": "FailureView/shibai-1-1.png" }, "compId": 4 }, { "type": "Button", "props": { "y": 506, "x": 360, "var": "BackBtn", "stateNum": 1, "skin": "FailureView/shibai-1-2.png", "anchorY": 0.5, "anchorX": 0.5 }, "compId": 6 }, { "type": "Button", "props": { "y": 627, "x": 360, "var": "TryBtn", "stateNum": 1, "skin": "FailureView/shibai-1-3.png", "anchorY": 0.5, "anchorX": 0.5 }, "compId": 7 }] }], "loadList": ["WinView/black.png", "ReviveView/fuhuo-1-1.png", "FailureView/shibai-1-1.png", "FailureView/shibai-1-2.png", "FailureView/shibai-1-3.png"], "loadList3D": [] };
  876. ui.FailureViewUI = FailureViewUI;
  877. REG("ui.FailureViewUI", FailureViewUI);
  878. class GetRewardViewUI extends Laya.Scene {
  879. constructor() { super(); }
  880. createChildren() {
  881. super.createChildren();
  882. this.createView(GetRewardViewUI.uiView);
  883. }
  884. }
  885. GetRewardViewUI.uiView = { "type": "Scene", "props": { "width": 720, "height": 1280 }, "compId": 2, "child": [{ "type": "Image", "props": { "y": 488, "x": 360, "width": 696, "skin": "WinView/guoguan-1-7.png", "pivotY": 376, "pivotX": 348, "height": 720 }, "compId": 3, "child": [{ "type": "Image", "props": { "y": 182, "x": 328, "width": 126, "var": "skillicon", "pivotY": 62, "pivotX": 63, "height": 124 }, "compId": 4 }, { "type": "Text", "props": { "y": 461, "x": 348, "width": 338, "valign": "middle", "text": "双倍道具", "pivotY": 44, "pivotX": 169, "height": 88, "fontSize": 40, "align": "left", "runtime": "laya.display.Text" }, "compId": 6 }] }, { "type": "Button", "props": { "y": 759, "x": 360, "width": 264, "var": "GetBtn", "stateNum": 1, "skin": "WinView/guoguan-1-6.png", "pivotY": 53, "pivotX": 132, "height": 106 }, "compId": 5 }], "loadList": ["WinView/guoguan-1-7.png", "WinView/guoguan-1-6.png"], "loadList3D": [] };
  886. ui.GetRewardViewUI = GetRewardViewUI;
  887. REG("ui.GetRewardViewUI", GetRewardViewUI);
  888. class InGameSceneUI extends Laya.Scene {
  889. constructor() { super(); }
  890. createChildren() {
  891. super.createChildren();
  892. this.createView(InGameSceneUI.uiView);
  893. }
  894. }
  895. InGameSceneUI.uiView = { "type": "Scene", "props": { "width": 720, "pref": "@Prefab:Pr", "height": 1280, "autoDestroyAtClosed": true }, "compId": 2, "child": [{ "type": "Image", "props": { "y": 892, "x": 0, "width": 729, "visible": true, "var": "BottomCollider", "skin": "InGameView/colliderbottom.png", "scaleY": 1, "scaleX": 1, "name": "BottomCollider", "height": 211, "bottom": 177, "alpha": 1 }, "compId": 58, "child": [{ "type": "Script", "props": { "points": "-2,-1,78,-1,78,65,83,81,110,108,147,129,190,145,248,157,291,164,353,166,423,164,486,156,551,139,596,119,626,96,642,72,643,0,732,0", "runtime": "laya.physics.ChainCollider" }, "compId": 200 }, { "type": "Script", "props": { "type": "static", "runtime": "laya.physics.RigidBody" }, "compId": 201 }] }, { "type": "Image", "props": { "y": 937, "x": 720, "width": 82, "var": "RightCollider", "skin": "InGameView/0.png", "pivotY": 939, "pivotX": 79, "name": "RightCollider", "height": 957, "alpha": 1 }, "compId": 55, "child": [{ "type": "Script", "props": { "y": 0, "x": 0, "points": "230,-454,82,-1,81,1404,2,1405,0,716,1,631,0,571,7,478,23,332,31,235,32,191,31,169,34,143,39,121,49,81,58,36,61,-1,84,0", "runtime": "laya.physics.ChainCollider" }, "compId": 195 }, { "type": "Script", "props": { "type": "static", "runtime": "laya.physics.RigidBody" }, "compId": 196 }] }, { "type": "Image", "props": { "y": 943, "x": 78, "width": 80, "var": "LeftCollider", "skin": "InGameView/1.png", "scaleY": 1, "scaleX": 1, "pivotY": 939, "pivotX": 80, "name": "LeftCollider", "height": 885, "alpha": 1 }, "compId": 52, "child": [{ "type": "Script", "props": { "y": 0, "x": 0, "points": "-153,-466,-1,-5,9,1434,0,-1,15,-1,18,32,25,67,39,115,44,144,46,165,46,198,49,254,57,312,63,366,80,533,80,678,83,1432", "runtime": "laya.physics.ChainCollider" }, "compId": 197 }, { "type": "Script", "props": { "type": "static", "runtime": "laya.physics.RigidBody" }, "compId": 198 }] }, { "type": "Image", "props": { "y": 0, "x": 0, "var": "BG", "top": 0, "skin": "InGameView/groundplane.png", "sizeGrid": "179,113,184,121", "right": 0, "left": 0, "bottom": 0 }, "compId": 4 }, { "type": "Image", "props": { "x": 78, "width": 514, "skin": "InGameView/borderbottom.png", "scaleX": 1.1, "name": "bottom", "height": 160, "bottom": 222 }, "compId": 37 }, { "type": "Image", "props": { "y": 0, "x": 14, "width": 346, "top": 0, "skin": "InGameView/border2.png", "scaleY": 2, "scaleX": 2, "name": "area", "bottom": 380 }, "compId": 36 }, { "type": "Image", "props": { "skin": "InGameView/blast-35.png", "right": 0, "name": "prop", "left": 0, "bottom": 0 }, "compId": 3, "child": [{ "type": "Button", "props": { "y": 132, "x": 629, "width": 82, "var": "arrowbtn", "stateNum": 1, "skin": "Skillicon/BoosterArrow1_00239.png", "pivotY": 37, "pivotX": 41, "name": "", "height": 73 }, "compId": 383, "child": [{ "type": "Image", "props": { "y": 62, "x": 84, "width": 29, "skin": "InGameView/blast-45.png", "pivotY": 14, "pivotX": 15, "name": "cycle", "height": 28 }, "compId": 20 }, { "type": "Text", "props": { "y": 64, "x": 84, "width": 32, "var": "Func5num", "valign": "middle", "text": "10", "pivotY": 9, "pivotX": 16, "height": 18, "fontSize": 20, "font": "Microsoft YaHei", "color": "#ffffff", "bold": false, "align": "center", "runtime": "laya.display.Text" }, "compId": 21 }] }, { "type": "Button", "props": { "y": 130, "x": 88, "width": 79, "var": "doublebtn", "stateNum": 1, "skin": "Skillicon/BoosterExplode1_00239.png", "pivotY": 29, "pivotX": 40, "height": 55 }, "compId": 384, "child": [{ "type": "Image", "props": { "y": 57, "x": 80, "width": 29, "skin": "InGameView/blast-45.png", "pivotY": 14, "pivotX": 15, "name": "cycle", "height": 28 }, "compId": 12 }, { "type": "Text", "props": { "y": 60, "x": 79, "width": 28, "var": "Func1num", "valign": "middle", "text": "10", "pivotY": 10, "pivotX": 14, "height": 20, "fontSize": 20, "font": "Microsoft YaHei", "color": "#ffffff", "bold": false, "align": "center", "runtime": "laya.display.Text" }, "compId": 13 }] }, { "type": "Button", "props": { "y": 166, "x": 222, "width": 85, "var": "zhunxin1btn", "stateNum": 1, "skin": "Skillicon/BoosterFire1_00239.png", "pivotY": 40, "pivotX": 43, "height": 80 }, "compId": 385, "child": [{ "type": "Image", "props": { "y": 57, "x": 79, "width": 29, "skin": "InGameView/blast-45.png", "pivotY": 14, "pivotX": 15, "name": "cycle", "height": 28 }, "compId": 14 }, { "type": "Text", "props": { "y": 59.5, "x": 79, "width": 27, "var": "Func2num", "valign": "middle", "text": "10", "pivotY": 12, "pivotX": 14, "height": 23, "fontSize": 20, "font": "Microsoft YaHei", "color": "#ffffff", "bold": false, "align": "center", "runtime": "laya.display.Text" }, "compId": 15 }] }, { "type": "Button", "props": { "y": 175, "x": 361, "width": 77, "var": "zhunxin2btn", "stateNum": 1, "skin": "Skillicon/BoosterShoot1_00240.png", "pivotY": 37, "pivotX": 39, "height": 73 }, "compId": 386, "child": [{ "type": "Image", "props": { "y": 58, "x": 76, "width": 29, "skin": "InGameView/blast-45.png", "pivotY": 14, "pivotX": 15, "name": "cycle", "height": 28 }, "compId": 16 }, { "type": "Text", "props": { "y": 61, "x": 76, "width": 31, "var": "Func3num", "valign": "middle", "text": "10", "pivotY": 11, "pivotX": 16, "height": 22, "fontSize": 20, "font": "Microsoft YaHei", "color": "#ffffff", "bold": false, "align": "center", "runtime": "laya.display.Text" }, "compId": 17 }] }, { "type": "Button", "props": { "y": 165, "x": 499, "width": 68, "var": "hammerbtn", "stateNum": 1, "skin": "Skillicon/BoosterHammer1_00238.png", "pivotY": 39, "pivotX": 34, "height": 78 }, "compId": 388, "child": [{ "type": "Image", "props": { "y": 56, "x": 84, "width": 29, "skin": "InGameView/blast-45.png", "pivotY": 14, "pivotX": 15, "name": "cycle", "height": 28 }, "compId": 18 }, { "type": "Text", "props": { "y": 58, "x": 84, "width": 31, "var": "Func4num", "valign": "middle", "text": "10", "pivotY": 12, "pivotX": 16, "height": 24, "fontSize": 20, "font": "Microsoft YaHei", "color": "#ffffff", "bold": false, "align": "center", "runtime": "laya.display.Text" }, "compId": 19 }] }] }, { "type": "Sprite", "props": { "y": 8, "x": 8, "width": 16, "var": "prefabbox", "pivotY": 8, "pivotX": 8, "height": 16 }, "compId": 677 }, { "type": "ProgressBar", "props": { "x": 360, "width": 281, "var": "LevelProgress", "value": 0, "top": 120, "skin": "InGameView/jindutiao-1-2.png", "pivotY": 22, "pivotX": 141, "height": 44 }, "compId": 574, "child": [{ "type": "Image", "props": { "y": 22, "x": -14, "width": 73, "skin": "InGameView/jindutiao-1-3.png", "pivotY": 37, "pivotX": 37, "height": 73 }, "compId": 570, "child": [{ "type": "FontClip", "props": { "y": 36, "x": 36, "width": 25, "var": "NowLv", "value": "1", "skin": "Ball/43.png", "sheet": "0123456789", "pivotY": 15, "pivotX": 13, "height": 29, "align": "center" }, "compId": 578 }] }, { "type": "Image", "props": { "y": 22, "x": 298, "width": 73, "skin": "InGameView/jindutiao-1-3.png", "pivotY": 37, "pivotX": 37, "height": 73 }, "compId": 571, "child": [{ "type": "FontClip", "props": { "y": 36.5, "x": 36.5, "width": 25, "var": "NextLv", "value": "2", "skin": "Ball/43.png", "sheet": "0123456789", "pivotY": 15, "pivotX": 13, "height": 29, "align": "center" }, "compId": 576 }] }, { "type": "Text", "props": { "y": -22, "x": 38, "width": 117, "var": "NowScore", "valign": "middle", "text": "0", "pivotY": 13, "pivotX": 19, "height": 26, "fontSize": 30, "color": "#ffffff", "align": "right", "runtime": "laya.display.Text" }, "compId": 674 }, { "type": "Text", "props": { "y": -21, "x": 208, "width": 124, "var": "RequireScore", "valign": "middle", "text": "0", "pivotY": 14, "pivotX": 62, "height": 27, "fontSize": 30, "color": "#ffffff", "align": "left", "runtime": "laya.display.Text" }, "compId": 675 }, { "type": "Text", "props": { "y": -34, "x": 136, "width": 10, "text": "/", "height": 25, "fontSize": 30, "color": "#ffffff", "runtime": "laya.display.Text" }, "compId": 676 }] }, { "type": "Image", "props": { "y": 49, "x": 0, "visible": false, "var": "Effect", "skin": "InGameView/youxinei-1-2.png", "right": 0, "left": 0 }, "compId": 558, "child": [{ "type": "Button", "props": { "y": 883, "x": 360, "width": 298, "var": "EffectBtn", "stateNum": 1, "skin": "InGameView/youxinei-1-5.png", "pivotY": 53, "pivotX": 149, "height": 106 }, "compId": 564 }, { "type": "Image", "props": { "y": 95, "x": 626, "width": 69, "pivotY": 36, "pivotX": 35, "name": "ICON", "height": 72 }, "compId": 565 }, { "type": "Image", "props": { "x": 0, "width": 72, "top": -48, "skin": "InGameView/youxinei-1-1.png", "name": "Left", "height": 1280 }, "compId": 566 }, { "type": "Image", "props": { "x": 684, "width": 72, "top": -48, "skin": "InGameView/youxinei-1-1.png", "rotation": 180, "pivotY": 640, "pivotX": 36, "name": "Right", "height": 1280 }, "compId": 567 }, { "type": "Text", "props": { "y": 52, "x": 318, "width": 153, "valign": "middle", "text": "消除所有的", "pivotY": 28, "pivotX": 77, "name": "describe", "height": 55, "fontSize": 30, "font": "Microsoft YaHei", "color": "#ffffff", "align": "left", "runtime": "laya.display.Text" }, "compId": 579, "child": [{ "type": "Text", "props": { "y": 26, "x": 176, "width": 40, "var": "ClearNum", "valign": "middle", "text": "2", "pivotY": 23, "pivotX": 20, "height": 45, "fontSize": 35, "color": "#ffffff", "align": "center", "runtime": "laya.display.Text" }, "compId": 580 }] }, { "type": "Text", "props": { "y": 52, "x": 362, "width": 241, "valign": "middle", "text": "消除你所砸到的球", "pivotY": 28, "pivotX": 121, "name": "describe2", "height": 55, "fontSize": 30, "font": "Microsoft YaHei", "color": "#ffffff", "align": "left", "runtime": "laya.display.Text" }, "compId": 678 }] }, { "type": "Image", "props": { "x": 311, "width": 124, "visible": false, "var": "Guide", "skin": "InGameView/yindao.png", "pivotY": 32, "pivotX": 31, "height": 148, "bottom": 160 }, "compId": 734, "child": [{ "type": "Image", "props": { "y": -40, "x": -55, "skin": "InGameView/zhujiemian-1-9.png" }, "compId": 736 }] }], "animations": [{ "nodes": [{ "target": 383, "keyframes": { "var": [{ "value": "arrowbtn", "tweenMethod": "linearNone", "tween": false, "target": 383, "key": "var", "index": 0 }], "skin": [{ "value": "Skillicon/BoosterArrow1_00239.png", "tweenMethod": "linearNone", "tween": false, "target": 383, "key": "skin", "index": 0 }, { "value": "Skillicon/BoosterArrow1_00240.png", "tweenMethod": "linearNone", "tween": false, "target": 383, "key": "skin", "index": 1 }, { "value": "Skillicon/BoosterArrow1_00241.png", "tweenMethod": "linearNone", "tween": false, "target": 383, "key": "skin", "index": 2 }, { "value": "Skillicon/BoosterArrow1_00242.png", "tweenMethod": "linearNone", "tween": false, "target": 383, "key": "skin", "index": 3 }, { "value": "Skillicon/BoosterArrow1_00243.png", "tweenMethod": "linearNone", "tween": false, "target": 383, "key": "skin", "index": 4 }, { "value": "Skillicon/BoosterArrow1_00244.png", "tweenMethod": "linearNone", "tween": false, "target": 383, "key": "skin", "index": 5 }, { "value": "Skillicon/BoosterArrow1_00245.png", "tweenMethod": "linearNone", "tween": false, "target": 383, "key": "skin", "index": 6 }, { "value": "Skillicon/BoosterArrow1_00246.png", "tweenMethod": "linearNone", "tween": false, "target": 383, "key": "skin", "index": 7 }, { "value": "Skillicon/BoosterArrow1_00247.png", "tweenMethod": "linearNone", "tween": false, "target": 383, "key": "skin", "index": 8 }, { "value": "Skillicon/BoosterArrow1_00248.png", "tweenMethod": "linearNone", "tween": false, "target": 383, "key": "skin", "index": 9 }, { "value": "Skillicon/BoosterArrow1_00249.png", "tweenMethod": "linearNone", "tween": false, "target": 383, "key": "skin", "index": 10 }, { "value": "Skillicon/BoosterArrow1_00250.png", "tweenMethod": "linearNone", "tween": false, "target": 383, "key": "skin", "index": 11 }, { "value": "Skillicon/BoosterArrow1_00251.png", "tweenMethod": "linearNone", "tween": false, "target": 383, "key": "skin", "index": 12 }, { "value": "Skillicon/BoosterArrow1_00252.png", "tweenMethod": "linearNone", "tween": false, "target": 383, "key": "skin", "index": 13 }, { "value": "Skillicon/BoosterArrow1_00253.png", "tweenMethod": "linearNone", "tween": false, "target": 383, "key": "skin", "index": 14 }, { "value": "Skillicon/BoosterArrow1_00254.png", "tweenMethod": "linearNone", "tween": false, "target": 383, "key": "skin", "index": 15 }, { "value": "Skillicon/BoosterArrow1_00255.png", "tweenMethod": "linearNone", "tween": false, "target": 383, "key": "skin", "index": 16 }], "name": [{ "value": "", "tweenMethod": "linearNone", "tween": false, "target": 383, "key": "name", "index": 0 }] } }], "name": "ani1", "id": 1, "frameRate": 24, "action": 0 }, { "nodes": [{ "target": 384, "keyframes": { "skin": [{ "value": "Skillicon/BoosterExplode1_00239.png", "tweenMethod": "linearNone", "tween": false, "target": 384, "key": "skin", "index": 0 }, { "value": "Skillicon/BoosterExplode1_00240.png", "tweenMethod": "linearNone", "tween": false, "target": 384, "key": "skin", "index": 1 }, { "value": "Skillicon/BoosterExplode1_00241.png", "tweenMethod": "linearNone", "tween": false, "target": 384, "key": "skin", "index": 2 }, { "value": "Skillicon/BoosterExplode1_00242.png", "tweenMethod": "linearNone", "tween": false, "target": 384, "key": "skin", "index": 3 }, { "value": "Skillicon/BoosterExplode1_00243.png", "tweenMethod": "linearNone", "tween": false, "target": 384, "key": "skin", "index": 4 }, { "value": "Skillicon/BoosterExplode1_00244.png", "tweenMethod": "linearNone", "tween": false, "target": 384, "key": "skin", "index": 5 }, { "value": "Skillicon/BoosterExplode1_00245.png", "tweenMethod": "linearNone", "tween": false, "target": 384, "key": "skin", "index": 6 }, { "value": "Skillicon/BoosterExplode1_00246.png", "tweenMethod": "linearNone", "tween": false, "target": 384, "key": "skin", "index": 7 }, { "value": "Skillicon/BoosterExplode1_00247.png", "tweenMethod": "linearNone", "tween": false, "target": 384, "key": "skin", "index": 8 }, { "value": "Skillicon/BoosterExplode1_00248.png", "tweenMethod": "linearNone", "tween": false, "target": 384, "key": "skin", "index": 9 }, { "value": "Skillicon/BoosterExplode1_00249.png", "tweenMethod": "linearNone", "tween": false, "target": 384, "key": "skin", "index": 10 }, { "value": "Skillicon/BoosterExplode1_00250.png", "tweenMethod": "linearNone", "tween": false, "target": 384, "key": "skin", "index": 11 }, { "value": "Skillicon/BoosterExplode1_00251.png", "tweenMethod": "linearNone", "tween": false, "target": 384, "key": "skin", "index": 12 }, { "value": "Skillicon/BoosterExplode1_00252.png", "tweenMethod": "linearNone", "tween": false, "target": 384, "key": "skin", "index": 13 }, { "value": "Skillicon/BoosterExplode1_00253.png", "tweenMethod": "linearNone", "tween": false, "target": 384, "key": "skin", "index": 14 }, { "value": "Skillicon/BoosterExplode1_00254.png", "tweenMethod": "linearNone", "tween": false, "target": 384, "key": "skin", "index": 15 }, { "value": "Skillicon/BoosterExplode1_00255.png", "tweenMethod": "linearNone", "tween": false, "target": 384, "key": "skin", "index": 16 }] } }], "name": "ani2", "id": 2, "frameRate": 24, "action": 0 }, { "nodes": [{ "target": 385, "keyframes": { "skin": [{ "value": "Skillicon/BoosterFire1_00239.png", "tweenMethod": "linearNone", "tween": false, "target": 385, "key": "skin", "index": 0 }, { "value": "Skillicon/BoosterFire1_00240.png", "tweenMethod": "linearNone", "tween": false, "target": 385, "key": "skin", "index": 1 }, { "value": "Skillicon/BoosterFire1_00241.png", "tweenMethod": "linearNone", "tween": false, "target": 385, "key": "skin", "index": 2 }, { "value": "Skillicon/BoosterFire1_00242.png", "tweenMethod": "linearNone", "tween": false, "target": 385, "key": "skin", "index": 3 }, { "value": "Skillicon/BoosterFire1_00243.png", "tweenMethod": "linearNone", "tween": false, "target": 385, "key": "skin", "index": 4 }, { "value": "Skillicon/BoosterFire1_00244.png", "tweenMethod": "linearNone", "tween": false, "target": 385, "key": "skin", "index": 5 }, { "value": "Skillicon/BoosterFire1_00245.png", "tweenMethod": "linearNone", "tween": false, "target": 385, "key": "skin", "index": 6 }, { "value": "Skillicon/BoosterFire1_00246.png", "tweenMethod": "linearNone", "tween": false, "target": 385, "key": "skin", "index": 7 }, { "value": "Skillicon/BoosterFire1_00247.png", "tweenMethod": "linearNone", "tween": false, "target": 385, "key": "skin", "index": 8 }, { "value": "Skillicon/BoosterFire1_00248.png", "tweenMethod": "linearNone", "tween": false, "target": 385, "key": "skin", "index": 9 }, { "value": "Skillicon/BoosterFire1_00249.png", "tweenMethod": "linearNone", "tween": false, "target": 385, "key": "skin", "index": 10 }, { "value": "Skillicon/BoosterFire1_00250.png", "tweenMethod": "linearNone", "tween": false, "target": 385, "key": "skin", "index": 11 }, { "value": "Skillicon/BoosterFire1_00251.png", "tweenMethod": "linearNone", "tween": false, "target": 385, "key": "skin", "index": 12 }, { "value": "Skillicon/BoosterFire1_00252.png", "tweenMethod": "linearNone", "tween": false, "target": 385, "key": "skin", "index": 13 }, { "value": "Skillicon/BoosterFire1_00253.png", "tweenMethod": "linearNone", "tween": false, "target": 385, "key": "skin", "index": 14 }, { "value": "Skillicon/BoosterFire1_00254.png", "tweenMethod": "linearNone", "tween": false, "target": 385, "key": "skin", "index": 15 }, { "value": "Skillicon/BoosterFire1_00255.png", "tweenMethod": "linearNone", "tween": false, "target": 385, "key": "skin", "index": 16 }] } }], "name": "ani3", "id": 3, "frameRate": 24, "action": 0 }, { "nodes": [{ "target": 386, "keyframes": { "skin": [{ "value": "Skillicon/BoosterShoot1_00240.png", "tweenMethod": "linearNone", "tween": false, "target": 386, "key": "skin", "index": 0 }, { "value": "Skillicon/BoosterShoot1_00241.png", "tweenMethod": "linearNone", "tween": false, "target": 386, "key": "skin", "index": 1 }, { "value": "Skillicon/BoosterShoot1_00242.png", "tweenMethod": "linearNone", "tween": false, "target": 386, "key": "skin", "index": 2 }, { "value": "Skillicon/BoosterShoot1_00243.png", "tweenMethod": "linearNone", "tween": false, "target": 386, "key": "skin", "index": 3 }, { "value": "Skillicon/BoosterShoot1_00244.png", "tweenMethod": "linearNone", "tween": false, "target": 386, "key": "skin", "index": 4 }, { "value": "Skillicon/BoosterShoot1_00245.png", "tweenMethod": "linearNone", "tween": false, "target": 386, "key": "skin", "index": 5 }, { "value": "Skillicon/BoosterShoot1_00246.png", "tweenMethod": "linearNone", "tween": false, "target": 386, "key": "skin", "index": 6 }, { "value": "Skillicon/BoosterShoot1_00247.png", "tweenMethod": "linearNone", "tween": false, "target": 386, "key": "skin", "index": 7 }, { "value": "Skillicon/BoosterShoot1_00248.png", "tweenMethod": "linearNone", "tween": false, "target": 386, "key": "skin", "index": 8 }, { "value": "Skillicon/BoosterShoot1_00249.png", "tweenMethod": "linearNone", "tween": false, "target": 386, "key": "skin", "index": 9 }, { "value": "Skillicon/BoosterShoot1_00250.png", "tweenMethod": "linearNone", "tween": false, "target": 386, "key": "skin", "index": 10 }, { "value": "Skillicon/BoosterShoot1_00251.png", "tweenMethod": "linearNone", "tween": false, "target": 386, "key": "skin", "index": 11 }, { "value": "Skillicon/BoosterShoot1_00252.png", "tweenMethod": "linearNone", "tween": false, "target": 386, "key": "skin", "index": 12 }, { "value": "Skillicon/BoosterShoot1_00253.png", "tweenMethod": "linearNone", "tween": false, "target": 386, "key": "skin", "index": 13 }, { "value": "Skillicon/BoosterShoot1_00254.png", "tweenMethod": "linearNone", "tween": false, "target": 386, "key": "skin", "index": 14 }, { "value": "Skillicon/BoosterShoot1_00255.png", "tweenMethod": "linearNone", "tween": false, "target": 386, "key": "skin", "index": 15 }, { "value": "Skillicon/BoosterShoot1_00256.png", "tweenMethod": "linearNone", "tween": false, "target": 386, "key": "skin", "index": 16 }] } }], "name": "ani4", "id": 4, "frameRate": 24, "action": 0 }, { "nodes": [{ "target": 388, "keyframes": { "skin": [{ "value": "Skillicon/BoosterHammer1_00238.png", "tweenMethod": "linearNone", "tween": false, "target": 388, "key": "skin", "index": 0 }, { "value": "Skillicon/BoosterHammer1_00239.png", "tweenMethod": "linearNone", "tween": false, "target": 388, "key": "skin", "index": 1 }, { "value": "Skillicon/BoosterHammer1_00240.png", "tweenMethod": "linearNone", "tween": false, "target": 388, "key": "skin", "index": 2 }, { "value": "Skillicon/BoosterHammer1_00241.png", "tweenMethod": "linearNone", "tween": false, "target": 388, "key": "skin", "index": 3 }, { "value": "Skillicon/BoosterHammer1_00242.png", "tweenMethod": "linearNone", "tween": false, "target": 388, "key": "skin", "index": 4 }, { "value": "Skillicon/BoosterHammer1_00243.png", "tweenMethod": "linearNone", "tween": false, "target": 388, "key": "skin", "index": 5 }, { "value": "Skillicon/BoosterHammer1_00244.png", "tweenMethod": "linearNone", "tween": false, "target": 388, "key": "skin", "index": 6 }, { "value": "Skillicon/BoosterHammer1_00245.png", "tweenMethod": "linearNone", "tween": false, "target": 388, "key": "skin", "index": 7 }, { "value": "Skillicon/BoosterHammer1_00246.png", "tweenMethod": "linearNone", "tween": false, "target": 388, "key": "skin", "index": 8 }, { "value": "Skillicon/BoosterHammer1_00247.png", "tweenMethod": "linearNone", "tween": false, "target": 388, "key": "skin", "index": 9 }, { "value": "Skillicon/BoosterHammer1_00248.png", "tweenMethod": "linearNone", "tween": false, "target": 388, "key": "skin", "index": 10 }, { "value": "Skillicon/BoosterHammer1_00249.png", "tweenMethod": "linearNone", "tween": false, "target": 388, "key": "skin", "index": 11 }, { "value": "Skillicon/BoosterHammer1_00250.png", "tweenMethod": "linearNone", "tween": false, "target": 388, "key": "skin", "index": 12 }, { "value": "Skillicon/BoosterHammer1_00251.png", "tweenMethod": "linearNone", "tween": false, "target": 388, "key": "skin", "index": 13 }, { "value": "Skillicon/BoosterHammer1_00252.png", "tweenMethod": "linearNone", "tween": false, "target": 388, "key": "skin", "index": 14 }, { "value": "Skillicon/BoosterHammer1_00253.png", "tweenMethod": "linearNone", "tween": false, "target": 388, "key": "skin", "index": 15 }, { "value": "Skillicon/BoosterHammer1_00254.png", "tweenMethod": "linearNone", "tween": false, "target": 388, "key": "skin", "index": 16 }] } }], "name": "ani5", "id": 5, "frameRate": 24, "action": 0 }, { "nodes": [{ "target": 734, "keyframes": { "scaleY": [{ "value": 1, "tweenMethod": "linearNone", "tween": true, "target": 734, "key": "scaleY", "index": 0 }, { "value": 0.95, "tweenMethod": "linearNone", "tween": true, "target": 734, "key": "scaleY", "index": 5 }, { "value": 0.9, "tweenMethod": "linearNone", "tween": true, "target": 734, "key": "scaleY", "index": 10 }, { "value": 0.95, "tweenMethod": "linearNone", "tween": true, "target": 734, "key": "scaleY", "index": 15 }, { "value": 1, "tweenMethod": "linearNone", "tween": true, "target": 734, "key": "scaleY", "index": 20 }, { "value": 0.95, "tweenMethod": "linearNone", "tween": true, "target": 734, "key": "scaleY", "index": 25 }, { "value": 0.9, "tweenMethod": "linearNone", "tween": true, "target": 734, "key": "scaleY", "index": 30 }, { "value": 0.95, "tweenMethod": "linearNone", "tween": true, "target": 734, "key": "scaleY", "index": 35 }, { "value": 1, "tweenMethod": "linearNone", "tween": true, "target": 734, "key": "scaleY", "index": 40 }], "scaleX": [{ "value": 1, "tweenMethod": "linearNone", "tween": true, "target": 734, "key": "scaleX", "index": 0 }, { "value": 0.95, "tweenMethod": "linearNone", "tween": true, "target": 734, "key": "scaleX", "index": 5 }, { "value": 0.9, "tweenMethod": "linearNone", "tween": true, "target": 734, "key": "scaleX", "index": 10 }, { "value": 0.95, "tweenMethod": "linearNone", "tween": true, "target": 734, "key": "scaleX", "index": 15 }, { "value": 1, "tweenMethod": "linearNone", "tween": true, "target": 734, "key": "scaleX", "index": 20 }, { "value": 0.95, "tweenMethod": "linearNone", "tween": true, "target": 734, "key": "scaleX", "index": 25 }, { "value": 0.9, "tweenMethod": "linearNone", "tween": true, "target": 734, "key": "scaleX", "index": 30 }, { "value": 0.95, "tweenMethod": "linearNone", "tween": true, "target": 734, "key": "scaleX", "index": 35 }, { "value": 1, "tweenMethod": "linearNone", "tween": true, "target": 734, "key": "scaleX", "index": 40 }] } }], "name": "guide", "id": 6, "frameRate": 24, "action": 0 }], "loadList": ["InGameView/colliderbottom.png", "InGameView/0.png", "InGameView/1.png", "InGameView/groundplane.png", "InGameView/borderbottom.png", "InGameView/border2.png", "InGameView/blast-35.png", "Skillicon/BoosterArrow1_00239.png", "InGameView/blast-45.png", "Skillicon/BoosterExplode1_00239.png", "Skillicon/BoosterFire1_00239.png", "Skillicon/BoosterShoot1_00240.png", "Skillicon/BoosterHammer1_00238.png", "InGameView/jindutiao-1-2.png", "InGameView/jindutiao-1-3.png", "Ball/43.png", "InGameView/youxinei-1-2.png", "InGameView/youxinei-1-5.png", "InGameView/youxinei-1-1.png", "InGameView/yindao.png", "InGameView/zhujiemian-1-9.png", "Skillicon/BoosterArrow1_00240.png", "Skillicon/BoosterArrow1_00241.png", "Skillicon/BoosterArrow1_00242.png", "Skillicon/BoosterArrow1_00243.png", "Skillicon/BoosterArrow1_00244.png", "Skillicon/BoosterArrow1_00245.png", "Skillicon/BoosterArrow1_00246.png", "Skillicon/BoosterArrow1_00247.png", "Skillicon/BoosterArrow1_00248.png", "Skillicon/BoosterArrow1_00249.png", "Skillicon/BoosterArrow1_00250.png", "Skillicon/BoosterArrow1_00251.png", "Skillicon/BoosterArrow1_00252.png", "Skillicon/BoosterArrow1_00253.png", "Skillicon/BoosterArrow1_00254.png", "Skillicon/BoosterArrow1_00255.png", "Skillicon/BoosterExplode1_00240.png", "Skillicon/BoosterExplode1_00241.png", "Skillicon/BoosterExplode1_00242.png", "Skillicon/BoosterExplode1_00243.png", "Skillicon/BoosterExplode1_00244.png", "Skillicon/BoosterExplode1_00245.png", "Skillicon/BoosterExplode1_00246.png", "Skillicon/BoosterExplode1_00247.png", "Skillicon/BoosterExplode1_00248.png", "Skillicon/BoosterExplode1_00249.png", "Skillicon/BoosterExplode1_00250.png", "Skillicon/BoosterExplode1_00251.png", "Skillicon/BoosterExplode1_00252.png", "Skillicon/BoosterExplode1_00253.png", "Skillicon/BoosterExplode1_00254.png", "Skillicon/BoosterExplode1_00255.png", "Skillicon/BoosterFire1_00240.png", "Skillicon/BoosterFire1_00241.png", "Skillicon/BoosterFire1_00242.png", "Skillicon/BoosterFire1_00243.png", "Skillicon/BoosterFire1_00244.png", "Skillicon/BoosterFire1_00245.png", "Skillicon/BoosterFire1_00246.png", "Skillicon/BoosterFire1_00247.png", "Skillicon/BoosterFire1_00248.png", "Skillicon/BoosterFire1_00249.png", "Skillicon/BoosterFire1_00250.png", "Skillicon/BoosterFire1_00251.png", "Skillicon/BoosterFire1_00252.png", "Skillicon/BoosterFire1_00253.png", "Skillicon/BoosterFire1_00254.png", "Skillicon/BoosterFire1_00255.png", "Skillicon/BoosterShoot1_00241.png", "Skillicon/BoosterShoot1_00242.png", "Skillicon/BoosterShoot1_00243.png", "Skillicon/BoosterShoot1_00244.png", "Skillicon/BoosterShoot1_00245.png", "Skillicon/BoosterShoot1_00246.png", "Skillicon/BoosterShoot1_00247.png", "Skillicon/BoosterShoot1_00248.png", "Skillicon/BoosterShoot1_00249.png", "Skillicon/BoosterShoot1_00250.png", "Skillicon/BoosterShoot1_00251.png", "Skillicon/BoosterShoot1_00252.png", "Skillicon/BoosterShoot1_00253.png", "Skillicon/BoosterShoot1_00254.png", "Skillicon/BoosterShoot1_00255.png", "Skillicon/BoosterShoot1_00256.png", "Skillicon/BoosterHammer1_00239.png", "Skillicon/BoosterHammer1_00240.png", "Skillicon/BoosterHammer1_00241.png", "Skillicon/BoosterHammer1_00242.png", "Skillicon/BoosterHammer1_00243.png", "Skillicon/BoosterHammer1_00244.png", "Skillicon/BoosterHammer1_00245.png", "Skillicon/BoosterHammer1_00246.png", "Skillicon/BoosterHammer1_00247.png", "Skillicon/BoosterHammer1_00248.png", "Skillicon/BoosterHammer1_00249.png", "Skillicon/BoosterHammer1_00250.png", "Skillicon/BoosterHammer1_00251.png", "Skillicon/BoosterHammer1_00252.png", "Skillicon/BoosterHammer1_00253.png", "Skillicon/BoosterHammer1_00254.png"], "loadList3D": [] };
  896. ui.InGameSceneUI = InGameSceneUI;
  897. REG("ui.InGameSceneUI", InGameSceneUI);
  898. class LotteryViewUI extends Laya.View {
  899. constructor() { super(); }
  900. createChildren() {
  901. super.createChildren();
  902. this.createView(LotteryViewUI.uiView);
  903. }
  904. }
  905. LotteryViewUI.uiView = { "type": "View", "props": { "width": 720, "height": 1280 }, "compId": 2, "child": [{ "type": "Image", "props": { "y": 460, "x": 337, "var": "dial", "skin": "LotteryView/choujiang-1-1.png", "anchorY": 0.5, "anchorX": 0.5 }, "compId": 4, "child": [{ "type": "Box", "props": { "y": 171, "x": 344, "width": 93, "rotation": 0, "pivotY": 46, "pivotX": 47, "height": 91 }, "compId": 8, "child": [{ "type": "Image", "props": { "y": 46, "x": 47, "width": 87, "skin": "LotteryView/func1.png", "rotation": 221, "pivotY": 43, "pivotX": 44, "height": 86 }, "compId": 9 }, { "type": "Text", "props": { "y": 2, "x": 91, "width": 68, "valign": "middle", "text": "X1", "rotation": 225, "pivotY": 13, "pivotX": 34, "height": 25, "fontSize": 20, "color": "#ffffff", "align": "center", "runtime": "laya.display.Text" }, "compId": 10 }] }, { "type": "Box", "props": { "y": 277, "x": 403, "width": 93, "rotation": 12, "pivotY": 46, "pivotX": 47, "height": 91 }, "compId": 14, "child": [{ "type": "Image", "props": { "y": 46, "x": 47, "width": 87, "skin": "LotteryView/func4.png", "rotation": 253, "pivotY": 43, "pivotX": 44, "height": 86 }, "compId": 15 }, { "type": "Text", "props": { "y": 33, "x": 110, "width": 68, "valign": "middle", "text": "X2", "rotation": 254, "pivotY": 13, "pivotX": 34, "height": 25, "fontSize": 20, "color": "#ffffff", "align": "center", "runtime": "laya.display.Text" }, "compId": 16 }] }, { "type": "Box", "props": { "y": 395, "x": 345, "width": 93, "rotation": 60, "pivotY": 46, "pivotX": 47, "height": 91 }, "compId": 17, "child": [{ "type": "Image", "props": { "y": 46, "x": 47, "width": 87, "skin": "LotteryView/func5.png", "rotation": -86, "pivotY": 43, "pivotX": 44, "height": 86 }, "compId": 18 }, { "type": "Text", "props": { "y": 45.5, "x": 109, "width": 68, "valign": "middle", "text": "X1", "rotation": -91, "pivotY": 13, "pivotX": 34, "height": 25, "fontSize": 20, "color": "#ffffff", "align": "center", "runtime": "laya.display.Text" }, "compId": 19 }] }, { "type": "Box", "props": { "y": 395, "x": 207, "width": 93, "rotation": 120, "pivotY": 46, "pivotX": 47, "height": 91 }, "compId": 20, "child": [{ "type": "Image", "props": { "y": 46, "x": 47, "width": 87, "skin": "LotteryView/func5.png", "rotation": -87, "pivotY": 43, "pivotX": 44, "height": 86 }, "compId": 21 }, { "type": "Text", "props": { "y": 45.5, "x": 109, "width": 68, "valign": "middle", "text": "X2", "rotation": -91, "pivotY": 13, "pivotX": 34, "height": 25, "fontSize": 20, "color": "#ffffff", "align": "center", "runtime": "laya.display.Text" }, "compId": 22 }] }, { "type": "Box", "props": { "y": 277, "x": 139, "width": 93, "rotation": 180, "pivotY": 46, "pivotX": 47, "height": 91 }, "compId": 23, "child": [{ "type": "Image", "props": { "y": 46, "x": 47, "width": 87, "skin": "LotteryView/func1.png", "rotation": -83, "pivotY": 43, "pivotX": 44, "height": 86 }, "compId": 24 }, { "type": "Text", "props": { "y": 45.5, "x": 109, "width": 68, "valign": "middle", "text": "X2", "rotation": -91, "pivotY": 13, "pivotX": 34, "height": 25, "fontSize": 20, "color": "#ffffff", "align": "center", "runtime": "laya.display.Text" }, "compId": 25 }] }, { "type": "Box", "props": { "y": 162, "x": 207, "width": 93, "rotation": 236, "pivotY": 46, "pivotX": 47, "height": 91 }, "compId": 26, "child": [{ "type": "Image", "props": { "y": 46, "x": 47, "width": 87, "skin": "LotteryView/func2.png", "rotation": 90, "pivotY": 43, "pivotX": 44, "height": 86 }, "compId": 27 }, { "type": "Text", "props": { "y": 45.5, "x": 109, "width": 68, "valign": "middle", "text": "X1", "rotation": -91, "pivotY": 13, "pivotX": 34, "height": 25, "fontSize": 20, "color": "#ffffff", "align": "center", "runtime": "laya.display.Text" }, "compId": 28 }] }] }, { "type": "Button", "props": { "y": 227, "x": 614, "var": "CloseBtn", "stateNum": 1, "skin": "LotteryView/choujiang-1-4.png" }, "compId": 5 }, { "type": "Image", "props": { "y": 437, "x": 337, "width": 87, "skin": "LotteryView/choujiang-1-2.png", "pivotY": 77, "pivotX": 44, "name": "Pointer", "height": 153 }, "compId": 6 }, { "type": "Button", "props": { "y": 931, "x": 360, "width": 298, "var": "LotteryBtn", "stateNum": 1, "skin": "LotteryView/choujiang-1-3.png", "pivotY": 53, "pivotX": 149, "height": 106 }, "compId": 7 }], "loadList": ["LotteryView/choujiang-1-1.png", "LotteryView/func1.png", "LotteryView/func4.png", "LotteryView/func5.png", "LotteryView/func2.png", "LotteryView/choujiang-1-4.png", "LotteryView/choujiang-1-2.png", "LotteryView/choujiang-1-3.png"], "loadList3D": [] };
  906. ui.LotteryViewUI = LotteryViewUI;
  907. REG("ui.LotteryViewUI", LotteryViewUI);
  908. class MainSceneUI extends Laya.View {
  909. constructor() { super(); }
  910. createChildren() {
  911. super.createChildren();
  912. this.createView(MainSceneUI.uiView);
  913. }
  914. }
  915. MainSceneUI.uiView = { "type": "View", "props": { "width": 720, "height": 1280 }, "compId": 2, "child": [{ "type": "Image", "props": { "var": "BG", "top": 0, "skin": "MainView/zhujiemian-1-8.png", "sizeGrid": "15,17,13,9", "right": 0, "left": 0, "bottom": 0, "alpha": 1 }, "compId": 13 }, { "type": "Button", "props": { "y": 258, "x": 42, "width": 42, "var": "SetBtn", "stateNum": 1, "skin": "MainView/zhujiemian-1-6.png", "pivotY": 21, "pivotX": 21, "height": 42 }, "compId": 30 }, { "type": "Box", "props": { "x": 97, "width": 555, "height": 173, "bottom": 180 }, "compId": 56, "child": [{ "type": "Button", "props": { "y": 25, "x": 220, "var": "RankBtn", "stateNum": 1, "skin": "MainView/zhujiemian-1-3(1).png" }, "compId": 31 }, { "type": "Button", "props": { "y": 16, "x": 436, "var": "LotteryBtn", "stateNum": 1, "skin": "MainView/zhujiemian-1-4(1).png" }, "compId": 32 }, { "type": "Button", "props": { "y": 16, "x": 19, "var": "SignBtn", "stateNum": 1, "skin": "MainView/zhujiemian-1-2(1).png" }, "compId": 33 }] }, { "type": "Image", "props": { "x": 360, "width": 629, "top": 2, "skin": "MainView/zhujiemian-1-7.png", "pivotY": 468, "pivotX": 315, "height": 936 }, "compId": 60, "child": [{ "type": "Button", "props": { "y": 832.5, "x": 298, "width": 207, "var": "StartBtn", "stateNum": 1, "skin": "MainView/zhujiemian-1-5.png", "pivotY": 104, "pivotX": 104, "height": 207 }, "compId": 9 }] }, { "type": "Image", "props": { "y": 205, "x": 375, "width": 526, "skin": "MainView/logo.png", "pivotY": 153, "pivotX": 263, "height": 305 }, "compId": 57 }], "loadList": ["MainView/zhujiemian-1-8.png", "MainView/zhujiemian-1-6.png", "MainView/zhujiemian-1-3(1).png", "MainView/zhujiemian-1-4(1).png", "MainView/zhujiemian-1-2(1).png", "MainView/zhujiemian-1-7.png", "MainView/zhujiemian-1-5.png", "MainView/logo.png"], "loadList3D": [] };
  916. ui.MainSceneUI = MainSceneUI;
  917. REG("ui.MainSceneUI", MainSceneUI);
  918. class RankViewUI extends Laya.View {
  919. constructor() { super(); }
  920. createChildren() {
  921. super.createChildren();
  922. this.createView(RankViewUI.uiView);
  923. }
  924. }
  925. RankViewUI.uiView = { "type": "View", "props": { "width": 720, "height": 1280 }, "compId": 2, "child": [{ "type": "Image", "props": { "y": 513, "x": 360, "width": 555, "skin": "SetView/shezhi-1-1.png", "sizeGrid": "98,159,125,118", "height": 767, "anchorY": 0.5, "anchorX": 0.5 }, "compId": 5, "child": [{ "type": "Image", "props": { "y": 14, "x": 198, "skin": "RankView/paihang-1-1.png" }, "compId": 6 }] }, { "type": "Button", "props": { "y": 139, "x": 573, "var": "CloseBtn", "stateNum": 1, "skin": "SetView/shezhi-1-3.png" }, "compId": 7 }, { "type": "Box", "props": { "y": 231, "x": 118, "width": 495, "height": 623 }, "compId": 9, "child": [{ "type": "Image", "props": { "y": 6, "x": 12, "width": 459, "skin": "RankView/paihang-1-2.png", "sizeGrid": "22,39,25,23", "height": 65 }, "compId": 8 }, { "type": "Image", "props": { "y": 84, "x": 12, "width": 459, "skin": "RankView/paihang-1-2.png", "sizeGrid": "22,39,25,23", "height": 65 }, "compId": 11 }, { "type": "Image", "props": { "y": 163, "x": 12, "width": 459, "skin": "RankView/paihang-1-2.png", "sizeGrid": "22,39,25,23", "height": 65 }, "compId": 12 }, { "type": "Image", "props": { "y": 246.5, "x": 12, "width": 459, "skin": "RankView/paihang-1-2.png", "sizeGrid": "22,39,25,23", "height": 65 }, "compId": 13 }, { "type": "Image", "props": { "y": 328, "x": 12, "width": 459, "skin": "RankView/paihang-1-2.png", "sizeGrid": "22,39,25,23", "height": 65 }, "compId": 14 }, { "type": "Image", "props": { "y": 407, "x": 12, "width": 459, "skin": "RankView/paihang-1-2.png", "sizeGrid": "22,39,25,23", "height": 65 }, "compId": 15 }, { "type": "Image", "props": { "y": 551, "x": 2, "width": 487, "skin": "RankView/paihang-1-7.png", "sizeGrid": "25,31,28,24", "height": 70 }, "compId": 16 }] }, { "type": "Button", "props": { "y": 733, "x": 194, "var": "UpPageBtn", "stateNum": 1, "skin": "RankView/paihang-1-6.png" }, "compId": 17 }, { "type": "Button", "props": { "y": 744, "x": 476, "width": 69, "var": "DownPageBtn", "stateNum": 1, "skin": "RankView/paihang-1-6.png", "rotation": 180, "pivotY": 16, "pivotX": 35, "height": 31 }, "compId": 18 }], "loadList": ["SetView/shezhi-1-1.png", "RankView/paihang-1-1.png", "SetView/shezhi-1-3.png", "RankView/paihang-1-2.png", "RankView/paihang-1-7.png", "RankView/paihang-1-6.png"], "loadList3D": [] };
  926. ui.RankViewUI = RankViewUI;
  927. REG("ui.RankViewUI", RankViewUI);
  928. class ReviveViewUI extends Laya.Scene {
  929. constructor() { super(); }
  930. createChildren() {
  931. super.createChildren();
  932. this.createView(ReviveViewUI.uiView);
  933. }
  934. }
  935. ReviveViewUI.uiView = { "type": "Scene", "props": { "width": 720, "height": 1280 }, "compId": 2, "child": [{ "type": "Image", "props": { "y": 0, "x": 0, "var": "BG", "top": 0, "skin": "WinView/black.png", "sizeGrid": "10,12,13,13", "right": 0, "left": 0, "bottom": 0 }, "compId": 10 }, { "type": "Image", "props": { "y": 17, "x": 0, "skin": "ReviveView/fuhuo-1-1.png" }, "compId": 4, "child": [{ "type": "Image", "props": { "y": 250, "x": 285, "skin": "ReviveView/fuhuo-1-2.png" }, "compId": 5 }] }, { "type": "Image", "props": { "y": 449, "x": 370, "width": 147, "skin": "ReviveView/fuhuo-1-4.png", "pivotY": 74, "pivotX": 74, "height": 147 }, "compId": 6, "child": [{ "type": "Text", "props": { "y": 70, "x": 74, "width": 103, "var": "Time", "valign": "middle", "text": "9", "pivotY": 58, "pivotX": 52, "height": 117, "fontSize": 125, "color": "#f05929", "align": "center", "runtime": "laya.display.Text" }, "compId": 7 }] }, { "type": "Button", "props": { "y": 760, "x": 304.5, "var": "NoBtn", "stateNum": 1, "skin": "ReviveView/fuhuo-1-5.png" }, "compId": 8 }, { "type": "Button", "props": { "y": 583, "x": 304.5, "var": "VideoBtn", "stateNum": 1, "skin": "ReviveView/fuhuo-1-3.png" }, "compId": 9 }], "loadList": ["WinView/black.png", "ReviveView/fuhuo-1-1.png", "ReviveView/fuhuo-1-2.png", "ReviveView/fuhuo-1-4.png", "ReviveView/fuhuo-1-5.png", "ReviveView/fuhuo-1-3.png"], "loadList3D": [] };
  936. ui.ReviveViewUI = ReviveViewUI;
  937. REG("ui.ReviveViewUI", ReviveViewUI);
  938. class SetViewUI extends Laya.View {
  939. constructor() { super(); }
  940. createChildren() {
  941. super.createChildren();
  942. this.createView(SetViewUI.uiView);
  943. }
  944. }
  945. SetViewUI.uiView = { "type": "View", "props": { "width": 720, "height": 1280 }, "compId": 2, "child": [{ "type": "Image", "props": { "y": 380, "x": 360, "width": 550, "skin": "SetView/shezhi-1-1.png", "pivotY": 178, "pivotX": 275, "height": 355, "alpha": 1, "sizeGrid": "98,159,125,118" }, "compId": 4, "child": [{ "type": "Image", "props": { "y": 17, "x": 225, "skin": "SetView/shezhi-1-2.png" }, "compId": 5 }] }, { "type": "Button", "props": { "y": 226, "x": 574, "var": "CloseBtn", "stateNum": 1, "skin": "SetView/shezhi-1-3.png" }, "compId": 6 }, { "type": "Sprite", "props": { "y": 335, "x": 191, "texture": "SetView/shezhi-1-4.png", "name": "SoundSprite" }, "compId": 7 }, { "type": "Sprite", "props": { "y": 431, "x": 193, "texture": "SetView/shezhi-1-5.png", "name": "ShakeSprite" }, "compId": 8 }, { "type": "Box", "props": { "y": 325, "x": 427, "width": 100, "var": "Sound", "height": 51 }, "compId": 9, "child": [{ "type": "Image", "props": { "y": 21, "x": 0, "skin": "SetView/shezhi-1-6.png" }, "compId": 10 }, { "type": "Image", "props": { "y": 26, "x": 70, "width": 51, "skin": "SetView/shezhi-1-8.png", "pivotY": 26, "pivotX": 26, "name": "open", "height": 51 }, "compId": 11 }, { "type": "Image", "props": { "y": 26, "x": 32, "width": 51, "skin": "SetView/shezhi-1-9.png", "pivotY": 26, "pivotX": 26, "name": "close", "height": 51 }, "compId": 12 }, { "type": "Button", "props": { "y": 26, "x": 50, "width": 100, "pivotY": 26, "pivotX": 50, "name": "btn", "height": 51 }, "compId": 17 }] }, { "type": "Box", "props": { "y": 423, "x": 427, "width": 100, "var": "Shake", "height": 54 }, "compId": 13, "child": [{ "type": "Image", "props": { "y": 23, "x": 0, "skin": "SetView/shezhi-1-7.png" }, "compId": 14 }, { "type": "Image", "props": { "y": 28, "x": 70, "width": 51, "skin": "SetView/shezhi-1-8.png", "pivotY": 26, "pivotX": 26, "name": "open", "height": 51 }, "compId": 15 }, { "type": "Image", "props": { "y": 28, "x": 32, "width": 51, "skin": "SetView/shezhi-1-9.png", "pivotY": 26, "pivotX": 26, "name": "close", "height": 51 }, "compId": 16 }, { "type": "Button", "props": { "y": 28, "x": 50, "width": 100, "pivotY": 26, "pivotX": 50, "name": "btn", "height": 51 }, "compId": 18 }] }, { "type": "Text", "props": { "y": 515, "x": 285, "width": 128, "valign": "middle", "text": "UserID:", "pivotY": 26, "pivotX": 64, "height": 52, "fontSize": 30, "align": "center", "runtime": "laya.display.Text" }, "compId": 19 }, { "type": "Text", "props": { "y": 493, "x": 360, "width": 189, "var": "userid", "valign": "middle", "height": 45, "fontSize": 30, "align": "left", "runtime": "laya.display.Text" }, "compId": 20 }], "loadList": ["SetView/shezhi-1-1.png", "SetView/shezhi-1-2.png", "SetView/shezhi-1-3.png", "SetView/shezhi-1-4.png", "SetView/shezhi-1-5.png", "SetView/shezhi-1-6.png", "SetView/shezhi-1-8.png", "SetView/shezhi-1-9.png", "SetView/shezhi-1-7.png"], "loadList3D": [] };
  946. ui.SetViewUI = SetViewUI;
  947. REG("ui.SetViewUI", SetViewUI);
  948. class SignViewUI extends Laya.Scene {
  949. constructor() { super(); }
  950. createChildren() {
  951. super.createChildren();
  952. this.createView(SignViewUI.uiView);
  953. }
  954. }
  955. SignViewUI.uiView = { "type": "Scene", "props": { "width": 720, "height": 1280 }, "compId": 2, "child": [{ "type": "Image", "props": { "y": 581, "x": 360, "width": 555, "skin": "SetView/shezhi-1-1.png", "sizeGrid": "98,159,125,118", "height": 871, "anchorY": 0.5, "anchorX": 0.5 }, "compId": 3, "child": [{ "type": "Image", "props": { "y": 13, "x": 225, "skin": "SignView/qiandao-1-1.png" }, "compId": 4 }, { "type": "Box", "props": { "y": 109, "x": 27, "width": 497, "var": "ItemList", "height": 572 }, "compId": 5, "child": [{ "type": "Box", "props": { "y": 3, "x": 0, "width": 150, "height": 188 }, "compId": 6, "child": [{ "type": "Image", "props": { "y": 32, "x": 0, "width": 147, "skin": "SignView/qiandao-1-3.png", "sizeGrid": "9,45,22,34", "height": 157 }, "compId": 7, "child": [{ "type": "Image", "props": { "y": -32, "x": 0, "width": 147, "skin": "SignView/qiandao-1-2.png", "height": 46 }, "compId": 8 }, { "type": "Image", "props": { "y": -23, "x": 39, "skin": "SignView/qiandao-1-4.png" }, "compId": 9 }, { "type": "Text", "props": { "y": -23, "x": 66.548095703125, "text": "1", "fontSize": 25, "color": "#ffffff", "runtime": "laya.display.Text" }, "compId": 10 }] }, { "type": "Button", "props": { "y": 114, "x": 74, "width": 147, "pivotY": 73, "pivotX": 74, "name": "btn", "height": 145 }, "compId": 11 }, { "type": "Image", "props": { "y": 94, "x": 74, "width": 100, "pivotY": 50, "pivotX": 50, "name": "icon", "height": 100 }, "compId": 12, "child": [{ "type": "Text", "props": { "y": 119, "x": 50, "width": 99, "valign": "middle", "text": "X3", "pivotY": 16, "pivotX": 50, "name": "num", "height": 31, "fontSize": 25, "align": "center", "runtime": "laya.display.Text" }, "compId": 13 }] }, { "type": "Image", "props": { "y": 0, "x": 0, "width": 148, "visible": false, "skin": "SignView/qiandao-1-7(1).png", "name": "complete", "height": 186 }, "compId": 14, "child": [{ "type": "Image", "props": { "y": 93, "x": 74, "width": 51, "skin": "SignView/qiandao-1-8.png", "pivotY": 26, "pivotX": 26, "height": 51 }, "compId": 15 }] }] }, { "type": "Box", "props": { "y": 3, "x": 173.5, "width": 150, "height": 188 }, "compId": 16, "child": [{ "type": "Image", "props": { "y": 32, "x": 0, "width": 147, "skin": "SignView/qiandao-1-3.png", "sizeGrid": "9,45,22,34", "height": 157 }, "compId": 17, "child": [{ "type": "Image", "props": { "y": -32, "x": 0, "width": 147, "skin": "SignView/qiandao-1-2.png", "height": 46 }, "compId": 18 }, { "type": "Image", "props": { "y": -23, "x": 39, "skin": "SignView/qiandao-1-4.png" }, "compId": 19 }, { "type": "Text", "props": { "y": -23, "x": 66.548095703125, "text": "2", "fontSize": 25, "color": "#ffffff", "runtime": "laya.display.Text" }, "compId": 20 }] }, { "type": "Button", "props": { "y": 114, "x": 74, "width": 147, "pivotY": 73, "pivotX": 74, "name": "btn", "height": 145 }, "compId": 21 }, { "type": "Image", "props": { "y": 94, "x": 74, "width": 100, "pivotY": 50, "pivotX": 50, "name": "icon", "height": 100 }, "compId": 22, "child": [{ "type": "Text", "props": { "y": 119, "x": 50, "width": 99, "valign": "middle", "text": "X3", "pivotY": 16, "pivotX": 50, "name": "num", "height": 31, "fontSize": 25, "align": "center", "runtime": "laya.display.Text" }, "compId": 23 }] }, { "type": "Image", "props": { "y": 0, "x": 0, "width": 148, "visible": false, "skin": "SignView/qiandao-1-7(1).png", "name": "complete", "height": 186 }, "compId": 24, "child": [{ "type": "Image", "props": { "y": 93, "x": 74, "width": 51, "skin": "SignView/qiandao-1-8.png", "pivotY": 26, "pivotX": 26, "height": 51 }, "compId": 25 }] }] }, { "type": "Box", "props": { "y": 3, "x": 347, "width": 150, "height": 188 }, "compId": 26, "child": [{ "type": "Image", "props": { "y": 32, "x": 0, "width": 147, "skin": "SignView/qiandao-1-3.png", "sizeGrid": "9,45,22,34", "height": 157 }, "compId": 27, "child": [{ "type": "Image", "props": { "y": -32, "x": 0, "width": 147, "skin": "SignView/qiandao-1-2.png", "height": 46 }, "compId": 28 }, { "type": "Image", "props": { "y": -23, "x": 39, "skin": "SignView/qiandao-1-4.png" }, "compId": 29 }, { "type": "Text", "props": { "y": -23, "x": 66.548095703125, "text": "3", "fontSize": 25, "color": "#ffffff", "runtime": "laya.display.Text" }, "compId": 30 }] }, { "type": "Button", "props": { "y": 114, "x": 74, "width": 147, "pivotY": 73, "pivotX": 74, "name": "btn", "height": 145 }, "compId": 31 }, { "type": "Image", "props": { "y": 94, "x": 74, "width": 100, "pivotY": 50, "pivotX": 50, "name": "icon", "height": 100 }, "compId": 32, "child": [{ "type": "Text", "props": { "y": 119, "x": 50, "width": 99, "valign": "middle", "text": "X3", "pivotY": 16, "pivotX": 50, "name": "num", "height": 31, "fontSize": 25, "align": "center", "runtime": "laya.display.Text" }, "compId": 33 }] }, { "type": "Image", "props": { "y": 0, "x": 0, "width": 148, "visible": false, "skin": "SignView/qiandao-1-7(1).png", "name": "complete", "height": 186 }, "compId": 34, "child": [{ "type": "Image", "props": { "y": 93, "x": 74, "width": 51, "skin": "SignView/qiandao-1-8.png", "pivotY": 26, "pivotX": 26, "height": 51 }, "compId": 35 }] }] }, { "type": "Box", "props": { "y": 217, "x": 0, "width": 150, "height": 188 }, "compId": 36, "child": [{ "type": "Image", "props": { "y": 32, "x": 0, "width": 147, "skin": "SignView/qiandao-1-3.png", "sizeGrid": "9,45,22,34", "height": 157 }, "compId": 37, "child": [{ "type": "Image", "props": { "y": -32, "x": 0, "width": 147, "skin": "SignView/qiandao-1-2.png", "height": 46 }, "compId": 38 }, { "type": "Image", "props": { "y": -23, "x": 39, "skin": "SignView/qiandao-1-4.png" }, "compId": 39 }, { "type": "Text", "props": { "y": -23, "x": 66.548095703125, "text": "4", "fontSize": 25, "color": "#ffffff", "runtime": "laya.display.Text" }, "compId": 40 }] }, { "type": "Button", "props": { "y": 114, "x": 74, "width": 147, "pivotY": 73, "pivotX": 74, "name": "btn", "height": 145 }, "compId": 41 }, { "type": "Image", "props": { "y": 94, "x": 74, "width": 100, "pivotY": 50, "pivotX": 50, "name": "icon", "height": 100 }, "compId": 42, "child": [{ "type": "Text", "props": { "y": 119, "x": 50, "width": 99, "valign": "middle", "text": "X3", "pivotY": 16, "pivotX": 50, "name": "num", "height": 31, "fontSize": 25, "align": "center", "runtime": "laya.display.Text" }, "compId": 43 }] }, { "type": "Image", "props": { "y": 0, "x": 0, "width": 148, "visible": false, "skin": "SignView/qiandao-1-7(1).png", "name": "complete", "height": 186 }, "compId": 44, "child": [{ "type": "Image", "props": { "y": 93, "x": 74, "width": 51, "skin": "SignView/qiandao-1-8.png", "pivotY": 26, "pivotX": 26, "height": 51 }, "compId": 45 }] }] }, { "type": "Box", "props": { "y": 217, "x": 173.5, "width": 150, "height": 188 }, "compId": 46, "child": [{ "type": "Image", "props": { "y": 32, "x": 0, "width": 147, "skin": "SignView/qiandao-1-3.png", "sizeGrid": "9,45,22,34", "height": 157 }, "compId": 47, "child": [{ "type": "Image", "props": { "y": -32, "x": 0, "width": 147, "skin": "SignView/qiandao-1-2.png", "height": 46 }, "compId": 48 }, { "type": "Image", "props": { "y": -23, "x": 39, "skin": "SignView/qiandao-1-4.png" }, "compId": 49 }, { "type": "Text", "props": { "y": -23, "x": 66.548095703125, "text": "5", "fontSize": 25, "color": "#ffffff", "runtime": "laya.display.Text" }, "compId": 50 }] }, { "type": "Button", "props": { "y": 114, "x": 74, "width": 147, "pivotY": 73, "pivotX": 74, "name": "btn", "height": 145 }, "compId": 51 }, { "type": "Image", "props": { "y": 94, "x": 74, "width": 100, "pivotY": 50, "pivotX": 50, "name": "icon", "height": 100 }, "compId": 52, "child": [{ "type": "Text", "props": { "y": 119, "x": 50, "width": 99, "valign": "middle", "text": "X3", "pivotY": 16, "pivotX": 50, "name": "num", "height": 31, "fontSize": 25, "align": "center", "runtime": "laya.display.Text" }, "compId": 53 }] }, { "type": "Image", "props": { "y": 0, "x": 0, "width": 148, "visible": false, "skin": "SignView/qiandao-1-7(1).png", "name": "complete", "height": 186 }, "compId": 54, "child": [{ "type": "Image", "props": { "y": 93, "x": 74, "width": 51, "skin": "SignView/qiandao-1-8.png", "pivotY": 26, "pivotX": 26, "height": 51 }, "compId": 55 }] }] }, { "type": "Box", "props": { "y": 217, "x": 347, "width": 150, "height": 188 }, "compId": 56, "child": [{ "type": "Image", "props": { "y": 32, "x": 0, "width": 147, "skin": "SignView/qiandao-1-3.png", "sizeGrid": "9,45,22,34", "height": 157 }, "compId": 57, "child": [{ "type": "Image", "props": { "y": -32, "x": 0, "width": 147, "skin": "SignView/qiandao-1-2.png", "height": 46 }, "compId": 58 }, { "type": "Image", "props": { "y": -23, "x": 39, "skin": "SignView/qiandao-1-4.png" }, "compId": 59 }, { "type": "Text", "props": { "y": -23, "x": 66.548095703125, "text": "6", "fontSize": 25, "color": "#ffffff", "runtime": "laya.display.Text" }, "compId": 60 }] }, { "type": "Button", "props": { "y": 114, "x": 74, "width": 147, "pivotY": 73, "pivotX": 74, "name": "btn", "height": 145 }, "compId": 61 }, { "type": "Image", "props": { "y": 94, "x": 74, "width": 100, "pivotY": 50, "pivotX": 50, "name": "icon", "height": 100 }, "compId": 62, "child": [{ "type": "Text", "props": { "y": 119, "x": 50, "width": 99, "valign": "middle", "text": "X3", "pivotY": 16, "pivotX": 50, "name": "num", "height": 31, "fontSize": 25, "align": "center", "runtime": "laya.display.Text" }, "compId": 63 }] }, { "type": "Image", "props": { "y": 0, "x": 0, "width": 148, "visible": false, "skin": "SignView/qiandao-1-7(1).png", "name": "complete", "height": 186 }, "compId": 64, "child": [{ "type": "Image", "props": { "y": 93, "x": 74, "width": 51, "skin": "SignView/qiandao-1-8.png", "pivotY": 26, "pivotX": 26, "height": 51 }, "compId": 65 }] }] }, { "type": "Box", "props": { "y": 413, "x": 1, "width": 490, "height": 158 }, "compId": 66, "child": [{ "type": "Image", "props": { "y": 2, "x": 3, "skin": "SignView/qiandao-1-6.png" }, "compId": 67, "child": [{ "type": "Image", "props": { "y": 20, "x": 243.5, "width": 69, "skin": "SignView/qiandao-1-4.png", "pivotY": 14, "pivotX": 35, "height": 28 }, "compId": 68 }, { "type": "Text", "props": { "y": 6, "x": 237, "text": "7", "fontSize": 25, "color": "#ffffff", "runtime": "laya.display.Text" }, "compId": 69 }] }, { "type": "Button", "props": { "y": 43, "x": 4, "width": 485, "name": "btn", "height": 113 }, "compId": 70 }, { "type": "Image", "props": { "y": 79, "x": 245, "width": 71, "pivotY": 32, "pivotX": 34, "name": "icon", "height": 69 }, "compId": 71, "child": [{ "type": "Text", "props": { "y": 86, "x": 34, "width": 99, "valign": "middle", "text": "X3", "pivotY": 16, "pivotX": 50, "name": "num", "height": 31, "fontSize": 25, "align": "center", "runtime": "laya.display.Text" }, "compId": 72 }] }, { "type": "Image", "props": { "y": 0, "x": 2, "width": 489, "visible": false, "skin": "SignView/qiandao-1-7(1).png", "name": "complete", "height": 157 }, "compId": 73, "child": [{ "type": "Image", "props": { "y": 78.5, "x": 244.5, "width": 51, "skin": "SignView/qiandao-1-8.png", "pivotY": 26, "pivotX": 26, "height": 51 }, "compId": 74 }] }] }] }, { "type": "Button", "props": { "y": 17, "x": 490, "var": "CloseBtn", "stateNum": 1, "skin": "SetView/shezhi-1-3.png" }, "compId": 75 }, { "type": "Button", "props": { "y": 765, "x": 278, "width": 298, "var": "SignBtn", "stateNum": 1, "skin": "SignView/qiandao-1-5.png", "pivotY": 53, "pivotX": 149, "height": 106 }, "compId": 76 }] }], "loadList": ["SetView/shezhi-1-1.png", "SignView/qiandao-1-1.png", "SignView/qiandao-1-3.png", "SignView/qiandao-1-2.png", "SignView/qiandao-1-4.png", "SignView/qiandao-1-7(1).png", "SignView/qiandao-1-8.png", "SignView/qiandao-1-6.png", "SetView/shezhi-1-3.png", "SignView/qiandao-1-5.png"], "loadList3D": [] };
  956. ui.SignViewUI = SignViewUI;
  957. REG("ui.SignViewUI", SignViewUI);
  958. class WinViewUI extends Laya.Scene {
  959. constructor() { super(); }
  960. createChildren() {
  961. super.createChildren();
  962. this.createView(WinViewUI.uiView);
  963. }
  964. }
  965. WinViewUI.uiView = { "type": "Scene", "props": { "width": 720, "visible": true, "height": 1280 }, "compId": 2, "child": [{ "type": "Image", "props": { "var": "BG", "top": 0, "skin": "WinView/black.png", "sizeGrid": "12,14,12,12", "right": 0, "left": 0, "bottom": 0 }, "compId": 8 }, { "type": "Image", "props": { "y": 520, "x": 360, "width": 720, "skin": "WinView/guoguan-1-1.png", "pivotY": 510, "pivotX": 360, "height": 994 }, "compId": 4, "child": [{ "type": "Image", "props": { "y": 249, "x": 283, "visible": true, "skin": "WinView/guoguan-1-2.png" }, "compId": 5 }] }, { "type": "Button", "props": { "y": 487, "x": 252, "var": "BackBtn", "stateNum": 1, "skin": "WinView/guoguan-1-3.png" }, "compId": 6 }, { "type": "Button", "props": { "y": 600, "x": 228, "var": "NextBtn", "stateNum": 1, "skin": "WinView/guoguan-1-4.png" }, "compId": 7 }], "loadList": ["WinView/black.png", "WinView/guoguan-1-1.png", "WinView/guoguan-1-2.png", "WinView/guoguan-1-3.png", "WinView/guoguan-1-4.png"], "loadList3D": [] };
  966. ui.WinViewUI = WinViewUI;
  967. REG("ui.WinViewUI", WinViewUI);
  968. })(ui || (ui = {}));
  969. var PropEffecf;
  970. (function (PropEffecf) {
  971. PropEffecf[PropEffecf["NONE"] = 0] = "NONE";
  972. PropEffecf[PropEffecf["DOUBLE"] = 1] = "DOUBLE";
  973. PropEffecf[PropEffecf["HAMMER"] = 2] = "HAMMER";
  974. PropEffecf[PropEffecf["UP"] = 3] = "UP";
  975. PropEffecf[PropEffecf["CLEARLAST"] = 4] = "CLEARLAST";
  976. PropEffecf[PropEffecf["CLEARTWO"] = 5] = "CLEARTWO";
  977. })(PropEffecf || (PropEffecf = {}));
  978. var StageMode;
  979. (function (StageMode) {
  980. StageMode[StageMode["ReStart"] = 0] = "ReStart";
  981. StageMode[StageMode["Start"] = 1] = "Start";
  982. StageMode[StageMode["Lose"] = 2] = "Lose";
  983. StageMode[StageMode["Win"] = 3] = "Win";
  984. StageMode[StageMode["Clone"] = 4] = "Clone";
  985. StageMode[StageMode["Over"] = 5] = "Over";
  986. StageMode[StageMode["Revive"] = 6] = "Revive";
  987. StageMode[StageMode["Refresh"] = 7] = "Refresh";
  988. StageMode[StageMode["Check"] = 8] = "Check";
  989. })(StageMode || (StageMode = {}));
  990. class EventManager {
  991. static EventOn(_mode, caller, fun, args = []) {
  992. EventManager.Instance.on(PropEffecf[_mode], caller, fun, args);
  993. }
  994. static EventOff(_mode, caller, fun, args = []) {
  995. EventManager.Instance.off(PropEffecf[_mode], caller, fun);
  996. }
  997. static EventTrigger(_mode, args = []) {
  998. EventManager.Instance.event(PropEffecf[_mode], args);
  999. EventManager.PropState = _mode;
  1000. }
  1001. static StageOn(_mode, caller, fun, args = []) {
  1002. EventManager.Instance.on(StageMode[_mode], caller, fun, args);
  1003. }
  1004. static StageOff(_mode, caller, fun, args = []) {
  1005. EventManager.Instance.off(StageMode[_mode], caller, fun);
  1006. }
  1007. static StageTrigger(_mode, args = []) {
  1008. EventManager.Instance.event(StageMode[_mode], args);
  1009. }
  1010. }
  1011. EventManager.Instance = new Laya.EventDispatcher();
  1012. EventManager.PropState = PropEffecf.NONE;
  1013. class GameManager {
  1014. constructor() {
  1015. this.ReviveNum = 0;
  1016. this.ScoreProgress = 0;
  1017. this.ScoreRecord2 = 0;
  1018. this.ScoreRecord = 0;
  1019. this.First = true;
  1020. this.Wave = 1;
  1021. this.CheckHeight = true;
  1022. this.played = false;
  1023. this.EliminateNum = 0;
  1024. GameManager.ins = this;
  1025. EventManager.StageOn(StageMode.Refresh, this, this.Fresh);
  1026. }
  1027. static get Instance() {
  1028. if (GameManager.ins) {
  1029. return GameManager.ins;
  1030. }
  1031. else {
  1032. return new GameManager();
  1033. }
  1034. }
  1035. Fresh() {
  1036. this.ScoreProgress = 0;
  1037. }
  1038. }
  1039. class MainView extends ui.MainSceneUI {
  1040. constructor() {
  1041. super();
  1042. this.STAGE = 0;
  1043. }
  1044. static get Instance() {
  1045. if (MainView.ins) {
  1046. return MainView.ins;
  1047. }
  1048. else {
  1049. return new MainView();
  1050. }
  1051. }
  1052. Show() {
  1053. let stage = AccountManager.Instance.curplayerData.GainAccount("stage");
  1054. this.STAGE = Number(stage);
  1055. this.StartBtn.clickHandler = Laya.Handler.create(this, this.ClickStart);
  1056. this.RankBtn.clickHandler = Laya.Handler.create(this, this.ClickRank);
  1057. this.SignBtn.clickHandler = Laya.Handler.create(this, this.ClickSign);
  1058. this.LotteryBtn.clickHandler = Laya.Handler.create(this, this.ClickLottery);
  1059. this.SetBtn.clickHandler = Laya.Handler.create(this, this.ClickSet);
  1060. this.height = Laya.stage.height;
  1061. this.BG.height = Laya.stage.height;
  1062. Laya.stage.on(Laya.Event.RESIZE, this, () => {
  1063. this.height = Laya.stage.height;
  1064. this.BG.height = Laya.stage.height;
  1065. });
  1066. }
  1067. ClickStart() {
  1068. var agrs = [{ "t": AccountManager.Instance.ServerTime.toString() }];
  1069. ServerManager.Instance.SendHttp(BlastToMerge.KaiShi, agrs, Laya.Handler.create(this, this.GameStart), null);
  1070. }
  1071. GameStart(_data) {
  1072. GameManager.Instance.play_id = _data.play_id;
  1073. EventManager.StageTrigger(StageMode.Start);
  1074. }
  1075. ClickRank() {
  1076. ViewManager.Instance.ShowView(ViewType.RankView);
  1077. }
  1078. ClickLottery() {
  1079. ViewManager.Instance.ShowView(ViewType.LotteryView);
  1080. }
  1081. ClickSign() {
  1082. ViewManager.Instance.ShowView(ViewType.SignView);
  1083. }
  1084. ClickSet() {
  1085. ViewManager.Instance.ShowView(ViewType.SetView);
  1086. }
  1087. Close() {
  1088. }
  1089. }
  1090. class faafssfafsa {
  1091. constructor(_message, _pos, _size, _fontSize, _color = null) {
  1092. this.fontSize = 30;
  1093. this.message = "";
  1094. this.size = new Laya.Vector2(_size.x, _size.y);
  1095. this.fontSize = _fontSize;
  1096. this.color = _color;
  1097. this.message = _message;
  1098. this.pos = _pos;
  1099. }
  1100. }
  1101. class GameTools {
  1102. constructor() {
  1103. GameTools.ins = this;
  1104. }
  1105. static get Instance() {
  1106. if (GameTools.ins) {
  1107. return GameTools.ins;
  1108. }
  1109. else {
  1110. return new GameTools();
  1111. }
  1112. }
  1113. lerp(form, to, t) {
  1114. if (t <= 0) {
  1115. return form;
  1116. }
  1117. else if (t >= 1) {
  1118. return to;
  1119. }
  1120. var a = t * to + (1 - t) * form;
  1121. return a;
  1122. }
  1123. SetCollider(setNode, CollisionGroup) {
  1124. var numchild = setNode.numChildren;
  1125. for (var i = 0; i < setNode.numChildren; i++) {
  1126. var numchild2 = setNode.getChildAt(i).numChildren;
  1127. if (numchild2 > 1) {
  1128. this.SetCollider(setNode.getChildAt(i), CollisionGroup);
  1129. }
  1130. var physicsCollider = setNode.getChildAt(i).getComponent(Laya.PhysicsCollider);
  1131. if (physicsCollider) {
  1132. physicsCollider.collisionGroup = CollisionGroup;
  1133. }
  1134. }
  1135. }
  1136. static RandomNumber(from, to) {
  1137. if (from >= to) {
  1138. return 0;
  1139. }
  1140. var size = to - from;
  1141. var curNumber = Math.random() * size + from;
  1142. return curNumber;
  1143. }
  1144. static RandomANumber(from, to) {
  1145. if (from >= to) {
  1146. return 0;
  1147. }
  1148. var size = to - from;
  1149. var curNumber = Math.random() * size + from;
  1150. return Math.floor(curNumber);
  1151. }
  1152. static GetMoney(_num, _pos = null, _completeHandle = null) {
  1153. if (_num == 0)
  1154. return;
  1155. var fafaafsfa = new Laya.Box;
  1156. fafaafsfa.width = 400;
  1157. fafaafsfa.height = 100;
  1158. fafaafsfa.pivotX = fafaafsfa.width / 2;
  1159. fafaafsfa.pivotY = fafaafsfa.height / 2;
  1160. if (_pos == null) {
  1161. _pos = new Laya.Vector2(Laya.stage.width / 2, Laya.stage.height / 2);
  1162. }
  1163. fafaafsfa.pos(_pos.x, _pos.y);
  1164. var aafafaffa = new Laya.Image;
  1165. aafafaffa.skin = "game/qiandao_1_7.png";
  1166. aafafaffa.width = 60;
  1167. aafafaffa.height = 60;
  1168. aafafaffa.left = 50;
  1169. aafafaffa.y = 10;
  1170. fafaafsfa.addChild(aafafaffa);
  1171. var faasfafsafs = new Laya.Text;
  1172. faasfafsafs.width = 300;
  1173. faasfafsafs.height = 50;
  1174. faasfafsafs.align = "center";
  1175. faasfafsafs.valign = "middle";
  1176. faasfafsafs.font = "Microsoft YaHei";
  1177. faasfafsafs.fontSize = 40;
  1178. faasfafsafs.color = "#FFFFFF";
  1179. faasfafsafs.bold = true;
  1180. faasfafsafs.font = "Microsoft YaHei";
  1181. faasfafsafs.text = "金币 +" + _num;
  1182. faasfafsafs.x = 60;
  1183. faasfafsafs.y = 10;
  1184. fafaafsfa.addChild(faasfafsafs);
  1185. Laya.stage.addChild(fafaafsfa);
  1186. var faasfsaf = Laya.Tween.to(fafaafsfa, { y: fafaafsfa.y - 200 }, 1500, Laya.Ease.expoInOut, Laya.Handler.create(this, () => {
  1187. faasfsaf.clear();
  1188. fafaafsfa.destroy();
  1189. if (_completeHandle) {
  1190. _completeHandle.run();
  1191. }
  1192. }), 100);
  1193. }
  1194. static TweenText(faafssfafsa, _hight, _completeHandle = null, hide = true, _duration = 500) {
  1195. var afasafsafsfa = new Laya.Text();
  1196. afasafsafsfa.width = faafssfafsa.size.x;
  1197. afasafsafsfa.height = faafssfafsa.size.y;
  1198. afasafsafsfa.align = "center";
  1199. afasafsafsfa.valign = "middle";
  1200. afasafsafsfa.font = "Microsoft YaHei";
  1201. afasafsafsfa.fontSize = faafssfafsa.fontSize;
  1202. afasafsafsfa.pivotX = afasafsafsfa.width / 2;
  1203. afasafsafsfa.pivotY = afasafsafsfa.height / 2;
  1204. afasafsafsfa.color = "#5ad122";
  1205. afasafsafsfa.bold = true;
  1206. afasafsafsfa.stroke = 5;
  1207. afasafsafsfa.strokeColor = "#ffffff";
  1208. if (faafssfafsa.color) {
  1209. faafssfafsa.color = faafssfafsa.color;
  1210. }
  1211. afasafsafsfa.text = faafssfafsa.message;
  1212. afasafsafsfa.zOrder = 1;
  1213. Laya.stage.addChildAt(afasafsafsfa, Laya.stage.numChildren - 1);
  1214. afasafsafsfa.pos(faafssfafsa.pos.x, faafssfafsa.pos.y);
  1215. var tween = Laya.Tween.to(afasafsafsfa, { y: afasafsafsfa.y - _hight, update: new Laya.Handler(this, function () {
  1216. }) }, _duration, Laya.Ease.expoInOut, Laya.Handler.create(this, function () {
  1217. tween.clear();
  1218. if (hide) {
  1219. afasafsafsfa.destroy();
  1220. }
  1221. if (_completeHandle) {
  1222. _completeHandle.run();
  1223. }
  1224. }));
  1225. if (hide) {
  1226. Laya.Tween.to(afasafsafsfa, { alpha: 0.4 }, 500);
  1227. }
  1228. return afasafsafsfa;
  1229. }
  1230. static StationTweenText(faafssfafsa, _hight, _completeHandle = null, hide = true, _duration = 500) {
  1231. var afasafsafsfa = new Laya.Text();
  1232. afasafsafsfa.width = faafssfafsa.size.x;
  1233. afasafsafsfa.height = faafssfafsa.size.y;
  1234. afasafsafsfa.align = "center";
  1235. afasafsafsfa.valign = "middle";
  1236. afasafsafsfa.font = "Microsoft YaHei";
  1237. afasafsafsfa.fontSize = 50;
  1238. afasafsafsfa.pivotX = afasafsafsfa.width / 2;
  1239. afasafsafsfa.pivotY = afasafsafsfa.height / 2;
  1240. afasafsafsfa.color = "#5ad122";
  1241. afasafsafsfa.bold = true;
  1242. afasafsafsfa.stroke = 5;
  1243. afasafsafsfa.strokeColor = "#ffffff";
  1244. if (faafssfafsa.color) {
  1245. faafssfafsa.color = faafssfafsa.color;
  1246. }
  1247. afasafsafsfa.text = faafssfafsa.message;
  1248. afasafsafsfa.zOrder = 1;
  1249. Laya.stage.addChildAt(afasafsafsfa, Laya.stage.numChildren - 1);
  1250. afasafsafsfa.pos(faafssfafsa.pos.x, faafssfafsa.pos.y);
  1251. var tween = Laya.Tween.to(afasafsafsfa, { y: afasafsafsfa.y - _hight, update: new Laya.Handler(this, function () {
  1252. }) }, _duration, Laya.Ease.expoInOut, Laya.Handler.create(this, function () {
  1253. tween.clear();
  1254. if (hide) {
  1255. afasafsafsfa.destroy();
  1256. }
  1257. if (_completeHandle) {
  1258. _completeHandle.run();
  1259. }
  1260. }));
  1261. if (hide) {
  1262. Laya.Tween.to(afasafsafsfa, { alpha: 0.4 }, 10000);
  1263. }
  1264. return afasafsafsfa;
  1265. }
  1266. static tweenMove(transform, targPos, delay, ease, complete) {
  1267. let curPos = transform.position.clone();
  1268. return Laya.Tween.to(curPos, {
  1269. x: targPos.x,
  1270. y: targPos.y,
  1271. z: targPos.z,
  1272. update: new Laya.Handler(this, () => {
  1273. transform.position = curPos.clone();
  1274. })
  1275. }, delay, ease, complete);
  1276. }
  1277. static tweenRotate(transform, targEuler, delay, ease, complete) {
  1278. let curEuler = transform.rotationEuler.clone();
  1279. return Laya.Tween.to(curEuler, {
  1280. x: targEuler.x,
  1281. y: targEuler.y,
  1282. z: targEuler.z,
  1283. update: new Laya.Handler(this, () => {
  1284. transform.rotationEuler = curEuler.clone();
  1285. })
  1286. }, delay, ease, complete);
  1287. }
  1288. }
  1289. var MusicType;
  1290. (function (MusicType) {
  1291. MusicType[MusicType["clear"] = 0] = "clear";
  1292. MusicType[MusicType["down"] = 1] = "down";
  1293. })(MusicType || (MusicType = {}));
  1294. class AudioManager {
  1295. constructor() { }
  1296. static musicres(_type) {
  1297. return "Game/res/Music/" + MusicType[_type] + ".wav";
  1298. }
  1299. static playMusic(_type) {
  1300. if (!this.open)
  1301. return;
  1302. Laya.SoundManager.playSound(this.musicres(_type));
  1303. }
  1304. static StopMusic() {
  1305. Laya.SoundManager.stopMusic();
  1306. }
  1307. }
  1308. AudioManager.open = true;
  1309. class DropRule {
  1310. constructor() {
  1311. this.EffectName = new Array("blue", "yellow", "purple", "green");
  1312. this.EffectArray = [];
  1313. this.PrefabName = new Array("2", "4", "8", "16", "32", "64", "128", "256", "512", "1024", "2048", "4096", "8192", "16384", "32768", "65536", "131072", "262144");
  1314. this.Cloned = false;
  1315. DropRule.ins = this;
  1316. this.Init();
  1317. this.InitEffect();
  1318. EventManager.StageOn(StageMode.Refresh, this, this.Init);
  1319. }
  1320. static get Instance() {
  1321. if (DropRule.ins) {
  1322. return DropRule.ins;
  1323. }
  1324. else {
  1325. return new DropRule();
  1326. }
  1327. }
  1328. Init(_data) {
  1329. this.STAGE = Number(AccountManager.Instance.curplayerData.GainAccount("stage"));
  1330. let level = AccountManager.Instance.curplayerData.GainCollocation("level");
  1331. if (_data) {
  1332. for (var key in level) {
  1333. if (level[key].id == this.STAGE) {
  1334. let Level = level[Number(key)];
  1335. this.DropHeight = Number(Level.hight);
  1336. this.GoalScore = Number(Level.goal);
  1337. this.BallNum = Level.edge.split(";");
  1338. this.StartNum = Number(Level.start_number);
  1339. this.DropNum = Level.drop_number.split(";");
  1340. let min = Number(this.BallNum[0]);
  1341. let minnext = Number(this.BallNum[1]);
  1342. this.MinBall = Number(this.PrefabName[min - 1]);
  1343. this.MinNextBall = Number(this.PrefabName[minnext - 1]);
  1344. }
  1345. }
  1346. }
  1347. else {
  1348. for (var key in level) {
  1349. if (level[key].id == this.STAGE) {
  1350. let Level = level[Number(key)];
  1351. this.DropHeight = Number(Level.hight);
  1352. this.GoalScore = Number(Level.goal);
  1353. this.SizeIndex = Level.index.split(";");
  1354. console.log(this.SizeIndex);
  1355. this.BallNum = Level.edge.split(";");
  1356. this.StartNum = Number(Level.start_number);
  1357. this.DropNum = Level.drop_number.split(";");
  1358. this.EdgeIndex = Level.edgeindex.split(";");
  1359. let min = Number(this.BallNum[0]);
  1360. let minnext = Number(this.BallNum[this.BallNum.length - 1]);
  1361. this.MinBall = Number(this.PrefabName[min - 1]);
  1362. this.MinNextBall = Number(this.PrefabName[minnext - 1]);
  1363. }
  1364. }
  1365. }
  1366. this.Read();
  1367. }
  1368. InitEffect() {
  1369. for (let i = 0; i < this.EffectName.length; i++) {
  1370. this.ReadJson(i);
  1371. }
  1372. }
  1373. ReadJson(i) {
  1374. Laya.loader.create("Effect/" + this.EffectName[i] + ".json", Laya.Handler.create(this, this.creat));
  1375. }
  1376. creat(Prefab) {
  1377. let obj = new Laya.Prefab();
  1378. obj.json = Prefab;
  1379. this.EffectArray.push(obj);
  1380. }
  1381. CreateEffect(_score, _pos) {
  1382. let effect;
  1383. let index;
  1384. if (_score == 2 || _score == 16 || _score == 256 || _score == 2048 || _score == 32768 || _score == 262144) {
  1385. effect = this.EffectArray[3];
  1386. index = 3;
  1387. }
  1388. else if (_score == 8 || _score == 32 || _score == 4096 || _score == 131072) {
  1389. effect = this.EffectArray[1];
  1390. index = 1;
  1391. }
  1392. else if (_score == 64 || _score == 512 || _score == 16384) {
  1393. effect = this.EffectArray[2];
  1394. index = 2;
  1395. }
  1396. else if (_score == 4 || _score == 128 || _score == 1024 || _score == 8192 || _score == 65536) {
  1397. effect = this.EffectArray[0];
  1398. index = 0;
  1399. }
  1400. let pre = Laya.Pool.getItemByCreateFun(this.EffectName[index], effect.create, effect);
  1401. pre.pos(_pos.x, _pos.y);
  1402. Laya.stage.addChild(pre);
  1403. pre.on(Laya.Event.COMPLETE, this, () => {
  1404. pre.removeSelf();
  1405. pre.destroy();
  1406. });
  1407. }
  1408. GetBallIndex(_score) {
  1409. let num;
  1410. for (let i = 0; i < this.PrefabName.length; i++) {
  1411. if (_score == Number(this.PrefabName[i])) {
  1412. num = i;
  1413. }
  1414. else if (_score > Number(this.PrefabName[i]) && _score < Number(this.PrefabName[i + 1])) {
  1415. num = i;
  1416. }
  1417. }
  1418. return num;
  1419. }
  1420. GetScore(_score) {
  1421. let num;
  1422. for (let i = 0; i < this.PrefabName.length; i++) {
  1423. if (_score == Number(this.PrefabName[i])) {
  1424. num = Number(this.PrefabName[i]);
  1425. }
  1426. else if (_score > Number(this.PrefabName[i]) && _score < Number(this.PrefabName[i + 1])) {
  1427. num = Number(this.PrefabName[i]);
  1428. }
  1429. }
  1430. return num;
  1431. }
  1432. GetBallSize(_score) {
  1433. let num;
  1434. let index;
  1435. let size = 0;
  1436. for (let i = 0; i < this.PrefabName.length; i++) {
  1437. if (_score == Number(this.PrefabName[i])) {
  1438. num = i;
  1439. }
  1440. else if (_score > Number(this.PrefabName[i]) && _score < Number(this.PrefabName[i + 1])) {
  1441. num = i;
  1442. }
  1443. }
  1444. for (let j = 0; j < this.EdgeIndex.length; j++) {
  1445. if (num + 1 == Number(this.EdgeIndex[j])) {
  1446. index = Number(this.SizeIndex[j]);
  1447. size = this.Size(num + 1, index);
  1448. }
  1449. }
  1450. if (size == 0) {
  1451. let cimi = Number(this.EdgeIndex[this.EdgeIndex.length - 1]);
  1452. index = Number(this.SizeIndex[this.EdgeIndex.length - 1]);
  1453. size = this.Size(cimi, index);
  1454. let n = (num + 1) - cimi;
  1455. size = size + (n * 5);
  1456. }
  1457. return size;
  1458. }
  1459. Size(_index, sizelevel) {
  1460. let ballsize;
  1461. let ball = AccountManager.Instance.curplayerData.GainCollocation("ball");
  1462. for (var key in ball) {
  1463. let item = ball[key];
  1464. if (_index == item.ball && sizelevel == item.size_level) {
  1465. ballsize = Number(item.size);
  1466. }
  1467. }
  1468. return ballsize;
  1469. }
  1470. CreatBall(_index, size, pos) {
  1471. let ball = new Laya.Image();
  1472. ball.skin = "Game/res/Ball/blast" + _index + ".png";
  1473. ball.anchorX = 0.5;
  1474. ball.anchorY = 0.5;
  1475. ball.height = size;
  1476. ball.width = size;
  1477. let collider = ball.addComponent(Laya.CircleCollider);
  1478. collider.restitution = AccountManager.Instance.curplayerData.Restitution;
  1479. collider.radius = size / 2 + 1.5;
  1480. console.log("碰撞器半径--", collider.radius, size);
  1481. let rig = ball.addComponent(Laya.RigidBody);
  1482. rig.gravityScale = 3;
  1483. let num = new Laya.FontClip();
  1484. num.name = "num";
  1485. num.skin = "Game/res/Ball/44.png";
  1486. num.anchorX = 0.5;
  1487. num.anchorY = 0.5;
  1488. num.sheet = "0123456789";
  1489. let zi = this.PrefabName[_index];
  1490. num.value = zi;
  1491. ball.addChild(num);
  1492. num.centerX = 0;
  1493. num.centerY = 0;
  1494. let light = new Laya.Image();
  1495. light.skin = "Game/res/Ball/" + zi + ".png";
  1496. light.anchorX = 0.5;
  1497. light.anchorY = 0.5;
  1498. light.width = this.LightSize(size);
  1499. light.height = this.LightSize(size);
  1500. light.name = "light";
  1501. ball.addChild(light);
  1502. light.centerX = 0;
  1503. light.centerY = 0;
  1504. let script = ball.addComponent(Ball);
  1505. ball.pos(pos.x, pos.y);
  1506. Laya.timer.once(1, this, () => {
  1507. EventManager.StageTrigger(StageMode.Clone, [ball]);
  1508. });
  1509. this.Cloned = true;
  1510. AudioManager.playMusic(MusicType.down);
  1511. }
  1512. CreatBall2(_index, size, pos) {
  1513. let ball = new Laya.Image();
  1514. ball.skin = "Game/res/Ball/blast" + _index + ".png";
  1515. ball.anchorX = 0.5;
  1516. ball.anchorY = 0.5;
  1517. ball.height = size;
  1518. ball.width = size;
  1519. let collider = ball.addComponent(Laya.CircleCollider);
  1520. collider.restitution = AccountManager.Instance.curplayerData.Restitution;
  1521. if (this.STAGE == 1 && GameManager.Instance.Wave < 3) {
  1522. collider.restitution = 0;
  1523. }
  1524. collider.radius = size / 2 + 1.5;
  1525. let rig = ball.addComponent(Laya.RigidBody);
  1526. rig.allowRotation = true;
  1527. rig.gravityScale = 3;
  1528. let num = new Laya.FontClip();
  1529. num.name = "num";
  1530. num.skin = "Game/res/Ball/44.png";
  1531. num.anchorX = 0.5;
  1532. num.anchorY = 0.5;
  1533. num.sheet = "0123456789";
  1534. let zi = this.PrefabName[_index];
  1535. num.value = zi;
  1536. ball.addChild(num);
  1537. num.centerX = 0;
  1538. num.centerY = 0;
  1539. let light = new Laya.Image();
  1540. light.skin = "Game/res/Ball/" + zi + ".png";
  1541. light.anchorX = 0.5;
  1542. light.anchorY = 0.5;
  1543. light.width = this.LightSize(size);
  1544. light.height = this.LightSize(size);
  1545. light.name = "light";
  1546. ball.addChild(light);
  1547. light.centerX = 0;
  1548. light.centerY = 0;
  1549. let script = ball.addComponent(Ball);
  1550. this.SetPosition(ball, pos);
  1551. Laya.timer.once(1, this, () => {
  1552. EventManager.StageTrigger(StageMode.Clone, [ball]);
  1553. });
  1554. AudioManager.playMusic(MusicType.down);
  1555. }
  1556. SetPosition(_node, _pos) {
  1557. _node.pos(_pos.x, _pos.y);
  1558. }
  1559. LightSize(_size) {
  1560. let num;
  1561. switch (_size) {
  1562. case 65:
  1563. num = 79;
  1564. break;
  1565. case 70:
  1566. num = 87;
  1567. break;
  1568. case 75:
  1569. num = 95;
  1570. break;
  1571. case 80:
  1572. num = 100;
  1573. break;
  1574. case 85:
  1575. num = 105;
  1576. break;
  1577. case 90:
  1578. num = 110;
  1579. break;
  1580. case 95:
  1581. num = 117;
  1582. break;
  1583. case 100:
  1584. num = 124;
  1585. break;
  1586. case 105:
  1587. num = 130;
  1588. break;
  1589. case 110:
  1590. num = 136;
  1591. break;
  1592. case 115:
  1593. num = 143;
  1594. break;
  1595. case 120:
  1596. num = 150;
  1597. break;
  1598. case 125:
  1599. num = 152;
  1600. break;
  1601. case 130:
  1602. num = 160;
  1603. break;
  1604. case 135:
  1605. num = 165;
  1606. break;
  1607. case 140:
  1608. num = 174;
  1609. break;
  1610. case 145:
  1611. num = 181;
  1612. break;
  1613. case 150:
  1614. num = 186;
  1615. break;
  1616. case 155:
  1617. num = 192;
  1618. break;
  1619. case 160:
  1620. num = 199;
  1621. break;
  1622. case 165:
  1623. num = 202;
  1624. break;
  1625. case 170:
  1626. num = 210;
  1627. break;
  1628. case 175:
  1629. num = 215;
  1630. break;
  1631. case 180:
  1632. num = 223;
  1633. break;
  1634. }
  1635. return num;
  1636. }
  1637. FallDown(_time) {
  1638. if (!_time) {
  1639. let mindrop = Number(this.DropNum[0]);
  1640. let maxdrop = Number(this.DropNum[1]);
  1641. _time = GameTools.RandomANumber(mindrop, maxdrop + 1);
  1642. }
  1643. let min = Number(this.BallNum[0]);
  1644. let max = Number(this.BallNum[this.BallNum.length - 1]);
  1645. let index;
  1646. let size;
  1647. for (let j = 0; j < _time; j++) {
  1648. let num = GameTools.RandomANumber(min, max + 1);
  1649. for (let i = 0; i < this.BallNum.length; i++) {
  1650. if (num == Number(this.BallNum[i])) {
  1651. index = Number(this.SizeIndex[i]);
  1652. size = this.Size(num, index);
  1653. }
  1654. }
  1655. let X = GameTools.RandomANumber(100, 500);
  1656. let pos = new Laya.Vector2(X, 30);
  1657. this.CreatBall2(num - 1, size, pos);
  1658. }
  1659. }
  1660. GuideFallDown() {
  1661. GameManager.Instance.CheckHeight = false;
  1662. let num;
  1663. let shuliang;
  1664. if (GameManager.Instance.Wave == 1) {
  1665. shuliang = 2;
  1666. num = 1;
  1667. }
  1668. else if (GameManager.Instance.Wave == 2) {
  1669. shuliang = 2;
  1670. num = 2;
  1671. }
  1672. else if (GameManager.Instance.Wave == 3) {
  1673. shuliang = 6;
  1674. num = 1;
  1675. }
  1676. else if (GameManager.Instance.Wave == 4) {
  1677. shuliang = 12;
  1678. num = 1;
  1679. }
  1680. else if (GameManager.Instance.Wave == 5) {
  1681. shuliang = 6;
  1682. num = 2;
  1683. }
  1684. else if (GameManager.Instance.Wave == 6) {
  1685. shuliang = 12;
  1686. num = 2;
  1687. }
  1688. else {
  1689. GameManager.Instance.CheckHeight = true;
  1690. this.DropHeight = AccountManager.Instance.curplayerData.GuideHeight;
  1691. let mindrop = Number(this.DropNum[0]);
  1692. let maxdrop = Number(this.DropNum[1]);
  1693. num = GameTools.RandomANumber(mindrop, maxdrop + 1);
  1694. }
  1695. let score = Number(this.PrefabName[num - 1]);
  1696. let index = this.GetBallIndex(score);
  1697. let size = this.GetBallSize(score);
  1698. for (let j = 0; j < shuliang; j++) {
  1699. let X = GameTools.RandomANumber(100, 500);
  1700. let pos = new Laya.Vector2(X, 30);
  1701. this.CreatBall2(num - 1, size, pos);
  1702. }
  1703. }
  1704. RecoverScene() {
  1705. for (let i = 0; i < this.progress.length - 3; i++) {
  1706. let item = this.progress[i];
  1707. this.CreatBall2(Number(item.index) - 1, Number(item.size), new Laya.Vector2(Number(item.pos.x), Number(item.pos.y)));
  1708. }
  1709. }
  1710. Read() {
  1711. if (this.STAGE > 1) {
  1712. var args = [{ "stage": "0" }];
  1713. ServerManager.Instance.SendHttp(BlastToMerge.GetProgress, args, Laya.Handler.create(this, (res) => {
  1714. let json = JSON.parse(res.user_game.detail);
  1715. this.progress = json;
  1716. if (this.progress.length > 1) {
  1717. let items = this.progress[this.progress.length - 2];
  1718. let _score = Number(items.jindu);
  1719. GameManager.Instance.ScoreProgress = _score;
  1720. this.SizeIndex = this.progress[this.progress.length - 1].sizeindex;
  1721. this.EdgeIndex = this.progress[this.progress.length - 3].edgeindex;
  1722. }
  1723. console.log("获取进度成功");
  1724. }), Laya.Handler.create(this, () => {
  1725. console.log("获取进度失败");
  1726. }));
  1727. }
  1728. }
  1729. }
  1730. var Vector2 = Laya.Vector2;
  1731. class Ball extends Laya.Script {
  1732. constructor() {
  1733. super();
  1734. this.TargetArray = [];
  1735. this.moved = false;
  1736. this.mark = false;
  1737. this.clear = false;
  1738. this.score = 0;
  1739. Ball.ins = this;
  1740. }
  1741. static get Instance() {
  1742. if (Ball.ins) {
  1743. return Ball.ins;
  1744. }
  1745. else {
  1746. return new Ball();
  1747. }
  1748. }
  1749. onAwake() {
  1750. this.Light = this.owner.getChildByName("light");
  1751. this.Light.visible = false;
  1752. this.owner.on(Laya.Event.CLICK, this, this.ClickBall);
  1753. EventManager.EventOn(PropEffecf.DOUBLE, this, this.ClickDouble);
  1754. EventManager.EventOn(PropEffecf.NONE, this, this.ClickNone);
  1755. EventManager.EventOn(PropEffecf.HAMMER, this, this.ClickHammer);
  1756. let score = this.owner.getChildByName("num");
  1757. this.score = Number(score.value);
  1758. }
  1759. onUpdate() {
  1760. this.CheckLight();
  1761. if (this.clear) {
  1762. let _rig = this.owner.getComponent(Laya.RigidBody);
  1763. let _collider = this.owner.getComponent(Laya.CircleCollider);
  1764. _collider.isSensor = true;
  1765. _collider.enabled = false;
  1766. _rig.enabled = false;
  1767. this.Move(GameManager.Instance.TargetPosition);
  1768. this.moved = true;
  1769. }
  1770. }
  1771. CheckLight() {
  1772. if (this.TargetArray.length > 0) {
  1773. let num = 0;
  1774. for (let i = 0; i < this.TargetArray.length; i++) {
  1775. let ball = this.TargetArray[i];
  1776. if (ball.destroyed) {
  1777. num++;
  1778. }
  1779. }
  1780. if (num == this.TargetArray.length) {
  1781. this.Light.visible = false;
  1782. }
  1783. else {
  1784. this.Light.visible = true;
  1785. }
  1786. }
  1787. else {
  1788. this.Light.visible = false;
  1789. }
  1790. }
  1791. ClickNone() {
  1792. this.owner.off(Laya.Event.CLICK, this, this.Hammer);
  1793. this.owner.off(Laya.Event.CLICK, this, this.Double);
  1794. this.owner.on(Laya.Event.CLICK, this, this.ClickBall);
  1795. }
  1796. ClickDouble() {
  1797. this.owner.off(Laya.Event.CLICK, this, this.ClickBall);
  1798. this.owner.off(Laya.Event.CLICK, this, this.Hammer);
  1799. this.owner.on(Laya.Event.CLICK, this, this.Double);
  1800. }
  1801. Double() {
  1802. var args = [{ "t": AccountManager.Instance.ServerTime.toString() }, { "play_id": GameManager.Instance.play_id }, { "fid": "1" }];
  1803. ServerManager.Instance.SendHttp(BlastToMerge.Use, args, Laya.Handler.create(this, () => {
  1804. let num = this.score * 2;
  1805. let owner = this.owner;
  1806. let _position = new Laya.Vector2(owner.x, owner.y);
  1807. let _rig = this.owner.getComponent(Laya.RigidBody);
  1808. let _collider = this.owner.getComponent(Laya.CircleCollider);
  1809. _collider.enabled = false;
  1810. _rig.enabled = false;
  1811. this.owner.removeSelf();
  1812. this.owner.destroy();
  1813. let id = DropRule.Instance.GetBallIndex(num);
  1814. let size = DropRule.Instance.GetBallSize(num);
  1815. GameManager.Instance.ScoreProgress += num;
  1816. DropRule.Instance.CreatBall(id, size, _position);
  1817. InGameView.Instance.SkillNumRefresh();
  1818. EventManager.EventTrigger(PropEffecf.NONE);
  1819. }), Laya.Handler.create(this, () => {
  1820. console.log("道具使用失败");
  1821. }));
  1822. }
  1823. ClickHammer() {
  1824. this.owner.off(Laya.Event.CLICK, this, this.ClickBall);
  1825. this.owner.off(Laya.Event.CLICK, this, this.Double);
  1826. this.owner.on(Laya.Event.CLICK, this, this.Hammer);
  1827. }
  1828. Hammer() {
  1829. var args = [{ "t": AccountManager.Instance.ServerTime.toString() }, { "play_id": GameManager.Instance.play_id }, { "fid": "4" }];
  1830. ServerManager.Instance.SendHttp(BlastToMerge.Use, args, Laya.Handler.create(this, () => {
  1831. let num = this.score;
  1832. let owner = this.owner;
  1833. GameManager.Instance.ScoreProgress += num;
  1834. let _rig = this.owner.getComponent(Laya.RigidBody);
  1835. let _collider = this.owner.getComponent(Laya.CircleCollider);
  1836. _collider.enabled = false;
  1837. _rig.enabled = false;
  1838. this.owner.removeSelf();
  1839. this.owner.destroy();
  1840. InGameView.Instance.SkillNumRefresh();
  1841. EventManager.EventTrigger(PropEffecf.NONE);
  1842. InGameView.Instance.EffectMode(false);
  1843. }), Laya.Handler.create(this, () => {
  1844. console.log("道具使用失败");
  1845. }));
  1846. }
  1847. onDestroy() {
  1848. this.owner.offAll();
  1849. EventManager.EventOff(PropEffecf.DOUBLE, this, this.ClickDouble);
  1850. EventManager.EventOff(PropEffecf.NONE, this, this.ClickNone);
  1851. EventManager.EventOff(PropEffecf.HAMMER, this, this.ClickHammer);
  1852. }
  1853. onTriggerEnter(other) {
  1854. let targetparent = other.owner;
  1855. if (DropRule.Instance.STAGE == 1 && GameManager.Instance.Wave < 3) {
  1856. if (targetparent.name == "BottomCollider" && this.Light.visible == true) {
  1857. if (DropRule.Instance.STAGE == 1 && GameManager.Instance.Wave < 3) {
  1858. if (!InGameView.Instance.guide.isPlaying && !GameManager.Instance.played) {
  1859. InGameView.Instance.guide.play(null, false);
  1860. GameManager.Instance.played = true;
  1861. }
  1862. InGameView.Instance.Guide.visible = true;
  1863. }
  1864. }
  1865. }
  1866. if (targetparent.name != "RightCollider" && targetparent.name != "LeftCollider" && targetparent.name != "BottomCollider") {
  1867. let num = targetparent.getChildByName("num");
  1868. let ownernum = this.owner.getChildByName("num");
  1869. if (Number(num.value) == Number(ownernum.value)) {
  1870. this.TargetArray.push(targetparent);
  1871. }
  1872. }
  1873. }
  1874. onTriggerStay(other) {
  1875. let targetparent = other.owner;
  1876. if (targetparent.name != "RightCollider" && targetparent.name != "LeftCollider" && targetparent.name != "BottomCollider") {
  1877. let num = targetparent.getChildByName("num");
  1878. let ownernum = this.owner.getChildByName("num");
  1879. if (Number(num.value) == Number(ownernum.value)) {
  1880. this.TargetArray.push(targetparent);
  1881. }
  1882. }
  1883. }
  1884. onTriggerExit(other) {
  1885. let targetparent = other.owner;
  1886. if (targetparent && !targetparent.destroyed) {
  1887. if (targetparent.name != "RightCollider" && targetparent.name != "LeftCollider" && targetparent.name != "BottomCollider") {
  1888. for (let i = this.TargetArray.length - 1; i > -1; i--) {
  1889. if (this.TargetArray[i] == targetparent) {
  1890. this.TargetArray.splice(i, 1);
  1891. }
  1892. }
  1893. }
  1894. }
  1895. }
  1896. Move(_position) {
  1897. if (!this.moved) {
  1898. let owner = this.owner;
  1899. GameManager.Instance.EliminateNum += 1;
  1900. let ball = owner.getComponent(Ball);
  1901. let ownerscore = ball.score;
  1902. GameManager.Instance.ScoreRecord += ownerscore;
  1903. GameManager.Instance.ScoreRecord2 = GameManager.Instance.ScoreRecord;
  1904. let move = Laya.Tween.to(this.owner, {
  1905. x: _position.x, y: _position.y, update: new Laya.Handler(this, function () {
  1906. })
  1907. }, AccountManager.Instance.curplayerData.MergeSpeed * 1000, Laya.Ease.linearInOut, Laya.Handler.create(this, () => {
  1908. move.clear();
  1909. this.owner.removeSelf();
  1910. this.owner.destroy();
  1911. if (!DropRule.Instance.Cloned) {
  1912. let num = DropRule.Instance.GetBallIndex(GameManager.Instance.ScoreRecord2);
  1913. let size = DropRule.Instance.GetBallSize(GameManager.Instance.ScoreRecord2);
  1914. let score = DropRule.Instance.GetScore(GameManager.Instance.ScoreRecord2);
  1915. let ball = DropRule.Instance.CreatBall(num, size, GameManager.Instance.TargetPosition);
  1916. GameManager.Instance.ScoreProgress += score;
  1917. if (GameManager.Instance.EliminateNum >= AccountManager.Instance.curplayerData.ShakeNum) {
  1918. WXSDK.Shake();
  1919. }
  1920. GameManager.Instance.EliminateNum = 0;
  1921. GameManager.Instance.ScoreRecord = 0;
  1922. GameManager.Instance.played = false;
  1923. GameManager.Instance.Wave += 1;
  1924. AudioManager.playMusic(MusicType.clear);
  1925. if (DropRule.Instance.STAGE == 1) {
  1926. if (InGameView.Instance.Guide.visible == true) {
  1927. InGameView.Instance.Guide.visible = false;
  1928. }
  1929. DropRule.Instance.GuideFallDown();
  1930. }
  1931. EventManager.StageTrigger(StageMode.Check);
  1932. }
  1933. }));
  1934. }
  1935. }
  1936. ClickBall() {
  1937. let owner = this.owner;
  1938. for (let j = this.TargetArray.length - 1; j > -1; j--) {
  1939. if (this.TargetArray[j].destroyed || this.TargetArray[j] == null) {
  1940. this.TargetArray.splice(j, 1);
  1941. }
  1942. }
  1943. for (let i = 0; i < this.TargetArray.length; i++) {
  1944. let num = this.TargetArray[i].getChildByName("num");
  1945. }
  1946. DropRule.Instance.Cloned = false;
  1947. GameManager.Instance.TargetPosition = new Vector2(owner.x, owner.y);
  1948. this.DisPose(owner);
  1949. }
  1950. DisPose(_node) {
  1951. let ball = _node.getComponent(Ball);
  1952. if (ball.TargetArray.length > 0) {
  1953. if (!ball.mark) {
  1954. ball.mark = true;
  1955. }
  1956. ball.clear = true;
  1957. for (let i = 0; i < ball.TargetArray.length; i++) {
  1958. if (ball.TargetArray[i].getComponent(Ball).mark)
  1959. continue;
  1960. ball.TargetArray[i].getComponent(Ball).mark = true;
  1961. ball.TargetArray[i].getComponent(Ball).clear = true;
  1962. let target = ball.TargetArray[i];
  1963. let ball2 = target.getComponent(Ball);
  1964. if (ball2.TargetArray.length > 0) {
  1965. for (let j = 0; j < ball2.TargetArray.length; j++) {
  1966. if (ball2.TargetArray[j] == _node) {
  1967. continue;
  1968. }
  1969. ball2.clear = true;
  1970. ball2.mark = true;
  1971. this.DisPose(ball2.TargetArray[j]);
  1972. }
  1973. }
  1974. }
  1975. }
  1976. }
  1977. MouseClick(_node) {
  1978. for (let i = 0; i < InGameView.Instance.prefabbox.numChildren; i++) {
  1979. let other = InGameView.Instance.prefabbox.getChildAt(i);
  1980. if (other.x == _node.x && other.y == _node.y) {
  1981. continue;
  1982. }
  1983. let distanceX = Math.abs(_node.x - other.x);
  1984. let distanceY = Math.abs(_node.y - other.y);
  1985. let dis = _node.width / 2 + other.width / 2;
  1986. }
  1987. }
  1988. }
  1989. class InGameView extends ui.InGameSceneUI {
  1990. constructor() {
  1991. super();
  1992. this.LoseView = false;
  1993. this.WinView = false;
  1994. InGameView.ins = this;
  1995. EventManager.StageOn(StageMode.Clone, this, this.AddPrefab);
  1996. EventManager.StageOn(StageMode.Win, this, this.Win);
  1997. EventManager.StageOn(StageMode.Lose, this, this.Lose);
  1998. EventManager.StageOn(StageMode.ReStart, this, this.ReStart);
  1999. EventManager.StageOn(StageMode.Over, this, this.Over);
  2000. EventManager.StageOn(StageMode.Revive, this, this.Revive);
  2001. EventManager.StageOn(StageMode.Check, this, this.Check);
  2002. }
  2003. static get Instance() {
  2004. if (InGameView.ins) {
  2005. return InGameView.ins;
  2006. }
  2007. else {
  2008. return new InGameView();
  2009. }
  2010. }
  2011. Show() {
  2012. let stage = AccountManager.Instance.curplayerData.GainAccount("stage");
  2013. this.STAGE = Number(stage);
  2014. Laya.timer.loop(AccountManager.Instance.curplayerData.Save * 1000, this, this.Save);
  2015. Laya.timer.once(200, this, this.SkillRefresh);
  2016. Laya.timer.frameLoop(2, this, this.CheckHeight);
  2017. Laya.timer.frameLoop(1, this, this.Progress);
  2018. Laya.timer.once(AccountManager.Instance.curplayerData.CheckLose * 1000, this, this.CheckLose);
  2019. Laya.timer.frameLoop(500, this, this.SkillAnimation);
  2020. this.ScoreRefresh();
  2021. this.SkillNumRefresh();
  2022. this.arrowbtn.clickHandler = new Laya.Handler(this, this.ClickArrow);
  2023. this.zhunxin1btn.clickHandler = new Laya.Handler(this, this.ClickZhunXin1);
  2024. this.zhunxin2btn.clickHandler = new Laya.Handler(this, this.ClickZhunXin2);
  2025. this.doublebtn.clickHandler = new Laya.Handler(this, this.ClickDouble);
  2026. this.hammerbtn.clickHandler = new Laya.Handler(this, this.ClickHammer);
  2027. this.height = Laya.stage.height;
  2028. this.BG.height = Laya.stage.height;
  2029. Laya.stage.on(Laya.Event.RESIZE, this, () => {
  2030. this.height = Laya.stage.height;
  2031. this.BG.height = Laya.stage.height;
  2032. });
  2033. }
  2034. Check() {
  2035. Laya.timer.clear(this, this.CheckLose);
  2036. Laya.timer.once(AccountManager.Instance.curplayerData.CheckLose * 1000, this, this.CheckLose);
  2037. }
  2038. AddPrefab(ball) {
  2039. this.prefabbox.addChild(ball);
  2040. }
  2041. CheckHeight() {
  2042. if (GameManager.Instance.CheckHeight) {
  2043. let down = false;
  2044. for (let i = 0; i < this.prefabbox.numChildren; i++) {
  2045. let child = this.prefabbox.getChildAt(i);
  2046. if (child.y < DropRule.Instance.DropHeight) {
  2047. down = true;
  2048. }
  2049. }
  2050. if (!down) {
  2051. DropRule.Instance.FallDown();
  2052. }
  2053. }
  2054. }
  2055. CheckLose() {
  2056. if (!this.LoseView) {
  2057. let lose = true;
  2058. for (let i = 0; i < this.prefabbox.numChildren; i++) {
  2059. let ball = this.prefabbox.getChildAt(i);
  2060. let light = ball.getChildByName("light");
  2061. if (light.visible) {
  2062. lose = false;
  2063. }
  2064. }
  2065. if (lose) {
  2066. this.LoseView = true;
  2067. Laya.timer.clear(this, this.Save);
  2068. this.Save(true);
  2069. EventManager.StageTrigger(StageMode.Lose);
  2070. }
  2071. }
  2072. }
  2073. ScoreRefresh() {
  2074. let score = DropRule.Instance.GoalScore;
  2075. this.NowLv.value = DropRule.Instance.STAGE.toString();
  2076. this.NextLv.value = (DropRule.Instance.STAGE + 1).toString();
  2077. this.NowScore.text = GameManager.Instance.ScoreProgress.toString();
  2078. this.RequireScore.text = score.toString();
  2079. }
  2080. SkillNumRefresh() {
  2081. this.Func1num.text = AccountManager.Instance.curplayerData.GetPropNum(1).toString();
  2082. this.Func2num.text = AccountManager.Instance.curplayerData.GetPropNum(2).toString();
  2083. this.Func3num.text = AccountManager.Instance.curplayerData.GetPropNum(3).toString();
  2084. this.Func4num.text = AccountManager.Instance.curplayerData.GetPropNum(4).toString();
  2085. this.Func5num.text = AccountManager.Instance.curplayerData.GetPropNum(5).toString();
  2086. }
  2087. SkillRefresh() {
  2088. this.ani1.play(null, false);
  2089. this.ani2.play(null, false);
  2090. this.ani3.play(null, false);
  2091. this.ani4.play(null, false);
  2092. this.ani5.play(null, false);
  2093. }
  2094. SkillAnimation() {
  2095. let random = GameTools.RandomANumber(1, 6);
  2096. switch (random) {
  2097. case 1:
  2098. this.ani1.play(null, false);
  2099. break;
  2100. case 2:
  2101. this.ani2.play(null, false);
  2102. break;
  2103. case 3:
  2104. this.ani3.play(null, false);
  2105. break;
  2106. case 4:
  2107. this.ani4.play(null, false);
  2108. break;
  2109. case 5:
  2110. this.ani5.play(null, false);
  2111. break;
  2112. }
  2113. }
  2114. get Ratio() {
  2115. let score = DropRule.Instance.GoalScore;
  2116. let value = GameManager.Instance.ScoreProgress / score;
  2117. return value;
  2118. }
  2119. Progress() {
  2120. if (!this.WinView) {
  2121. this.LevelProgress.value = this.Ratio;
  2122. if (GameManager.Instance.ScoreProgress >= Number(this.RequireScore.text)) {
  2123. GameManager.Instance.ScoreProgress = Number(this.RequireScore.text);
  2124. this.NowScore.text = GameManager.Instance.ScoreProgress.toString();
  2125. Laya.timer.clear(this, this.Save);
  2126. Laya.timer.clear(this, this.CheckLose);
  2127. this.Save(true);
  2128. EventManager.StageTrigger(StageMode.Win);
  2129. this.WinView = true;
  2130. }
  2131. this.NowScore.text = GameManager.Instance.ScoreProgress.toString();
  2132. }
  2133. }
  2134. ClickArrow() {
  2135. console.log("点到了推球道具--");
  2136. if (Number(this.Func5num.text) > 0) {
  2137. var args = [{ "t": AccountManager.Instance.ServerTime.toString() }, { "play_id": GameManager.Instance.play_id }, { "fid": "5" }];
  2138. ServerManager.Instance.SendHttp(BlastToMerge.Use, args, Laya.Handler.create(this, () => {
  2139. for (let i = 0; i < this.prefabbox.numChildren; i++) {
  2140. let ball = this.prefabbox.getChildAt(i);
  2141. if (ball.destroyed) {
  2142. continue;
  2143. }
  2144. else {
  2145. let _rig = ball.getComponent(Laya.RigidBody);
  2146. _rig.applyLinearImpulseToCenter({ x: 0, y: -1000 });
  2147. }
  2148. }
  2149. this.SkillNumRefresh();
  2150. }), Laya.Handler.create(this, () => {
  2151. }));
  2152. }
  2153. }
  2154. ClickDouble() {
  2155. if (EventManager.PropState == PropEffecf.DOUBLE) {
  2156. EventManager.EventTrigger(PropEffecf.NONE);
  2157. console.log("切换为普通模式");
  2158. return;
  2159. }
  2160. if (EventManager.PropState != PropEffecf.NONE) {
  2161. this.EffectMode(false);
  2162. return;
  2163. }
  2164. if (Number(this.Func1num.text) > 0) {
  2165. EventManager.EventTrigger(PropEffecf.DOUBLE);
  2166. console.log("切换为双倍模式");
  2167. }
  2168. }
  2169. ClickZhunXin1() {
  2170. console.log("点到了准心1道具--");
  2171. if (Number(this.Func2num.text) > 0) {
  2172. if (EventManager.PropState == PropEffecf.NONE) {
  2173. this.EffectMode(true, PropEffecf.CLEARLAST);
  2174. }
  2175. else {
  2176. this.EffectMode(false);
  2177. }
  2178. }
  2179. }
  2180. ClickZhunXin2() {
  2181. console.log("点到了准心2道具--");
  2182. if (Number(this.Func3num.text) > 0) {
  2183. if (EventManager.PropState == PropEffecf.NONE) {
  2184. this.EffectMode(true, PropEffecf.CLEARTWO);
  2185. }
  2186. else {
  2187. this.EffectMode(false);
  2188. }
  2189. }
  2190. }
  2191. ClickHammer() {
  2192. console.log("点到了锤子道具--");
  2193. if (Number(this.Func4num.text) > 0) {
  2194. if (EventManager.PropState == PropEffecf.NONE) {
  2195. this.EffectMode(true, PropEffecf.HAMMER);
  2196. }
  2197. else {
  2198. this.EffectMode(false);
  2199. }
  2200. }
  2201. }
  2202. EffectMode(_open, _type = null) {
  2203. this.Effect.visible = _open;
  2204. if (_open) {
  2205. EventManager.PropState = _type;
  2206. let describe2 = this.Effect.getChildByName("describe2");
  2207. let describe = this.Effect.getChildByName("describe");
  2208. let icon = this.Effect.getChildByName("ICON");
  2209. switch (_type) {
  2210. case PropEffecf.CLEARLAST:
  2211. this.EffectBtn.visible = true;
  2212. describe.visible = true;
  2213. describe2.visible = false;
  2214. icon.visible = true;
  2215. icon.skin = this.GetIcon(DropRule.Instance.MinBall);
  2216. this.ClearNum.text = DropRule.Instance.MinBall.toString();
  2217. this.EffectBtn.clickHandler = Laya.Handler.create(this, this.ClearLast);
  2218. break;
  2219. case PropEffecf.CLEARTWO:
  2220. this.EffectBtn.visible = true;
  2221. describe.visible = true;
  2222. describe2.visible = false;
  2223. icon.visible = true;
  2224. icon.skin = this.GetIcon(DropRule.Instance.MinNextBall);
  2225. this.ClearNum.text = DropRule.Instance.MinNextBall.toString();
  2226. this.EffectBtn.clickHandler = Laya.Handler.create(this, this.ClearTwo);
  2227. break;
  2228. case PropEffecf.HAMMER:
  2229. this.EffectBtn.visible = false;
  2230. describe.visible = false;
  2231. describe2.visible = true;
  2232. icon.visible = false;
  2233. EventManager.EventTrigger(PropEffecf.HAMMER);
  2234. break;
  2235. }
  2236. }
  2237. else {
  2238. EventManager.PropState = PropEffecf.NONE;
  2239. this.EffectBtn.clickHandler = null;
  2240. }
  2241. }
  2242. ClearLast() {
  2243. var args = [{ "t": AccountManager.Instance.ServerTime.toString() }, { "play_id": GameManager.Instance.play_id }, { "fid": "2" }];
  2244. ServerManager.Instance.SendHttp(BlastToMerge.Use, args, Laya.Handler.create(this, () => {
  2245. for (let i = this.prefabbox.numChildren - 1; i > -1; i--) {
  2246. let prefab = this.prefabbox.getChildAt(i);
  2247. let ball = prefab.getComponent(Ball);
  2248. if (ball.score == DropRule.Instance.MinBall) {
  2249. GameManager.Instance.ScoreProgress += ball.score;
  2250. DropRule.Instance.CreateEffect(ball.score, new Laya.Vector2(prefab.x, prefab.y));
  2251. prefab.removeSelf();
  2252. }
  2253. }
  2254. this.SkillNumRefresh();
  2255. this.Effect.visible = false;
  2256. this.EffectBtn.clickHandler = null;
  2257. EventManager.PropState = PropEffecf.NONE;
  2258. }), Laya.Handler.create(this, () => {
  2259. console.log("道具使用失败");
  2260. }));
  2261. }
  2262. ClearTwo() {
  2263. var args = [{ "t": AccountManager.Instance.ServerTime.toString() }, { "play_id": GameManager.Instance.play_id }, { "fid": "3" }];
  2264. ServerManager.Instance.SendHttp(BlastToMerge.Use, args, Laya.Handler.create(this, () => {
  2265. for (let i = this.prefabbox.numChildren - 1; i > -1; i--) {
  2266. let prefab = this.prefabbox.getChildAt(i);
  2267. let ball = prefab.getComponent(Ball);
  2268. if (ball.score == DropRule.Instance.MinNextBall) {
  2269. GameManager.Instance.ScoreProgress += ball.score;
  2270. DropRule.Instance.CreateEffect(ball.score, new Laya.Vector2(prefab.x, prefab.y));
  2271. prefab.removeSelf();
  2272. }
  2273. }
  2274. this.SkillNumRefresh();
  2275. this.Effect.visible = false;
  2276. this.EffectBtn.clickHandler = null;
  2277. EventManager.PropState = PropEffecf.NONE;
  2278. }), Laya.Handler.create(this, () => {
  2279. console.log("道具使用失败");
  2280. }));
  2281. }
  2282. GetIcon(_score) {
  2283. let index;
  2284. for (let i = 0; i < DropRule.Instance.PrefabName.length; i++) {
  2285. if (_score == Number(DropRule.Instance.PrefabName[i])) {
  2286. index = i.toString();
  2287. }
  2288. }
  2289. return "Ball/blast" + index + ".png";
  2290. }
  2291. ClearStage() {
  2292. if (!this.prefabbox.destroyed) {
  2293. for (let i = this.prefabbox.numChildren - 1; i > -1; i--) {
  2294. let ball = this.prefabbox.getChildAt(i);
  2295. let _rig = ball.getComponent(Laya.RigidBody);
  2296. let _collider = ball.getComponent(Laya.CircleCollider);
  2297. _collider.enabled = false;
  2298. _rig.enabled = false;
  2299. Laya.timer.clearAll(ball);
  2300. ball.removeSelf();
  2301. ball.destroy();
  2302. }
  2303. }
  2304. }
  2305. Over() {
  2306. this.ClearStage();
  2307. EventManager.StageOff(StageMode.Clone, this, this.AddPrefab);
  2308. EventManager.StageOff(StageMode.Win, this, this.Win);
  2309. EventManager.StageOff(StageMode.Lose, this, this.Lose);
  2310. EventManager.StageOff(StageMode.ReStart, this, this.ReStart);
  2311. EventManager.StageOff(StageMode.Over, this, this.Over);
  2312. EventManager.StageOff(StageMode.Revive, this, this.Revive);
  2313. EventManager.StageOff(StageMode.Check, this, this.Check);
  2314. this.ClearCollider(this.BottomCollider);
  2315. this.ClearCollider(this.RightCollider);
  2316. this.ClearCollider(this.LeftCollider);
  2317. }
  2318. Revive() {
  2319. for (let i = this.prefabbox.numChildren - 1; i > -1; i--) {
  2320. let prefab = this.prefabbox.getChildAt(i);
  2321. let ball = prefab.getComponent(Ball);
  2322. for (let j = 0; j < DropRule.Instance.BallNum.length; j++) {
  2323. let Score = DropRule.Instance.GetBallIndex(ball.score);
  2324. if (Score + 1 == Number(DropRule.Instance.BallNum[j])) {
  2325. DropRule.Instance.CreateEffect(ball.score, new Laya.Vector2(prefab.x, prefab.y));
  2326. prefab.removeSelf();
  2327. }
  2328. }
  2329. }
  2330. Laya.timer.frameLoop(2, this, this.CheckHeight);
  2331. Laya.timer.once(500, this, () => {
  2332. this.LoseView = false;
  2333. });
  2334. }
  2335. Win() {
  2336. Laya.timer.clear(this, this.CheckHeight);
  2337. }
  2338. Lose() {
  2339. Laya.timer.clear(this, this.CheckHeight);
  2340. }
  2341. ReStart(_data) {
  2342. if (_data) {
  2343. for (let i = this.prefabbox.numChildren - 1; i > -1; i--) {
  2344. let prefab = this.prefabbox.getChildAt(i);
  2345. let ball = prefab.getComponent(Ball);
  2346. for (let j = 0; j < DropRule.Instance.BallNum.length; j++) {
  2347. let Score = DropRule.Instance.GetBallIndex(ball.score);
  2348. if (Score + 1 == Number(DropRule.Instance.BallNum[j])) {
  2349. DropRule.Instance.CreateEffect(ball.score, new Laya.Vector2(prefab.x, prefab.y));
  2350. prefab.removeSelf();
  2351. }
  2352. }
  2353. }
  2354. let ballarray = this.PassDeal;
  2355. if (ballarray.length > 4) {
  2356. let ballarray2 = [];
  2357. for (let m = 0; m < 4; m++) {
  2358. ballarray2.push(ballarray[m]);
  2359. }
  2360. for (let k = this.prefabbox.numChildren - 1; k > -1; k--) {
  2361. let prefab = this.prefabbox.getChildAt(k);
  2362. let ball = prefab.getComponent(Ball);
  2363. let dispear = false;
  2364. for (let l = 0; l < ballarray2.length; l++) {
  2365. if (ball.score < ballarray2[l]) {
  2366. dispear = true;
  2367. }
  2368. }
  2369. if (dispear) {
  2370. DropRule.Instance.CreateEffect(ball.score, new Laya.Vector2(prefab.x, prefab.y));
  2371. prefab.removeSelf();
  2372. }
  2373. }
  2374. }
  2375. Laya.timer.loop(5000, this, this.Save);
  2376. this.WinView = false;
  2377. this.ScoreRefresh();
  2378. this.Progress();
  2379. DropRule.Instance.FallDown(DropRule.Instance.StartNum);
  2380. Laya.timer.frameLoop(2, this, this.CheckHeight);
  2381. }
  2382. else {
  2383. this.ClearStage();
  2384. this.LoseView = false;
  2385. this.WinView = false;
  2386. this.ScoreRefresh();
  2387. this.Progress();
  2388. if (DropRule.Instance.STAGE == 1) {
  2389. this.Guide.visible = false;
  2390. GameManager.Instance.Wave = 1;
  2391. DropRule.Instance.GuideFallDown();
  2392. GameManager.Instance.CheckHeight = false;
  2393. }
  2394. else {
  2395. DropRule.Instance.FallDown(DropRule.Instance.StartNum);
  2396. }
  2397. Laya.timer.frameLoop(2, this, this.CheckHeight);
  2398. }
  2399. }
  2400. ClearCollider(_node) {
  2401. let collier = _node.getComponent(Laya.ChainCollider);
  2402. let rig = _node.getComponent(Laya.RigidBody);
  2403. if (collier) {
  2404. collier.enabled = false;
  2405. }
  2406. if (rig) {
  2407. rig.enabled = false;
  2408. }
  2409. if (_node) {
  2410. _node.removeSelf();
  2411. _node.destroy();
  2412. }
  2413. }
  2414. Close() {
  2415. Laya.timer.clearAll(this);
  2416. }
  2417. get PassDeal() {
  2418. let array = [];
  2419. for (let i = 0; i < this.prefabbox.numChildren; i++) {
  2420. let prefab = this.prefabbox.getChildAt(i);
  2421. let ball = prefab.getComponent(Ball);
  2422. if (array.length == 0) {
  2423. array.push(ball.score);
  2424. }
  2425. if (i > 0) {
  2426. let add = true;
  2427. for (let j = 0; j < array.length; j++) {
  2428. if (ball.score == array[j]) {
  2429. add = false;
  2430. }
  2431. }
  2432. if (add) {
  2433. array.push(ball.score);
  2434. }
  2435. }
  2436. }
  2437. if (array.length > 4) {
  2438. for (let k = 0; k < array.length; k++) {
  2439. for (let l = 0; l < array.length - k - 1; l++) {
  2440. if (array[l] < array[l + 1]) {
  2441. let temp = array[l];
  2442. array[l] = array[l + 1];
  2443. array[l + 1] = temp;
  2444. }
  2445. }
  2446. }
  2447. }
  2448. return array;
  2449. }
  2450. Save(_data) {
  2451. let ball;
  2452. let score;
  2453. let size;
  2454. let index;
  2455. let point;
  2456. let obj = {};
  2457. let objarray = [];
  2458. if (!_data) {
  2459. for (let i = 0; i < this.prefabbox.numChildren; i++) {
  2460. let prefab = this.prefabbox.getChildAt(i);
  2461. ball = prefab.getComponent(Ball);
  2462. score = ball.score;
  2463. index = (DropRule.Instance.GetBallIndex(score) + 1).toString();
  2464. size = prefab.width.toString();
  2465. point = new Laya.Vector2(prefab.x, prefab.y);
  2466. obj = { "index": index, "size": size, "pos": point };
  2467. objarray.push(obj);
  2468. }
  2469. let jindutiao = { "jindu": GameManager.Instance.ScoreProgress.toString() };
  2470. let sizeindex = { "sizeindex": DropRule.Instance.SizeIndex };
  2471. let edgeindex = { "edgeindex": DropRule.Instance.EdgeIndex };
  2472. objarray.push(edgeindex);
  2473. objarray.push(jindutiao);
  2474. objarray.push(sizeindex);
  2475. var progress = JSON.stringify(objarray);
  2476. var args = [{ "stage": DropRule.Instance.STAGE.toString() }, { "progress": progress }];
  2477. }
  2478. else {
  2479. obj = { "0": "0" };
  2480. objarray.push(obj);
  2481. var progress = JSON.stringify(objarray);
  2482. var args = [{ "stage": DropRule.Instance.STAGE.toString() }, { "progress": progress }];
  2483. }
  2484. ServerManager.Instance.SendHttp(BlastToMerge.Save, args, Laya.Handler.create(this, (res) => {
  2485. }), Laya.Handler.create(this, () => {
  2486. console.log("保存进度失败++");
  2487. }));
  2488. }
  2489. }
  2490. var on_off;
  2491. (function (on_off) {
  2492. on_off[on_off["on"] = 0] = "on";
  2493. on_off[on_off["off"] = 1] = "off";
  2494. })(on_off || (on_off = {}));
  2495. class Switch extends Laya.Script {
  2496. constructor() {
  2497. super();
  2498. this.kaiguan = on_off.off;
  2499. }
  2500. onAwake() {
  2501. this.CloseSprite = this.owner.getChildByName("close");
  2502. this.OpenSprite = this.owner.getChildByName("open");
  2503. this.Button = this.owner.getChildByName("btn");
  2504. this.Button.clickHandler = Laya.Handler.create(this, () => {
  2505. this.ChangeMode(this.kaiguan);
  2506. this.kaiguan++;
  2507. if (this.kaiguan > 1) {
  2508. this.kaiguan = 0;
  2509. }
  2510. }, null, false);
  2511. }
  2512. ListenOn_Off(on = true, OpenFunction = null, CloseFunction = null) {
  2513. this.kaiguan = on ? on_off.on : on_off.off;
  2514. this.OpenFunction = OpenFunction;
  2515. this.CloseFunction = CloseFunction;
  2516. this.ChangeMode(this.kaiguan);
  2517. this.kaiguan++;
  2518. if (this.kaiguan > 1) {
  2519. this.kaiguan = 0;
  2520. }
  2521. }
  2522. ChangeMode(_mode) {
  2523. switch (_mode) {
  2524. case on_off.off:
  2525. this.OpenSprite.visible = false;
  2526. this.CloseSprite.visible = true;
  2527. this.CloseFunction.run();
  2528. break;
  2529. case on_off.on:
  2530. this.OpenSprite.visible = true;
  2531. this.CloseSprite.visible = false;
  2532. this.OpenFunction.run();
  2533. break;
  2534. }
  2535. }
  2536. }
  2537. class SetView extends ui.SetViewUI {
  2538. constructor() {
  2539. super();
  2540. }
  2541. static get Instance() {
  2542. if (SetView.ins) {
  2543. return SetView.ins;
  2544. }
  2545. else {
  2546. return new SetView();
  2547. }
  2548. }
  2549. Show() {
  2550. this.userid.text = AccountManager.Instance.curplayerData.userId;
  2551. this.CloseBtn.clickHandler = Laya.Handler.create(this, this.ClickClose);
  2552. this.SoundSwitch = this.Sound.addComponent(Switch);
  2553. this.ShakeSwitch = this.Shake.addComponent(Switch);
  2554. this.SoundSwitch.ListenOn_Off(AudioManager.open, Laya.Handler.create(this, this.OpenSound, [true], false), Laya.Handler.create(this, this.OpenSound, [false], false));
  2555. this.ShakeSwitch.ListenOn_Off(WXSDK.shake, Laya.Handler.create(this, this.OpenShake, [true], false), Laya.Handler.create(this, this.OpenShake, [false], false));
  2556. this.height = Laya.stage.height;
  2557. Laya.stage.on(Laya.Event.RESIZE, this, () => {
  2558. this.height = Laya.stage.height;
  2559. });
  2560. }
  2561. Close() {
  2562. }
  2563. ClickClose() {
  2564. ViewManager.Instance.ShowView(ViewType.MainView);
  2565. }
  2566. OpenSound(_open) {
  2567. AudioManager.open = _open;
  2568. }
  2569. OpenShake(_open) {
  2570. WXSDK.shake = _open;
  2571. }
  2572. }
  2573. class RankView extends ui.RankViewUI {
  2574. constructor() {
  2575. super();
  2576. }
  2577. static get Instance() {
  2578. if (RankView.ins) {
  2579. return RankView.ins;
  2580. }
  2581. else {
  2582. return new RankView();
  2583. }
  2584. }
  2585. Show() {
  2586. this.CloseBtn.clickHandler = Laya.Handler.create(this, this.ClickClose);
  2587. this.height = Laya.stage.height;
  2588. Laya.stage.on(Laya.Event.RESIZE, this, () => {
  2589. this.height = Laya.stage.height;
  2590. });
  2591. }
  2592. Close() {
  2593. }
  2594. ClickClose() {
  2595. ViewManager.Instance.ShowView(ViewType.MainView);
  2596. }
  2597. }
  2598. class GuangGao {
  2599. static InitId() {
  2600. }
  2601. static JiaZaiShiPin() {
  2602. if (this.afsfsaafsfsa)
  2603. return;
  2604. if (!Laya.Browser.onWeiXin)
  2605. return;
  2606. this.fsaasfafssfa = Laya.Browser.window.wx.createRewardedVideoAd({ adUnitId: this.videlAdUnitId });
  2607. this.fsaasfafssfa.onLoad(() => {
  2608. console.log('激励视频 广告加载成功');
  2609. this.asfasfsaffsa = true;
  2610. });
  2611. this.fsaasfafssfa.onError(err => {
  2612. console.log("激励视屏加载失败:" + err);
  2613. this.asfasfsaffsa = false;
  2614. });
  2615. this.afsfasfasasf = 0;
  2616. this.afsfsaafsfsa = true;
  2617. }
  2618. static KaiShiPin(callback) {
  2619. if (Laya.Browser.onWeiXin) {
  2620. console.log("showVideoAd , asfasfsaffsa:" + this.asfasfsaffsa);
  2621. if (AccountManager.Instance.curplayerData.videoshare && AccountManager.Instance.curplayerData.fenxiang) ;
  2622. if (AccountManager.Instance.curplayerData.video == false) {
  2623. WXSDK.ShowTxt("暂未开放");
  2624. return;
  2625. }
  2626. this.fassfafasafs(callback);
  2627. this.fsaasfafssfa.show().catch(err => {
  2628. this.fsaasfafssfa.load().then(() => {
  2629. this.fassfafasafs(callback);
  2630. this.fsaasfafssfa.show();
  2631. });
  2632. });
  2633. }
  2634. else {
  2635. callback(false);
  2636. }
  2637. }
  2638. static fassfafasafs(callback) {
  2639. this.fsaasfafssfa.offClose();
  2640. this.fsaasfafssfa.onClose(res => {
  2641. console.log("激励视频关闭:" + res.isEnded);
  2642. if (res && res.isEnded || res === undefined) {
  2643. callback && callback(true);
  2644. }
  2645. else {
  2646. callback && callback(false);
  2647. }
  2648. this.fsaasfafssfa.offClose();
  2649. });
  2650. }
  2651. static OpenBanner(gap = 0, callVack = null, iswait = false) {
  2652. if (!Laya.Browser.onWeiXin)
  2653. return;
  2654. if (this.afsfasfasasf >= 10000) {
  2655. var hh = this.gasagsgasgsa(gap);
  2656. if (iswait) {
  2657. this.asgagassga.hide();
  2658. Laya.timer.once(AccountManager.Instance.curplayerData.wudaoshijian * 1000, this, () => {
  2659. if (callVack != null) {
  2660. callVack(hh);
  2661. }
  2662. this.asgagassga.show();
  2663. });
  2664. }
  2665. else {
  2666. if (callVack != null) {
  2667. callVack(hh);
  2668. }
  2669. this.asgagassga.show();
  2670. }
  2671. }
  2672. else {
  2673. var idd = this.bannerAdUnitId;
  2674. console.log("adUnitId:" + idd);
  2675. let newBanner = Laya.Browser.window.wx.createBannerAd({
  2676. adUnitId: idd,
  2677. style: {
  2678. left: 0,
  2679. top: 0,
  2680. width: 460
  2681. }
  2682. });
  2683. newBanner.onError(err => {
  2684. console.log(err);
  2685. this.gasagsgasgsa(gap);
  2686. });
  2687. newBanner.onLoad(() => {
  2688. this.afsfasfasasf++;
  2689. if (this.asgagassga)
  2690. this.asgagassga.destroy();
  2691. this.asgagassga = newBanner;
  2692. var hight = this.gasagsgasgsa(gap);
  2693. if (iswait) {
  2694. this.asgagassga.hide();
  2695. Laya.timer.once(AccountManager.Instance.curplayerData.wudaoshijian * 1000, this, () => {
  2696. if (callVack != null) {
  2697. callVack(hight);
  2698. }
  2699. this.asgagassga.show();
  2700. });
  2701. }
  2702. else {
  2703. if (callVack != null) {
  2704. callVack(hight);
  2705. }
  2706. this.asgagassga.show();
  2707. }
  2708. });
  2709. }
  2710. }
  2711. static gasagsgasgsa(gap) {
  2712. if (this.asgagassga) {
  2713. let info = Laya.Browser.window.wx.getSystemInfoSync();
  2714. this.asgagassga.style.width = info.windowWidth;
  2715. this.asgagassga.style.top = info.windowHeight - this.asgagassga.style.realHeight - gap - 30;
  2716. return Laya.stage.height / info.windowHeight * this.asgagassga.style.realHeight;
  2717. }
  2718. }
  2719. static Clear() {
  2720. Laya.timer.clearAll(this);
  2721. if (!Laya.Browser.onWeiXin)
  2722. return;
  2723. if (this.asgagassga)
  2724. this.asgagassga.hide();
  2725. }
  2726. static agagsagags() {
  2727. if (!Laya.Browser.onWeiXin)
  2728. return;
  2729. if (this.asgagassga)
  2730. this.asgagassga.hide();
  2731. }
  2732. static gasagsasg() {
  2733. if (!Laya.Browser.onWeiXin)
  2734. return;
  2735. if (this.asgagassga)
  2736. this.asgagassga.show();
  2737. }
  2738. static get keyiwudao() {
  2739. var wudao = AccountManager.Instance.curplayerData.wudao;
  2740. if (wudao == false) {
  2741. console.log("cheat:" + wudao);
  2742. return false;
  2743. }
  2744. if (Main.SceneNum == "1037" || Main.SceneNum == "1007"
  2745. || Main.SceneNum == "1044" || Main.SceneNum == "1104"
  2746. || Main.SceneNum == "1089" || Main.SceneNum == "1001"
  2747. || Main.SceneNum == "00000") {
  2748. console.log("cheat:true-> " + Main.SceneNum);
  2749. return true;
  2750. }
  2751. else {
  2752. var checkscence = AccountManager.Instance.curplayerData.jiancechangjin;
  2753. if (checkscence == false) {
  2754. console.log("cheat:true->checkscence: " + checkscence);
  2755. return true;
  2756. }
  2757. }
  2758. console.log("cheat:false-> " + Main.SceneNum);
  2759. return false;
  2760. }
  2761. static WudaoAnNiu(btn, ShowBanner = true, complete = null, gap = 0) {
  2762. if (AccountManager.Instance.curplayerData.banner) {
  2763. GuangGao.agagsagags();
  2764. if (GuangGao.keyiwudao == false) {
  2765. btn.bottom = 300;
  2766. GuangGao.OpenBanner();
  2767. }
  2768. else {
  2769. if (ShowBanner) {
  2770. btn.bottom = 100;
  2771. btn.mouseEnabled = false;
  2772. console.log("bottom:100");
  2773. GuangGao.OpenBanner(gap, (height) => {
  2774. if (height == null) {
  2775. console.log("展示互推位");
  2776. }
  2777. else {
  2778. var end = Laya.stage.height - height - btn.height;
  2779. btn.y = end;
  2780. btn.bottom = NaN;
  2781. console.log("y:" + end);
  2782. }
  2783. }, true);
  2784. Laya.timer.once(AccountManager.Instance.curplayerData.wudaoshijian * 1000, this, () => {
  2785. btn.mouseEnabled = true;
  2786. if (complete != null) {
  2787. complete();
  2788. }
  2789. });
  2790. }
  2791. else {
  2792. if (complete != null) {
  2793. complete();
  2794. }
  2795. }
  2796. }
  2797. }
  2798. }
  2799. on3DComplete() {
  2800. var scene;
  2801. Laya.stage.addChild(scene);
  2802. var camera1 = new Laya.Camera();
  2803. scene.addChild(camera1);
  2804. camera1.transform.translate(new Laya.Vector3(0, 2, 8), true);
  2805. camera1.transform.rotate(new Laya.Vector3(-23, 0, 0), true, false);
  2806. camera1.viewport = new Laya.Viewport(0, 0, 640, 720);
  2807. var camera2 = new Laya.Camera();
  2808. scene.addChild(camera2);
  2809. camera2.transform.rotate(new Laya.Vector3(-45, 0, 0), false, false);
  2810. camera2.transform.translate(new Laya.Vector3(0, 0, 25), true);
  2811. camera2.viewport = new Laya.Viewport(640, 0, 640, 720);
  2812. }
  2813. onModelOK() {
  2814. var scene = new Laya.Scene();
  2815. Laya.stage.addChild(scene);
  2816. var camera = new Laya.Camera(0, 0.1, 1000);
  2817. scene.addChild(camera);
  2818. camera.transform.rotate(new Laya.Vector3(-25, 0, 0), false, false);
  2819. camera.transform.position = new Laya.Vector3(0, 5, 10);
  2820. var role3D = Laya.loader.getRes("monkey/monkey.lh");
  2821. scene.addChild(role3D);
  2822. }
  2823. }
  2824. GuangGao.videlAdUnitId = "adunit-47ace2391e74f21e";
  2825. GuangGao.bannerAdUnitId = "adunit-876b793421608933";
  2826. GuangGao.afsfsaafsfsa = false;
  2827. GuangGao.asfasfsaffsa = false;
  2828. GuangGao.afsfasfasasf = 0;
  2829. var QianDaoMode;
  2830. (function (QianDaoMode) {
  2831. QianDaoMode[QianDaoMode["start"] = 0] = "start";
  2832. QianDaoMode[QianDaoMode["none"] = 1] = "none";
  2833. QianDaoMode[QianDaoMode["end"] = 2] = "end";
  2834. })(QianDaoMode || (QianDaoMode = {}));
  2835. class reward {
  2836. constructor(_rewradid, _rewradnum) {
  2837. this.rewardid = _rewradid;
  2838. this.rewardnum = _rewradnum;
  2839. }
  2840. }
  2841. class SignItem {
  2842. get GetRewardData() {
  2843. var data = this.rewardids.split(";");
  2844. if (data.length > 1) {
  2845. return new reward(Number(6000), Number(1));
  2846. }
  2847. else {
  2848. return new reward(Number(this.rewardids), Number(this.rewardnum));
  2849. }
  2850. }
  2851. }
  2852. class SignView extends ui.SignViewUI {
  2853. constructor() {
  2854. super();
  2855. this.SignDatas = [];
  2856. this.rewardsdic = {};
  2857. SignView.ins = this;
  2858. }
  2859. static get Instance() {
  2860. if (SignView.ins) {
  2861. return SignView.ins;
  2862. }
  2863. else {
  2864. return new SignView();
  2865. }
  2866. }
  2867. Show() {
  2868. this.SignDatas = this.GainSignDatas();
  2869. this.RefreshDatas();
  2870. this.SignBtn.visible = SignView.CanSign;
  2871. this.SignBtn.clickHandler = Laya.Handler.create(this, this.OnNormalSign);
  2872. this.CloseBtn.clickHandler = Laya.Handler.create(this, this.ClickClose);
  2873. this.height = Laya.stage.height;
  2874. Laya.stage.on(Laya.Event.RESIZE, this, () => {
  2875. this.height = Laya.stage.height;
  2876. });
  2877. }
  2878. Close() {
  2879. }
  2880. ClickClose() {
  2881. ViewManager.Instance.ShowView(ViewType.MainView);
  2882. }
  2883. RefreshDatas() {
  2884. for (var i = 0; i < this.ItemList.numChildren; i++) {
  2885. var sign = this.ItemList.getChildAt(i);
  2886. var data = this.SignDatas[i];
  2887. var rewardid = data.GetRewardData.rewardid;
  2888. var icon = sign.getChildByName("icon");
  2889. var num = sign.getChildByName("icon").getChildByName("num");
  2890. num.text = "X" + data.GetRewardData.rewardnum.toString();
  2891. var roleicon = AccountManager.Instance.curplayerData.GainShiTi(rewardid.toString(), "icon");
  2892. icon.skin = "Game/res/Skin/" + roleicon + ".png";
  2893. var cansign = data.mold;
  2894. if (cansign == QianDaoMode.end) {
  2895. var complete = sign.getChildByName("complete");
  2896. complete.visible = true;
  2897. }
  2898. else if (cansign == QianDaoMode.start) {
  2899. var btn = sign.getChildByName("btn");
  2900. btn.clickHandler = Laya.Handler.create(this, this.OnDoubleSign, null, false);
  2901. }
  2902. }
  2903. }
  2904. OnSign() {
  2905. var curgold = Number(AccountManager.Instance.curplayerData.GainAccount("money"));
  2906. let param = [{ "video": "0" }];
  2907. ServerManager.Instance.SendHttp(BlastToMerge.QianDao, param, Laya.Handler.create(this, function (e) {
  2908. var reward = e["rewards"];
  2909. SignView.Instance.SignDatas = SignView.Instance.GainSignDatas();
  2910. SignView.Instance.SignBtn.visible = false;
  2911. SignView.Instance.RefreshDatas();
  2912. if (reward["1000"]) {
  2913. var gg = Number(AccountManager.Instance.curplayerData.GainAccount("money")) - curgold;
  2914. GameTools.GetMoney(gg, null, Laya.Handler.create(this, () => {
  2915. ViewManager.Instance.ShowView(ViewType.MainView);
  2916. }));
  2917. }
  2918. else {
  2919. GameTools.TweenText(new faafssfafsa("道具 + 1", new Laya.Vector2(Laya.stage.width / 2, Laya.stage.height * 0.35), new Laya.Vector2(250, 80), 30), 150, Laya.Handler.create(this, () => {
  2920. ViewManager.Instance.ShowView(ViewType.MainView);
  2921. }));
  2922. }
  2923. }), Laya.Handler.create(this, this.OnSignError), true);
  2924. }
  2925. OnNormalSign() {
  2926. this.OnSign();
  2927. }
  2928. OnDoubleSign() {
  2929. GuangGao.KaiShiPin((flag) => {
  2930. if (flag) {
  2931. let param = [{ "video": "1" }];
  2932. ServerManager.Instance.SendHttp(BlastToMerge.QianDao, param, Laya.Handler.create(this, function (e) {
  2933. var reward = e["rewards"];
  2934. SignView.Instance.SignDatas = SignView.Instance.GainSignDatas();
  2935. SignView.Instance.SignBtn.visible = false;
  2936. SignView.Instance.RefreshDatas();
  2937. GameTools.TweenText(new faafssfafsa("道具 + 1", new Laya.Vector2(Laya.stage.width / 2, Laya.stage.height * 0.35), new Laya.Vector2(250, 80), 30), 150, Laya.Handler.create(this, () => {
  2938. ViewManager.Instance.ShowView(ViewType.MainView);
  2939. }));
  2940. }), Laya.Handler.create(this, this.OnSignError), true);
  2941. }
  2942. });
  2943. }
  2944. OnSignError(e) {
  2945. console.log(e);
  2946. }
  2947. GainSignDatas() {
  2948. var signdatas = [];
  2949. var config = AccountManager.Instance.curplayerData.GainCollocation("sign");
  2950. var signday = Number(AccountManager.Instance.curplayerData.GainQinDao("sign_days"));
  2951. var once = signday < 7;
  2952. var indes = once ? 0 : 7;
  2953. for (var i = indes; i < indes + 7; i++) {
  2954. this.rewardsdic[config[i].id] = config[i].rewards;
  2955. }
  2956. for (var key in this.rewardsdic) {
  2957. var rewardid = this.rewardsdic[key];
  2958. var reward = AccountManager.Instance.curplayerData.GainJiangLi(rewardid);
  2959. var item = new SignItem();
  2960. item.desc = reward.group_name;
  2961. item.icon = reward.icon;
  2962. item.signday = Number(reward.id);
  2963. item.rewardids = reward.reward_item;
  2964. item.rewardnum = reward.reward_num;
  2965. item.weight = reward.reward_weight;
  2966. var num = Number(key);
  2967. if (signday > num - 1)
  2968. item.mold = QianDaoMode.end;
  2969. if (signday < num - 1)
  2970. item.mold = QianDaoMode.none;
  2971. if (signday == num - 1 && SignView.CanSign) {
  2972. item.mold = QianDaoMode.start;
  2973. }
  2974. signdatas.push(item);
  2975. }
  2976. return signdatas;
  2977. }
  2978. static get CanSign() {
  2979. let SSS = new Date(AccountManager.Instance.ServerTime * 1000);
  2980. SSS.setHours(0, 0, 0, 0);
  2981. var AAA = SSS.valueOf();
  2982. var SignTime = Number(AccountManager.Instance.curplayerData.GainQinDao("sign_time"));
  2983. var DDD = SignTime * 1000;
  2984. var TTT = DDD < AAA ? true : false;
  2985. return TTT;
  2986. }
  2987. }
  2988. class LotteryView extends ui.LotteryViewUI {
  2989. constructor() {
  2990. super();
  2991. this.circleNum = 5;
  2992. }
  2993. static get Instance() {
  2994. if (LotteryView.ins) {
  2995. return LotteryView.ins;
  2996. }
  2997. else {
  2998. return new LotteryView();
  2999. }
  3000. }
  3001. Show() {
  3002. this.CloseBtn.clickHandler = Laya.Handler.create(this, this.ClickClose);
  3003. this.LotteryBtn.clickHandler = Laya.Handler.create(this, this.OnVedio);
  3004. this.height = Laya.stage.height;
  3005. Laya.stage.on(Laya.Event.RESIZE, this, () => {
  3006. this.height = Laya.stage.height;
  3007. });
  3008. }
  3009. Close() {
  3010. }
  3011. ClickClose() {
  3012. ViewManager.Instance.ShowView(ViewType.MainView);
  3013. }
  3014. OnVedio() {
  3015. GuangGao.KaiShiPin((flag) => {
  3016. if (flag) {
  3017. this.LotteryBtn.visible = false;
  3018. let param = [{ "channel": "video" }, { "t": AccountManager.Instance.ServerTime.toString() }];
  3019. ServerManager.Instance.SendHttp(BlastToMerge.Lottery, param, Laya.Handler.create(this, function (e) {
  3020. this.RotationDial(e);
  3021. }), Laya.Handler.create(this, () => {
  3022. WXSDK.ShowTxt("抽奖次数已经用完!");
  3023. }), true);
  3024. }
  3025. });
  3026. }
  3027. RotationDial(e) {
  3028. var result = e.lottery_id - 1;
  3029. this.dial.rotation = 0;
  3030. let tween = Laya.Tween.to(this.dial, {
  3031. rotation: 360 * (this.circleNum) - result * 60
  3032. }, 5000, Laya.Ease.quadInOut, new Laya.Handler(null, () => {
  3033. tween.clear();
  3034. this.LotteryBtn.visible = true;
  3035. if (!LotteryView.IsCanLottery()) {
  3036. this.LotteryBtn.gray = true;
  3037. console.log("观看视频抽奖按钮已变灰");
  3038. }
  3039. var reward = e["rewards"];
  3040. GameTools.TweenText(new faafssfafsa("道具 + 1", new Laya.Vector2(Laya.stage.width / 2, Laya.stage.height * 0.35), new Laya.Vector2(250, 80), 30), 150, Laya.Handler.create(this, () => {
  3041. ViewManager.Instance.ShowView(ViewType.MainView);
  3042. }));
  3043. }));
  3044. }
  3045. static IsCanLottery() {
  3046. var _timer = Number(AccountManager.Instance.curplayerData.lottery.day_video_times);
  3047. return _timer > 0;
  3048. }
  3049. }
  3050. class FailureView extends ui.FailureViewUI {
  3051. constructor() {
  3052. super();
  3053. }
  3054. static get Instance() {
  3055. if (FailureView.ins) {
  3056. return FailureView.ins;
  3057. }
  3058. else {
  3059. return new FailureView();
  3060. }
  3061. }
  3062. Show() {
  3063. this.BackBtn.clickHandler = Laya.Handler.create(this, this.ClickBack);
  3064. this.TryBtn.clickHandler = Laya.Handler.create(this, this.ClickTry);
  3065. this.height = Laya.stage.height;
  3066. this.BG.height = Laya.stage.height;
  3067. Laya.stage.on(Laya.Event.RESIZE, this, () => {
  3068. this.height = Laya.stage.height;
  3069. this.BG.height = Laya.stage.height;
  3070. });
  3071. }
  3072. Close() {
  3073. Laya.timer.clearAll(this);
  3074. }
  3075. ClickBack() {
  3076. var args = [{ "t": AccountManager.Instance.ServerTime.toString() }, { "play_id": GameManager.Instance.play_id }, { "win": "0" }];
  3077. ServerManager.Instance.SendHttp(BlastToMerge.JieShu, args, Laya.Handler.create(this, this.BackMain), null);
  3078. }
  3079. ClickTry() {
  3080. var args = [{ "t": AccountManager.Instance.ServerTime.toString() }, { "play_id": GameManager.Instance.play_id }, { "win": "0" }];
  3081. ServerManager.Instance.SendHttp(BlastToMerge.JieShu, args, Laya.Handler.create(this, this.Try), null);
  3082. }
  3083. BackMain() {
  3084. EventManager.StageTrigger(StageMode.Over);
  3085. EventManager.StageTrigger(StageMode.Refresh);
  3086. ViewManager.Instance.ShowView(ViewType.MainView);
  3087. }
  3088. Try() {
  3089. ViewManager.Instance.ClosePopView(ViewType.FailureView);
  3090. EventManager.StageTrigger(StageMode.Refresh);
  3091. EventManager.StageTrigger(StageMode.ReStart);
  3092. }
  3093. }
  3094. class WinView extends ui.WinViewUI {
  3095. constructor() {
  3096. super();
  3097. }
  3098. static get Instance() {
  3099. if (WinView.ins) {
  3100. return WinView.ins;
  3101. }
  3102. else {
  3103. return new WinView();
  3104. }
  3105. }
  3106. Show() {
  3107. this.BackBtn.clickHandler = Laya.Handler.create(this, this.ClickBack);
  3108. this.NextBtn.clickHandler = Laya.Handler.create(this, this.ClickNextLevel);
  3109. this.height = Laya.stage.height;
  3110. this.BG.height = Laya.stage.height;
  3111. Laya.stage.on(Laya.Event.RESIZE, this, () => {
  3112. this.height = Laya.stage.height;
  3113. this.BG.height = Laya.stage.height;
  3114. });
  3115. }
  3116. Close() {
  3117. Laya.timer.clearAll(this);
  3118. }
  3119. ClickBack() {
  3120. var args = [{ "t": AccountManager.Instance.ServerTime.toString() }, { "play_id": GameManager.Instance.play_id }, { "win": "1" }];
  3121. ServerManager.Instance.SendHttp(BlastToMerge.JieShu, args, Laya.Handler.create(this, this.BackMain), null);
  3122. }
  3123. ClickNextLevel() {
  3124. var args = [{ "t": AccountManager.Instance.ServerTime.toString() }, { "play_id": GameManager.Instance.play_id }, { "win": "1" }];
  3125. ServerManager.Instance.SendHttp(BlastToMerge.JieShu, args, Laya.Handler.create(this, this.NextLevel), null);
  3126. }
  3127. BackMain() {
  3128. EventManager.StageTrigger(StageMode.Over);
  3129. EventManager.StageTrigger(StageMode.Refresh);
  3130. ViewManager.Instance.ShowView(ViewType.MainView);
  3131. let level = DropRule.Instance.STAGE;
  3132. WXSDK.UpdateScore(level);
  3133. }
  3134. NextLevel() {
  3135. var agrs = [{ "t": AccountManager.Instance.ServerTime.toString() }];
  3136. ServerManager.Instance.SendHttp(BlastToMerge.KaiShi, agrs, Laya.Handler.create(this, this.StartNextLevel), null);
  3137. }
  3138. StartNextLevel(_data) {
  3139. ViewManager.Instance.ClosePopView(ViewType.WinView);
  3140. let stage = AccountManager.Instance.curplayerData.GainAccount("stage");
  3141. GameManager.Instance.play_id = _data.play_id;
  3142. DropRule.Instance.STAGE = Number(AccountManager.Instance.curplayerData.GainAccount("stage"));
  3143. EventManager.StageTrigger(StageMode.Refresh, [true]);
  3144. EventManager.StageTrigger(StageMode.ReStart, [true]);
  3145. let level = DropRule.Instance.STAGE;
  3146. WXSDK.UpdateScore(level);
  3147. }
  3148. }
  3149. class ReviveView extends ui.ReviveViewUI {
  3150. constructor() {
  3151. super();
  3152. this.time = 9;
  3153. this.count = false;
  3154. this.fuhuo = false;
  3155. }
  3156. static get Instance() {
  3157. if (ReviveView.ins) {
  3158. return ReviveView.ins;
  3159. }
  3160. else {
  3161. return new ReviveView();
  3162. }
  3163. }
  3164. Show() {
  3165. this.VideoBtn.clickHandler = Laya.Handler.create(this, this.VideoRevive);
  3166. this.NoBtn.visible = false;
  3167. Laya.timer.once(1000, this, () => {
  3168. this.NoBtn.visible = true;
  3169. this.NoBtn.clickHandler = Laya.Handler.create(this, this.DontRevive, null, false);
  3170. });
  3171. this.count = true;
  3172. Laya.timer.loop(1000, this, this.CountTime);
  3173. this.height = Laya.stage.height;
  3174. this.BG.height = Laya.stage.height;
  3175. Laya.stage.on(Laya.Event.RESIZE, this, () => {
  3176. this.height = Laya.stage.height;
  3177. this.BG.height = Laya.stage.height;
  3178. });
  3179. }
  3180. CountTime() {
  3181. if (this.count && this.time > 0) {
  3182. this.time -= 1;
  3183. this.Time.text = this.time.toString();
  3184. if (this.time < 1) {
  3185. Laya.timer.clear(this, this.CountTime);
  3186. this.DontRevive();
  3187. }
  3188. }
  3189. }
  3190. DontRevive() {
  3191. Laya.timer.clear(this, this.CountTime);
  3192. this.count = false;
  3193. ViewManager.Instance.ClosePopView(ViewType.ReviveView);
  3194. ViewManager.Instance.OpenPopView(ViewType.FailureView);
  3195. }
  3196. VideoRevive() {
  3197. Laya.timer.clear(this, this.CountTime);
  3198. this.count = false;
  3199. EventManager.StageTrigger(StageMode.Revive);
  3200. ViewManager.Instance.ClearPopViews();
  3201. }
  3202. Close() {
  3203. Laya.timer.clearAll(this);
  3204. }
  3205. }
  3206. var ViewType;
  3207. (function (ViewType) {
  3208. ViewType[ViewType["MainView"] = 0] = "MainView";
  3209. ViewType[ViewType["SignView"] = 1] = "SignView";
  3210. ViewType[ViewType["SetView"] = 2] = "SetView";
  3211. ViewType[ViewType["LotteryView"] = 3] = "LotteryView";
  3212. ViewType[ViewType["InGameView"] = 4] = "InGameView";
  3213. ViewType[ViewType["RankView"] = 5] = "RankView";
  3214. ViewType[ViewType["WinView"] = 6] = "WinView";
  3215. ViewType[ViewType["FailureView"] = 7] = "FailureView";
  3216. ViewType[ViewType["ReviveView"] = 8] = "ReviveView";
  3217. })(ViewType || (ViewType = {}));
  3218. class ViewManager {
  3219. constructor() {
  3220. this.ViewDic = [];
  3221. this.OtherViewDic = [];
  3222. this.ViewSprite = new Laya.Sprite;
  3223. this.OtherViewSprite = new Laya.Sprite;
  3224. ViewManager.ins = this;
  3225. this.Init();
  3226. }
  3227. static get Instance() {
  3228. if (ViewManager.ins) {
  3229. return ViewManager.ins;
  3230. }
  3231. else {
  3232. return new ViewManager();
  3233. }
  3234. }
  3235. Init() {
  3236. this.ViewDic[ViewType.MainView] = MainView;
  3237. this.ViewDic[ViewType.SignView] = SignView;
  3238. this.ViewDic[ViewType.SetView] = SetView;
  3239. this.ViewDic[ViewType.LotteryView] = LotteryView;
  3240. this.ViewDic[ViewType.InGameView] = InGameView;
  3241. this.ViewDic[ViewType.RankView] = RankView;
  3242. this.ViewDic[ViewType.WinView] = WinView;
  3243. this.ViewDic[ViewType.FailureView] = FailureView;
  3244. this.ViewDic[ViewType.ReviveView] = ReviveView;
  3245. Laya.stage.addChild(this.ViewSprite);
  3246. Laya.stage.addChild(this.OtherViewSprite);
  3247. }
  3248. ShowView(_viewtype, data = null) {
  3249. if (this.curView != null) {
  3250. this.curView.Close();
  3251. this.curView.destroy();
  3252. this.curView.removeSelf();
  3253. }
  3254. this.ClearPopViews();
  3255. this.curView = this.CreateView(_viewtype);
  3256. this.curView.name = ViewType[_viewtype];
  3257. this.ViewSprite.addChild(this.curView);
  3258. this.curView.Show(data);
  3259. }
  3260. CloseView() {
  3261. if (this.curView != null) {
  3262. this.curView.Close();
  3263. this.curView.destroy();
  3264. this.curView.removeSelf();
  3265. }
  3266. }
  3267. OpenPopView(viewType, data = null) {
  3268. GuangGao.Clear();
  3269. var popView;
  3270. if (this.OtherViewDic[viewType]) {
  3271. popView = this.OtherViewDic[viewType];
  3272. this.OtherViewSprite.setChildIndex(popView, this.OtherViewSprite.numChildren - 1);
  3273. popView.visible = true;
  3274. }
  3275. else {
  3276. popView = this.CreateView(viewType);
  3277. this.OtherViewSprite.addChild(popView);
  3278. this.OtherViewDic[viewType] = popView;
  3279. }
  3280. popView.Show(data);
  3281. }
  3282. ClosePopView(viewType) {
  3283. var popView = this.OtherViewDic[viewType];
  3284. if (popView == null) {
  3285. return;
  3286. }
  3287. GuangGao.Clear();
  3288. popView.Close();
  3289. popView.visible = false;
  3290. }
  3291. ClearPopViews() {
  3292. GuangGao.Clear();
  3293. this.ClosePopView(ViewType.WinView);
  3294. this.ClosePopView(ViewType.FailureView);
  3295. this.ClosePopView(ViewType.ReviveView);
  3296. }
  3297. CreateView(_viewtype) {
  3298. switch (_viewtype) {
  3299. case ViewType.MainView:
  3300. return new MainView();
  3301. case ViewType.InGameView:
  3302. return new InGameView();
  3303. case ViewType.SetView:
  3304. return new SetView();
  3305. case ViewType.RankView:
  3306. return new RankView();
  3307. case ViewType.SignView:
  3308. return new SignView();
  3309. case ViewType.LotteryView:
  3310. return new LotteryView();
  3311. case ViewType.FailureView:
  3312. return new FailureView();
  3313. case ViewType.WinView:
  3314. return new WinView();
  3315. case ViewType.ReviveView:
  3316. return new ReviveView();
  3317. }
  3318. return null;
  3319. }
  3320. }
  3321. class GameControl {
  3322. constructor() {
  3323. GameControl.ins = this;
  3324. this.Init();
  3325. }
  3326. static get Instance() {
  3327. if (GameControl.ins) {
  3328. return GameControl.ins;
  3329. }
  3330. else {
  3331. return new GameControl();
  3332. }
  3333. }
  3334. Init() {
  3335. EventManager.StageOn(StageMode.Start, this, this.GameStart);
  3336. EventManager.StageOn(StageMode.Lose, this, this.GameLose);
  3337. EventManager.StageOn(StageMode.Win, this, this.GameWin);
  3338. }
  3339. GameStart() {
  3340. ViewManager.Instance.ShowView(ViewType.InGameView);
  3341. if (DropRule.Instance.STAGE == 1) {
  3342. DropRule.Instance.GuideFallDown();
  3343. return;
  3344. }
  3345. if (DropRule.Instance.progress.length > 1 && GameManager.Instance.First) {
  3346. DropRule.Instance.RecoverScene();
  3347. GameManager.Instance.First = false;
  3348. }
  3349. else {
  3350. DropRule.Instance.FallDown(DropRule.Instance.StartNum);
  3351. }
  3352. }
  3353. GameLose() {
  3354. if (GameManager.Instance.ReviveNum > 0) {
  3355. ViewManager.Instance.OpenPopView(ViewType.ReviveView);
  3356. GameManager.Instance.ReviveNum--;
  3357. }
  3358. else {
  3359. ViewManager.Instance.OpenPopView(ViewType.FailureView);
  3360. }
  3361. }
  3362. GameWin() {
  3363. ViewManager.Instance.OpenPopView(ViewType.WinView);
  3364. }
  3365. }
  3366. class LoadView {
  3367. constructor() {
  3368. this.Login();
  3369. new GameControl();
  3370. new GameManager();
  3371. }
  3372. static get Instance() {
  3373. if (LoadView.ins) {
  3374. return LoadView.ins;
  3375. }
  3376. else {
  3377. return new LoadView();
  3378. }
  3379. }
  3380. Login() {
  3381. if (Laya.Browser.onWeiXin) {
  3382. this.WXLogin();
  3383. }
  3384. else {
  3385. this.LocalLogin();
  3386. }
  3387. }
  3388. WXLogin() {
  3389. if (Laya.Browser.onWeiXin) {
  3390. WXSDK.DengLu((res) => {
  3391. if (res != "error") {
  3392. console.log("1微信登录成功:" + res);
  3393. this.LocalLogin();
  3394. }
  3395. else {
  3396. this.WXLogin();
  3397. }
  3398. });
  3399. }
  3400. else {
  3401. this.LocalLogin();
  3402. ServerManager.Instance.Login(null, Laya.Handler.create(this, this.LoginComplete), Laya.Handler.create(this, this.LoginFail));
  3403. }
  3404. }
  3405. LocalLogin() {
  3406. ServerManager.Instance.Login(null, Laya.Handler.create(this, this.LoginComplete), Laya.Handler.create(this, this.LoginFail));
  3407. }
  3408. LoginComplete() {
  3409. console.log("本地服务器登陆成功");
  3410. this.LoadSubPackage();
  3411. }
  3412. LoginFail(e) {
  3413. console.log("本地服务器登陆失败");
  3414. console.log(e);
  3415. }
  3416. LoadSubPackage() {
  3417. WXSDK.LoadSubPackage("Game", callback => {
  3418. if (callback) {
  3419. new DropRule();
  3420. ViewManager.Instance.ShowView(ViewType.MainView);
  3421. }
  3422. });
  3423. }
  3424. }
  3425. class Main$1 {
  3426. constructor() {
  3427. if (CheckMain.Creat)
  3428. return;
  3429. CheckMain.Creat = true;
  3430. if (window["Laya3D"])
  3431. Laya3D.init(GameConfig.width, GameConfig.height);
  3432. else
  3433. Laya.init(GameConfig.width, GameConfig.height, Laya["WebGL"]);
  3434. Laya["Physics"] && Laya["Physics"].enable();
  3435. Laya["DebugPanel"] && Laya["DebugPanel"].enable();
  3436. Laya.stage.scaleMode = GameConfig.scaleMode;
  3437. Laya.stage.screenMode = GameConfig.screenMode;
  3438. Laya.stage.alignV = GameConfig.alignV;
  3439. Laya.stage.alignH = GameConfig.alignH;
  3440. Laya.URL.exportSceneToJson = GameConfig.exportSceneToJson;
  3441. if (GameConfig.debug || Laya.Utils.getQueryString("debug") == "true")
  3442. Laya.enableDebugPanel();
  3443. if (GameConfig.physicsDebug && Laya["PhysicsDebugDraw"])
  3444. Laya["PhysicsDebugDraw"].enable();
  3445. if (GameConfig.stat)
  3446. Laya.Stat.show();
  3447. Laya.alertGlobalError = true;
  3448. if (Laya.Browser.onWeiXin) {
  3449. Laya.Browser.window.wx.showShareMenu({
  3450. withShareTicket: true
  3451. });
  3452. Laya.Browser.window.wx.onShareAppMessage(function () {
  3453. return {
  3454. title: "试一下你的脑力能到第几关",
  3455. imageUrl: "Game/res/Share/fx.png",
  3456. };
  3457. });
  3458. Laya.Browser.window.wx.onShow((option) => {
  3459. var shareTicket = option.shareTicket;
  3460. var userId = option.query.userId;
  3461. var shareTitle = option.query.shareTitle;
  3462. Main$1.SceneNum = option.scene;
  3463. WXSDK.querychannel = option.query.channel;
  3464. WXSDK.shareOpenId = option.query.userId;
  3465. console.log("option---", option);
  3466. console.log("scene:", option.scene);
  3467. if (WXSDK.querychannel != null) {
  3468. console.log("onShow channel is:", WXSDK.querychannel);
  3469. }
  3470. if (option.referrerInfo) {
  3471. WXSDK.referrerInfoappId = option.referrerInfo.appId;
  3472. console.log("onShow appId is:", option.referrerInfo.appId);
  3473. }
  3474. });
  3475. const updateManager = Laya.Browser.window.wx.getUpdateManager();
  3476. updateManager.onCheckForUpdate(function (res) {
  3477. console.log("最新版本:" + res.hasUpdate);
  3478. });
  3479. updateManager.onUpdateReady(function () {
  3480. Laya.Browser.window.wx.showModal({
  3481. showCancel: false,
  3482. title: '更新提示',
  3483. content: '新版本已经准备好,是否重启应用?',
  3484. success(res) {
  3485. updateManager.applyUpdate();
  3486. },
  3487. fail(res) {
  3488. updateManager.applyUpdate();
  3489. }
  3490. });
  3491. });
  3492. }
  3493. Laya.ResourceVersion.enable("version.json", Laya.Handler.create(this, this.onVersionLoaded), Laya.ResourceVersion.FILENAME_VERSION);
  3494. }
  3495. onVersionLoaded() {
  3496. Laya.AtlasInfoManager.enable("fileconfig.json", Laya.Handler.create(this, this.onConfigLoaded));
  3497. }
  3498. onConfigLoaded() {
  3499. new LoadView();
  3500. }
  3501. }
  3502. Main$1.Ver = "1.0.0";
  3503. Main$1.CFG = "123";
  3504. Main$1.SceneNum = "000";
  3505. new Main$1();
  3506. exports.Main = Main$1;
  3507. return exports;
  3508. }({}));
  3509. //# sourceMappingURL=bundle.js.map