bundle.js 217 KB

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