bundle.js 333 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996997998999100010011002100310041005100610071008100910101011101210131014101510161017101810191020102110221023102410251026102710281029103010311032103310341035103610371038103910401041104210431044104510461047104810491050105110521053105410551056105710581059106010611062106310641065106610671068106910701071107210731074107510761077107810791080108110821083108410851086108710881089109010911092109310941095109610971098109911001101110211031104110511061107110811091110111111121113111411151116111711181119112011211122112311241125112611271128112911301131113211331134113511361137113811391140114111421143114411451146114711481149115011511152115311541155115611571158115911601161116211631164116511661167116811691170117111721173117411751176117711781179118011811182118311841185118611871188118911901191119211931194119511961197119811991200120112021203120412051206120712081209121012111212121312141215121612171218121912201221122212231224122512261227122812291230123112321233123412351236123712381239124012411242124312441245124612471248124912501251125212531254125512561257125812591260126112621263126412651266126712681269127012711272127312741275127612771278127912801281128212831284128512861287128812891290129112921293129412951296129712981299130013011302130313041305130613071308130913101311131213131314131513161317131813191320132113221323132413251326132713281329133013311332133313341335133613371338133913401341134213431344134513461347134813491350135113521353135413551356135713581359136013611362136313641365136613671368136913701371137213731374137513761377137813791380138113821383138413851386138713881389139013911392139313941395139613971398139914001401140214031404140514061407140814091410141114121413141414151416141714181419142014211422142314241425142614271428142914301431143214331434143514361437143814391440144114421443144414451446144714481449145014511452145314541455145614571458145914601461146214631464146514661467146814691470147114721473147414751476147714781479148014811482148314841485148614871488148914901491149214931494149514961497149814991500150115021503150415051506150715081509151015111512151315141515151615171518151915201521152215231524152515261527152815291530153115321533153415351536153715381539154015411542154315441545154615471548154915501551155215531554155515561557155815591560156115621563156415651566156715681569157015711572157315741575157615771578157915801581158215831584158515861587158815891590159115921593159415951596159715981599160016011602160316041605160616071608160916101611161216131614161516161617161816191620162116221623162416251626162716281629163016311632163316341635163616371638163916401641164216431644164516461647164816491650165116521653165416551656165716581659166016611662166316641665166616671668166916701671167216731674167516761677167816791680168116821683168416851686168716881689169016911692169316941695169616971698169917001701170217031704170517061707170817091710171117121713171417151716171717181719172017211722172317241725172617271728172917301731173217331734173517361737173817391740174117421743174417451746174717481749175017511752175317541755175617571758175917601761176217631764176517661767176817691770177117721773177417751776177717781779178017811782178317841785178617871788178917901791179217931794179517961797179817991800180118021803180418051806180718081809181018111812181318141815181618171818181918201821182218231824182518261827182818291830183118321833183418351836183718381839184018411842184318441845184618471848184918501851185218531854185518561857185818591860186118621863186418651866186718681869187018711872187318741875187618771878187918801881188218831884188518861887188818891890189118921893189418951896189718981899190019011902190319041905190619071908190919101911191219131914191519161917191819191920192119221923192419251926192719281929193019311932193319341935193619371938193919401941194219431944194519461947194819491950195119521953195419551956195719581959196019611962196319641965196619671968196919701971197219731974197519761977197819791980198119821983198419851986198719881989199019911992199319941995199619971998199920002001200220032004200520062007200820092010201120122013201420152016201720182019202020212022202320242025202620272028202920302031203220332034203520362037203820392040204120422043204420452046204720482049205020512052205320542055205620572058205920602061206220632064206520662067206820692070207120722073207420752076207720782079208020812082208320842085208620872088208920902091209220932094209520962097209820992100210121022103210421052106210721082109211021112112211321142115211621172118211921202121212221232124212521262127212821292130213121322133213421352136213721382139214021412142214321442145214621472148214921502151215221532154215521562157215821592160216121622163216421652166216721682169217021712172217321742175217621772178217921802181218221832184218521862187218821892190219121922193219421952196219721982199220022012202220322042205220622072208220922102211221222132214221522162217221822192220222122222223222422252226222722282229223022312232223322342235223622372238223922402241224222432244224522462247224822492250225122522253225422552256225722582259226022612262226322642265226622672268226922702271227222732274227522762277227822792280228122822283228422852286228722882289229022912292229322942295229622972298229923002301230223032304230523062307230823092310231123122313231423152316231723182319232023212322232323242325232623272328232923302331233223332334233523362337233823392340234123422343234423452346234723482349235023512352235323542355235623572358235923602361236223632364236523662367236823692370237123722373237423752376237723782379238023812382238323842385238623872388238923902391239223932394239523962397239823992400240124022403240424052406240724082409241024112412241324142415241624172418241924202421242224232424242524262427242824292430243124322433243424352436243724382439244024412442244324442445244624472448244924502451245224532454245524562457245824592460246124622463246424652466246724682469247024712472247324742475247624772478247924802481248224832484248524862487248824892490249124922493249424952496249724982499250025012502250325042505250625072508250925102511251225132514251525162517251825192520252125222523252425252526252725282529253025312532253325342535253625372538253925402541254225432544254525462547254825492550255125522553255425552556255725582559256025612562256325642565256625672568256925702571257225732574257525762577257825792580258125822583258425852586258725882589259025912592259325942595259625972598259926002601260226032604260526062607260826092610261126122613261426152616261726182619262026212622262326242625262626272628262926302631263226332634263526362637263826392640264126422643264426452646264726482649265026512652265326542655265626572658265926602661266226632664266526662667266826692670267126722673267426752676267726782679268026812682268326842685268626872688268926902691269226932694269526962697269826992700270127022703270427052706270727082709271027112712271327142715271627172718271927202721272227232724272527262727272827292730273127322733273427352736273727382739274027412742274327442745274627472748274927502751275227532754275527562757275827592760276127622763276427652766276727682769277027712772277327742775277627772778277927802781278227832784278527862787278827892790279127922793279427952796279727982799280028012802280328042805280628072808280928102811281228132814281528162817281828192820282128222823282428252826282728282829283028312832283328342835283628372838283928402841284228432844284528462847284828492850285128522853285428552856285728582859286028612862286328642865286628672868286928702871287228732874287528762877287828792880288128822883288428852886288728882889289028912892289328942895289628972898289929002901290229032904290529062907290829092910291129122913291429152916291729182919292029212922292329242925292629272928292929302931293229332934293529362937293829392940294129422943294429452946294729482949295029512952295329542955295629572958295929602961296229632964296529662967296829692970297129722973297429752976297729782979298029812982298329842985298629872988298929902991299229932994299529962997299829993000300130023003300430053006300730083009301030113012301330143015301630173018301930203021302230233024302530263027302830293030303130323033303430353036303730383039304030413042304330443045304630473048304930503051305230533054305530563057305830593060306130623063306430653066306730683069307030713072307330743075307630773078307930803081308230833084308530863087308830893090309130923093309430953096309730983099310031013102310331043105310631073108310931103111311231133114311531163117311831193120312131223123312431253126312731283129313031313132313331343135313631373138313931403141314231433144314531463147314831493150315131523153315431553156315731583159316031613162316331643165316631673168316931703171317231733174317531763177317831793180318131823183318431853186318731883189319031913192319331943195319631973198319932003201320232033204320532063207320832093210321132123213321432153216321732183219322032213222322332243225322632273228322932303231323232333234323532363237323832393240324132423243324432453246324732483249325032513252325332543255325632573258325932603261326232633264326532663267326832693270327132723273327432753276327732783279328032813282328332843285328632873288328932903291329232933294329532963297329832993300330133023303330433053306330733083309331033113312331333143315331633173318331933203321332233233324332533263327332833293330333133323333333433353336333733383339334033413342334333443345334633473348334933503351335233533354335533563357335833593360336133623363336433653366336733683369337033713372337333743375337633773378337933803381338233833384338533863387338833893390339133923393339433953396339733983399340034013402340334043405340634073408340934103411341234133414341534163417341834193420342134223423342434253426342734283429343034313432343334343435343634373438343934403441344234433444344534463447344834493450345134523453345434553456345734583459346034613462346334643465346634673468346934703471347234733474347534763477347834793480348134823483348434853486348734883489349034913492349334943495349634973498349935003501350235033504350535063507350835093510351135123513351435153516351735183519352035213522352335243525352635273528352935303531353235333534353535363537353835393540354135423543354435453546354735483549355035513552355335543555355635573558355935603561356235633564356535663567356835693570357135723573357435753576357735783579358035813582358335843585358635873588358935903591359235933594359535963597359835993600360136023603360436053606360736083609361036113612361336143615361636173618361936203621362236233624362536263627362836293630363136323633363436353636363736383639364036413642364336443645364636473648364936503651365236533654365536563657365836593660366136623663366436653666366736683669367036713672367336743675367636773678367936803681368236833684368536863687368836893690369136923693369436953696369736983699370037013702370337043705370637073708370937103711371237133714371537163717371837193720372137223723372437253726372737283729373037313732373337343735373637373738373937403741374237433744374537463747374837493750375137523753375437553756375737583759376037613762376337643765376637673768376937703771377237733774377537763777377837793780378137823783378437853786378737883789379037913792379337943795379637973798379938003801380238033804380538063807380838093810381138123813381438153816381738183819382038213822382338243825382638273828382938303831383238333834383538363837383838393840384138423843384438453846384738483849385038513852385338543855385638573858385938603861386238633864386538663867386838693870387138723873387438753876387738783879388038813882388338843885388638873888388938903891389238933894389538963897389838993900390139023903390439053906390739083909391039113912391339143915391639173918391939203921392239233924392539263927392839293930393139323933393439353936393739383939394039413942394339443945394639473948394939503951395239533954395539563957395839593960396139623963396439653966396739683969397039713972397339743975397639773978397939803981398239833984398539863987398839893990399139923993399439953996399739983999400040014002400340044005400640074008400940104011401240134014401540164017401840194020402140224023402440254026402740284029403040314032403340344035403640374038403940404041404240434044404540464047404840494050405140524053405440554056405740584059406040614062406340644065406640674068406940704071407240734074407540764077407840794080408140824083408440854086408740884089409040914092409340944095409640974098409941004101410241034104410541064107410841094110411141124113411441154116411741184119412041214122412341244125412641274128412941304131413241334134413541364137413841394140414141424143414441454146414741484149415041514152415341544155415641574158415941604161416241634164416541664167416841694170417141724173417441754176417741784179418041814182418341844185418641874188418941904191419241934194419541964197419841994200420142024203420442054206420742084209421042114212421342144215421642174218421942204221422242234224422542264227422842294230423142324233423442354236423742384239424042414242424342444245424642474248424942504251425242534254425542564257425842594260426142624263426442654266426742684269427042714272427342744275427642774278427942804281428242834284428542864287428842894290429142924293429442954296429742984299430043014302430343044305430643074308430943104311431243134314431543164317431843194320432143224323432443254326432743284329433043314332433343344335433643374338433943404341434243434344434543464347434843494350435143524353435443554356435743584359436043614362436343644365436643674368436943704371437243734374437543764377437843794380438143824383438443854386438743884389439043914392439343944395439643974398439944004401440244034404440544064407440844094410441144124413441444154416441744184419442044214422442344244425442644274428442944304431443244334434443544364437443844394440444144424443444444454446444744484449445044514452445344544455445644574458445944604461446244634464446544664467446844694470447144724473447444754476447744784479448044814482448344844485448644874488448944904491449244934494449544964497449844994500450145024503450445054506450745084509451045114512451345144515451645174518451945204521452245234524452545264527452845294530453145324533453445354536453745384539454045414542454345444545454645474548454945504551455245534554455545564557455845594560456145624563456445654566456745684569457045714572457345744575457645774578457945804581458245834584458545864587458845894590459145924593459445954596459745984599460046014602460346044605460646074608460946104611461246134614461546164617461846194620462146224623462446254626462746284629463046314632463346344635463646374638463946404641464246434644464546464647464846494650465146524653465446554656465746584659466046614662466346644665466646674668466946704671467246734674467546764677467846794680468146824683468446854686468746884689469046914692469346944695469646974698469947004701470247034704470547064707470847094710471147124713471447154716471747184719472047214722472347244725472647274728472947304731473247334734473547364737473847394740474147424743474447454746474747484749475047514752475347544755475647574758475947604761476247634764476547664767476847694770477147724773477447754776477747784779478047814782478347844785478647874788478947904791479247934794479547964797479847994800480148024803480448054806480748084809481048114812481348144815481648174818481948204821482248234824482548264827482848294830483148324833483448354836483748384839484048414842484348444845484648474848484948504851485248534854485548564857485848594860486148624863486448654866486748684869487048714872487348744875487648774878487948804881488248834884488548864887488848894890489148924893489448954896489748984899490049014902490349044905490649074908490949104911491249134914491549164917491849194920492149224923492449254926492749284929493049314932493349344935493649374938493949404941494249434944494549464947494849494950495149524953495449554956495749584959496049614962496349644965496649674968496949704971497249734974497549764977497849794980498149824983498449854986498749884989499049914992499349944995499649974998499950005001500250035004500550065007500850095010501150125013501450155016501750185019502050215022502350245025502650275028502950305031503250335034503550365037503850395040504150425043504450455046504750485049505050515052505350545055505650575058505950605061506250635064506550665067506850695070507150725073507450755076507750785079508050815082508350845085508650875088508950905091509250935094509550965097509850995100510151025103510451055106510751085109511051115112511351145115511651175118511951205121512251235124512551265127512851295130513151325133513451355136513751385139514051415142514351445145514651475148514951505151515251535154515551565157515851595160516151625163516451655166516751685169517051715172517351745175517651775178517951805181518251835184518551865187518851895190519151925193519451955196519751985199520052015202520352045205520652075208520952105211521252135214521552165217521852195220522152225223522452255226522752285229523052315232523352345235523652375238523952405241524252435244524552465247524852495250525152525253525452555256525752585259526052615262526352645265526652675268526952705271527252735274527552765277527852795280528152825283528452855286528752885289529052915292529352945295529652975298529953005301530253035304530553065307530853095310531153125313531453155316531753185319532053215322532353245325532653275328532953305331533253335334533553365337533853395340534153425343534453455346534753485349535053515352535353545355535653575358535953605361536253635364536553665367536853695370537153725373537453755376537753785379538053815382538353845385538653875388538953905391539253935394539553965397539853995400540154025403540454055406540754085409541054115412541354145415541654175418541954205421542254235424542554265427542854295430543154325433543454355436543754385439544054415442544354445445544654475448544954505451545254535454545554565457545854595460546154625463546454655466546754685469547054715472547354745475547654775478547954805481548254835484548554865487548854895490549154925493549454955496549754985499550055015502550355045505550655075508550955105511551255135514551555165517551855195520552155225523552455255526552755285529553055315532553355345535553655375538553955405541554255435544554555465547554855495550555155525553555455555556555755585559556055615562556355645565556655675568556955705571557255735574557555765577557855795580558155825583558455855586558755885589559055915592559355945595559655975598559956005601560256035604560556065607560856095610561156125613561456155616561756185619562056215622562356245625562656275628562956305631563256335634563556365637563856395640564156425643564456455646564756485649565056515652565356545655565656575658565956605661566256635664566556665667566856695670567156725673567456755676567756785679568056815682568356845685568656875688568956905691569256935694569556965697569856995700570157025703570457055706570757085709571057115712571357145715571657175718571957205721572257235724572557265727572857295730573157325733573457355736573757385739574057415742574357445745574657475748574957505751575257535754575557565757575857595760576157625763576457655766576757685769577057715772577357745775577657775778577957805781578257835784578557865787578857895790579157925793579457955796579757985799580058015802580358045805580658075808580958105811581258135814581558165817581858195820582158225823582458255826582758285829583058315832583358345835583658375838583958405841584258435844584558465847584858495850585158525853585458555856585758585859586058615862586358645865586658675868586958705871587258735874587558765877587858795880588158825883588458855886588758885889589058915892589358945895589658975898589959005901590259035904590559065907590859095910591159125913591459155916591759185919592059215922592359245925592659275928592959305931593259335934593559365937593859395940594159425943594459455946594759485949595059515952595359545955595659575958595959605961596259635964596559665967596859695970597159725973597459755976597759785979598059815982598359845985598659875988598959905991599259935994599559965997599859996000600160026003600460056006600760086009601060116012601360146015601660176018601960206021602260236024602560266027602860296030603160326033603460356036603760386039604060416042604360446045604660476048604960506051605260536054605560566057605860596060606160626063606460656066606760686069607060716072607360746075607660776078607960806081608260836084608560866087608860896090609160926093609460956096609760986099610061016102610361046105610661076108610961106111611261136114611561166117611861196120612161226123612461256126612761286129613061316132613361346135613661376138613961406141614261436144614561466147614861496150615161526153615461556156615761586159616061616162616361646165616661676168616961706171617261736174617561766177617861796180618161826183618461856186618761886189619061916192619361946195619661976198619962006201620262036204620562066207620862096210621162126213621462156216621762186219622062216222622362246225622662276228622962306231623262336234623562366237623862396240624162426243624462456246624762486249625062516252625362546255625662576258625962606261626262636264626562666267626862696270627162726273627462756276627762786279628062816282628362846285628662876288628962906291629262936294629562966297629862996300630163026303630463056306630763086309631063116312631363146315631663176318631963206321632263236324632563266327632863296330
  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 = "Window/SignWindow.scene";
  16. GameConfig.sceneRoot = "";
  17. GameConfig.debug = false;
  18. GameConfig.stat = false;
  19. GameConfig.physicsDebug = false;
  20. GameConfig.exportSceneToJson = true;
  21. GameConfig.init();
  22. var REG = Laya.ClassUtils.regClass;
  23. var ui;
  24. (function (ui) {
  25. var Window;
  26. (function (Window) {
  27. class FriendPlayingWindowUI extends Laya.Scene {
  28. constructor() { super(); }
  29. createChildren() {
  30. super.createChildren();
  31. this.createView(FriendPlayingWindowUI.uiView);
  32. }
  33. }
  34. FriendPlayingWindowUI.uiView = { "type": "Scene", "props": { "width": 720, "height": 1280 }, "compId": 2, "child": [{ "type": "Image", "props": { "x": 0, "width": 720, "top": 0, "skin": "local/paiwei_xin_1_1.png", "bottom": 0, "sizeGrid": "50,50,50,50" }, "compId": 138 }, { "type": "Sprite", "props": { "y": 180, "x": 38.5, "var": "panel", "texture": "morefriend/底.png", "alpha": 1 }, "compId": 4 }, { "type": "Button", "props": { "y": 188, "x": 604, "var": "CloseBtn", "stateNum": 1, "skin": "morefriend/x.png" }, "compId": 6 }, { "type": "Text", "props": { "y": 198, "x": 192, "width": 340, "valign": "middle", "text": "好友都在玩的游戏", "height": 50, "fontSize": 42, "font": "SimHei", "color": "#ffffff", "bold": true, "align": "center", "runtime": "laya.display.Text" }, "compId": 7 }, { "type": "Button", "props": { "y": 1059, "x": 311, "var": "ContinueBtn", "stateNum": 1 }, "compId": 54 }, { "type": "List", "props": { "y": 291, "x": 78, "width": 567, "var": "GameList", "spaceX": 10, "selectEnable": true, "repeatY": 3, "repeatX": 3, "height": 749 }, "compId": 58, "child": [{ "type": "Box", "props": { "y": -1, "x": 5, "width": 172, "renderType": "render", "height": 202 }, "compId": 59, "child": [{ "type": "Image", "props": { "y": 0, "x": 0, "width": 172, "height": 202 }, "compId": 116, "child": [{ "type": "Image", "props": { "y": 11, "x": 0, "width": 156, "name": "icon", "height": 152 }, "compId": 60 }, { "type": "Text", "props": { "y": 159, "x": -1, "width": 154, "valign": "middle", "text": "游戏名字", "name": "name", "height": 40, "fontSize": 25, "font": "Microsoft YaHei", "color": "#ffffff", "align": "center", "runtime": "laya.display.Text" }, "compId": 61 }, { "type": "Sprite", "props": { "y": 0, "x": 121, "texture": "morefriend/NEW.png", "name": "new" }, "compId": 62 }, { "type": "Button", "props": { "width": 172, "name": "btn", "height": 202 }, "compId": 125 }] }] }] }], "loadList": ["local/paiwei_xin_1_1.png", "morefriend/底.png", "morefriend/x.png", "morefriend/NEW.png"], "loadList3D": [] };
  35. Window.FriendPlayingWindowUI = FriendPlayingWindowUI;
  36. REG("ui.Window.FriendPlayingWindowUI", FriendPlayingWindowUI);
  37. class HomeWindowUI extends Laya.Scene {
  38. constructor() { super(); }
  39. createChildren() {
  40. super.createChildren();
  41. this.createView(HomeWindowUI.uiView);
  42. }
  43. }
  44. HomeWindowUI.uiView = { "type": "Scene", "props": { "width": 720, "height": 1280 }, "compId": 2, "child": [{ "type": "Box", "props": { "width": 720, "height": 150 }, "compId": 4, "child": [{ "type": "Image", "props": { "y": 46, "skin": "home/shouye_1_1.png", "left": 50 }, "compId": 5, "child": [{ "type": "Sprite", "props": { "y": -6, "x": 0, "texture": "home/shouye_1_2.png" }, "compId": 6 }, { "type": "FontClip", "props": { "y": 16, "x": 60, "width": 106, "var": "goldTex", "value": "0", "skin": "home/shouye_1_3.png", "sheet": "0123456789", "height": 25, "align": "center" }, "compId": 7 }] }] }, { "type": "Image", "props": { "y": 181, "x": 150, "skin": "load/logo(1).png", "scaleY": 0.85, "scaleX": 0.85 }, "compId": 23 }, { "type": "Image", "props": { "y": 319, "x": 295, "skin": "home/guanqia_1_1.png" }, "compId": 24, "child": [{ "type": "FontClip", "props": { "y": 0, "x": 28, "width": 73, "var": "curswtage", "value": "1", "skin": "home/guanqia_1_2.png", "sheet": "0123456789", "scaleY": 1, "scaleX": 1, "height": 33, "align": "center" }, "compId": 22 }] }, { "type": "Box", "props": { "y": 309, "x": 0, "width": 720, "height": 277 }, "compId": 9, "child": [{ "type": "Button", "props": { "x": 1, "var": "settingBtn", "top": 0, "stateNum": 1, "skin": "home/shouye_1_6.png" }, "compId": 8 }, { "type": "Button", "props": { "var": "signBtn", "stateNum": 1, "skin": "home/shouye_1_5.png", "left": 0, "bottom": 0 }, "compId": 10 }, { "type": "Button", "props": { "var": "taskBtn", "stateNum": 1, "skin": "home/shouye_1_4.png", "right": 0, "bottom": 0 }, "compId": 11 }, { "type": "Button", "props": { "y": 0, "var": "rankBtn", "top": 0, "stateNum": 1, "skin": "home/shouye_1_6_1.png", "right": 0 }, "compId": 21 }] }, { "type": "Button", "props": { "x": 581, "var": "skinshop", "stateNum": 1, "skin": "home/shouye_1_8.png", "bottom": 334 }, "compId": 12 }, { "type": "Box", "props": { "x": 1, "width": 720, "var": "guide", "height": 181, "bottom": 465 }, "compId": 13, "child": [{ "type": "Sprite", "props": { "y": 26, "x": 135, "texture": "home/beijing_2_6(1)(1).png" }, "compId": 25 }, { "type": "Image", "props": { "y": 89, "x": 315, "skin": "home/beijing_2_5(1).png" }, "compId": 26 }, { "type": "Sprite", "props": { "y": 31, "x": 241, "visible": false, "texture": "home/shouye_1_7.png" }, "compId": 14 }, { "type": "Sprite", "props": { "y": 194, "x": 310, "width": 75, "visible": false, "var": "hand", "texture": "home/shouye_1_7_2.png", "pivotX": 28, "height": 89 }, "compId": 15 }, { "type": "Image", "props": { "y": 172, "x": 303, "width": 113, "visible": false, "var": "guide1", "skin": "home/shouye_1_7_1.png", "height": 11 }, "compId": 16 }, { "type": "Image", "props": { "y": 129, "x": 416, "width": 113, "visible": false, "var": "guide2", "skin": "home/shouye_1_7_1.png", "scaleX": -1, "height": 11 }, "compId": 20 }] }, { "type": "Button", "props": { "x": 191, "var": "baginBtn", "stateNum": 1, "skin": "home/shouye_1_9.png", "labelSize": 40, "labelFont": "SimHei", "labelBold": true, "bottom": 325 }, "compId": 3 }, { "type": "Button", "props": { "x": 212, "width": 296, "var": "rebtn", "stateNum": 1, "skin": "home/5底.png", "height": 98, "bottom": 220 }, "compId": 28, "child": [{ "type": "Image", "props": { "y": 13, "width": 60, "name": "icon", "left": 28, "height": 60 }, "compId": 29 }, { "type": "Text", "props": { "y": 22.5, "x": 97, "width": 158, "valign": "middle", "text": "微信小游戏", "name": "name", "height": 41, "fontSize": 30, "font": "SimHei", "color": "#ffffff", "bold": true, "align": "center", "runtime": "laya.display.Text" }, "compId": 30 }] }, { "type": "Button", "props": { "y": 190, "x": 15, "var": "LeaveBtn", "stateNum": 1, "skin": "homepage/x.png" }, "compId": 34 }, { "type": "Button", "props": { "y": 181, "x": 608, "var": "moreFunBtn", "stateNum": 1, "skin": "homepage/更多好玩.png" }, "compId": 35, "child": [{ "type": "Sprite", "props": { "y": 0, "x": 72, "texture": "homepage/点.png", "name": "RedPoint" }, "compId": 38 }] }], "animations": [{ "nodes": [{ "target": 26, "keyframes": { "y": [{ "value": 89, "tweenMethod": "linearNone", "tween": true, "target": 26, "key": "y", "index": 0 }, { "value": 89, "tweenMethod": "linearNone", "tween": true, "target": 26, "key": "y", "index": 20 }], "x": [{ "value": 315, "tweenMethod": "linearNone", "tween": true, "target": 26, "key": "x", "index": 0 }, { "value": 115, "tweenMethod": "linearNone", "tween": true, "target": 26, "key": "x", "index": 20 }, { "value": 315, "tweenMethod": "linearNone", "tween": true, "target": 26, "key": "x", "index": 40 }, { "value": 540, "tweenMethod": "linearNone", "tween": true, "target": 26, "key": "x", "index": 65 }, { "value": 315, "tweenMethod": "linearNone", "tween": true, "target": 26, "key": "x", "index": 90 }] } }], "name": "ani1", "id": 1, "frameRate": 40, "action": 2 }], "loadList": ["home/shouye_1_1.png", "home/shouye_1_2.png", "home/shouye_1_3.png", "load/logo(1).png", "home/guanqia_1_1.png", "home/guanqia_1_2.png", "home/shouye_1_6.png", "home/shouye_1_5.png", "home/shouye_1_4.png", "home/shouye_1_6_1.png", "home/shouye_1_8.png", "home/beijing_2_6(1)(1).png", "home/beijing_2_5(1).png", "home/shouye_1_7.png", "home/shouye_1_7_2.png", "home/shouye_1_7_1.png", "home/shouye_1_9.png", "home/5底.png", "homepage/x.png", "homepage/更多好玩.png", "homepage/点.png"], "loadList3D": [] };
  45. Window.HomeWindowUI = HomeWindowUI;
  46. REG("ui.Window.HomeWindowUI", HomeWindowUI);
  47. class InGameWindowUI extends Laya.Scene {
  48. constructor() { super(); }
  49. createChildren() {
  50. super.createChildren();
  51. this.createView(InGameWindowUI.uiView);
  52. }
  53. }
  54. InGameWindowUI.uiView = { "type": "Scene", "props": { "width": 720, "height": 1280 }, "compId": 2, "child": [{ "type": "FontClip", "props": { "y": 221, "x": 279, "width": 108, "var": "score", "value": "0", "skin": "local/fuhuo_1_3_5.png", "sheet": "0123456789", "scaleY": 1.5, "scaleX": 1.5, "height": 36, "align": "center" }, "compId": 15 }, { "type": "Box", "props": { "width": 720, "visible": false, "name": "test", "height": 1280 }, "compId": 9, "child": [{ "type": "Text", "props": { "y": 176, "x": 119.5, "width": 480, "visible": false, "valign": "middle", "text": "0", "height": 126, "fontSize": 100, "color": "#ffffff", "bold": true, "align": "center", "runtime": "laya.display.Text" }, "compId": 3 }, { "type": "Text", "props": { "y": 3, "x": 0, "width": 185, "visible": false, "var": "extraspeedtime", "valign": "middle", "text": "0", "height": 78, "fontSize": 80, "color": "#ff0400", "bold": true, "align": "center", "runtime": "laya.display.Text" }, "compId": 5 }, { "type": "Text", "props": { "y": 3, "x": 535, "width": 185, "visible": false, "var": "flytime", "valign": "middle", "text": "0", "height": 78, "fontSize": 80, "color": "#ff0400", "bold": true, "align": "center", "runtime": "laya.display.Text" }, "compId": 6 }, { "type": "Text", "props": { "y": 3, "x": 267, "width": 185, "visible": false, "var": "speed", "valign": "middle", "text": "0", "height": 78, "fontSize": 80, "color": "#ff0400", "bold": true, "align": "center", "runtime": "laya.display.Text" }, "compId": 7 }, { "type": "Text", "props": { "y": 604, "x": 0, "width": 720, "visible": false, "var": "road", "valign": "middle", "text": "0", "height": 78, "fontSize": 80, "color": "#ff0400", "bold": true, "align": "center", "runtime": "laya.display.Text" }, "compId": 8 }] }, { "type": "List", "props": { "y": 496, "width": 250, "visible": false, "var": "ranklist", "spaceY": 5, "right": 83, "repeatY": 6, "height": 390 }, "compId": 10, "child": [{ "type": "Box", "props": { "width": 250, "renderType": "render", "height": 60 }, "compId": 12, "child": [{ "type": "Image", "props": { "y": 0, "x": 0, "width": 250, "skin": "local/paiwei_xin_1_1.png", "height": 60, "sizeGrid": "50,50,50,50" }, "compId": 11, "child": [{ "type": "Text", "props": { "y": 13, "x": 14, "width": 148, "valign": "middle", "text": "草莓1号", "name": "name", "height": 35, "fontSize": 30, "color": "#ffffff", "bold": true, "align": "center", "runtime": "laya.display.Text" }, "compId": 13 }, { "type": "Text", "props": { "y": 17, "x": 162, "width": 74, "valign": "middle", "text": "100", "name": "score", "height": 26, "fontSize": 20, "font": "SimSun", "color": "#d8ff0b", "bold": true, "align": "center", "runtime": "laya.display.Text" }, "compId": 14 }] }] }] }, { "type": "Box", "props": { "y": 156.5, "x": 561, "width": 99, "var": "shiwan", "renderType": "render", "height": 129 }, "compId": 20, "child": [{ "type": "Button", "props": { "y": 10, "x": 0, "stateNum": 1, "skin": "tryplay/点击试玩.png", "name": "btn", "alpha": 0.5 }, "compId": 17 }, { "type": "Image", "props": { "y": 18, "x": 12, "width": 78, "name": "icon", "height": 77 }, "compId": 18 }, { "type": "Sprite", "props": { "y": 1, "x": 79, "texture": "tryplay/圆点.png" }, "compId": 19 }] }], "loadList": ["local/fuhuo_1_3_5.png", "local/paiwei_xin_1_1.png", "tryplay/点击试玩.png", "tryplay/圆点.png"], "loadList3D": [] };
  55. Window.InGameWindowUI = InGameWindowUI;
  56. REG("ui.Window.InGameWindowUI", InGameWindowUI);
  57. class LoadWindowUI extends Laya.Scene {
  58. constructor() { super(); }
  59. createChildren() {
  60. super.createChildren();
  61. this.createView(LoadWindowUI.uiView);
  62. }
  63. }
  64. LoadWindowUI.uiView = { "type": "Scene", "props": { "width": 720, "height": 1280 }, "compId": 2, "child": [{ "type": "Image", "props": { "x": 0, "width": 720, "top": 0, "skin": "load/jiazai_2.png", "name": "bg", "bottom": 0, "sizeGrid": "20,20,20,20" }, "compId": 4, "child": [{ "type": "Image", "props": { "x": 0, "skin": "load/jiazai_1.png", "bottom": 0 }, "compId": 5 }, { "type": "Sprite", "props": { "y": 191, "x": 113, "texture": "load/logo(1).png" }, "compId": 6 }] }, { "type": "Box", "props": { "width": 720, "height": 80, "bottom": 0 }, "compId": 9, "child": [{ "type": "ProgressBar", "props": { "y": 36, "x": 24, "width": 671, "var": "progress", "skin": "load/jiazai.png", "sizeGrid": "5,15,5,15", "height": 24 }, "compId": 3 }, { "type": "Text", "props": { "y": 0, "x": 341, "width": 73, "var": "preTex", "valign": "middle", "text": "50%", "height": 36, "fontSize": 30, "color": "#ffffff", "bold": true, "align": "center", "runtime": "laya.display.Text" }, "compId": 8 }] }], "loadList": ["load/jiazai_2.png", "load/jiazai_1.png", "load/logo(1).png", "load/jiazai.png"], "loadList3D": [] };
  65. Window.LoadWindowUI = LoadWindowUI;
  66. REG("ui.Window.LoadWindowUI", LoadWindowUI);
  67. class MoreFunWindowUI extends Laya.Scene {
  68. constructor() { super(); }
  69. createChildren() {
  70. super.createChildren();
  71. this.createView(MoreFunWindowUI.uiView);
  72. }
  73. }
  74. MoreFunWindowUI.uiView = { "type": "Scene", "props": { "width": 720, "height": 1280 }, "compId": 2, "child": [{ "type": "Image", "props": { "x": 0, "width": 720, "top": 0, "skin": "local/paiwei_xin_1_1.png", "bottom": 0, "sizeGrid": "50,50,50,50" }, "compId": 92 }, { "type": "Sprite", "props": { "y": 160, "x": 38.5, "var": "panel", "texture": "morefriend/底.png", "alpha": 1 }, "compId": 14 }, { "type": "Button", "props": { "y": 168, "x": 602, "var": "CloseBtn", "stateNum": 1, "skin": "morefriend/x.png" }, "compId": 54 }, { "type": "Text", "props": { "y": 178, "x": 203, "width": 320, "valign": "middle", "text": "更多好玩的游戏", "height": 50, "fontSize": 42, "font": "SimHei", "color": "#ffffff", "bold": true, "align": "center", "runtime": "laya.display.Text" }, "compId": 55 }, { "type": "Button", "props": { "y": 1039, "x": 313, "var": "ContinueBtn", "stateNum": 1 }, "compId": 65 }, { "type": "List", "props": { "y": 252, "x": 63, "width": 601, "var": "GameList", "spaceY": 13, "spaceX": 5, "height": 763 }, "compId": 85, "child": [{ "type": "Box", "props": { "y": 6, "x": 3, "width": 192, "renderType": "render", "height": 238 }, "compId": 86, "child": [{ "type": "Sprite", "props": { "y": 4.5, "x": 3, "texture": "morefriend/1.png", "name": "di" }, "compId": 87, "child": [{ "type": "Image", "props": { "y": 0, "x": 0, "width": 187, "name": "icon", "height": 171 }, "compId": 88 }, { "type": "Text", "props": { "y": 179, "x": 13, "width": 80, "valign": "middle", "text": "游戏名字", "name": "name", "height": 20, "fontSize": 15, "font": "SimHei", "color": "#ffffff", "bold": false, "align": "left", "runtime": "laya.display.Text" }, "compId": 89 }, { "type": "Text", "props": { "y": 199, "x": 13, "width": 95, "valign": "middle", "text": "355631人在玩", "name": "num", "height": 20, "fontSize": 15, "font": "SimHei", "color": "#ffffff", "bold": false, "align": "left", "runtime": "laya.display.Text" }, "compId": 90 }, { "type": "Button", "props": { "y": 0, "x": 0, "width": 187, "name": "btn", "height": 231 }, "compId": 91 }] }] }] }], "loadList": ["local/paiwei_xin_1_1.png", "morefriend/底.png", "morefriend/x.png", "morefriend/1.png"], "loadList3D": [] };
  75. Window.MoreFunWindowUI = MoreFunWindowUI;
  76. REG("ui.Window.MoreFunWindowUI", MoreFunWindowUI);
  77. class OffLineWindowUI extends Laya.Scene {
  78. constructor() { super(); }
  79. createChildren() {
  80. super.createChildren();
  81. this.createView(OffLineWindowUI.uiView);
  82. }
  83. }
  84. OffLineWindowUI.uiView = { "type": "Scene", "props": { "width": 720, "height": 1280, "alpha": 1 }, "compId": 2, "child": [{ "type": "Image", "props": { "x": 0, "width": 720, "top": 0, "skin": "local/paiwei_xin_1_1.png", "bottom": 0, "sizeGrid": "50,50,50,50" }, "compId": 69 }, { "type": "Sprite", "props": { "y": 336, "x": 146, "var": "panel", "texture": "offline/底.png", "alpha": 1 }, "compId": 4, "child": [{ "type": "Text", "props": { "y": 6, "x": 122, "width": 180, "valign": "middle", "text": "离线收益", "height": 50, "fontSize": 28, "font": "SimHei", "color": "#ffffff", "bold": true, "align": "center", "runtime": "laya.display.Text" }, "compId": 5 }, { "type": "Box", "props": { "y": 58, "x": 114, "width": 194, "name": "Box", "height": 255, "alpha": 1 }, "compId": 6, "child": [{ "type": "Image", "props": { "y": 36, "x": 15, "skin": "offline/金币.png" }, "compId": 7 }, { "type": "Text", "props": { "y": 203, "x": 29, "width": 86, "valign": "middle", "text": "金币 X", "height": 41, "fontSize": 28, "font": "Microsoft YaHei", "color": "#ffffff", "align": "center", "runtime": "laya.display.Text" }, "compId": 43 }, { "type": "Text", "props": { "y": 203, "x": 115, "width": 66, "valign": "middle", "text": "108", "name": "Num", "height": 41, "fontSize": 28, "font": "Microsoft YaHei", "color": "#ffffff", "align": "left", "runtime": "laya.display.Text" }, "compId": 45 }] }] }, { "type": "List", "props": { "y": 241, "x": 20, "width": 105, "var": "GameListLeft", "repeatY": 5, "repeatX": 1, "height": 652 }, "compId": 46, "child": [{ "type": "Box", "props": { "y": 0, "x": 0, "width": 106, "renderType": "render", "height": 141 }, "compId": 53, "child": [{ "type": "Sprite", "props": {}, "compId": 56, "child": [{ "type": "Image", "props": { "y": -1, "x": 7.5, "width": 100, "name": "icon", "height": 100 }, "compId": 54 }, { "type": "Text", "props": { "y": 99, "x": 7.5, "width": 100, "valign": "middle", "text": "游戏名字", "name": "name", "height": 20, "fontSize": 16, "font": "Microsoft YaHei", "color": "#ffffff", "align": "center", "runtime": "laya.display.Text" }, "compId": 55 }, { "type": "Button", "props": { "y": -1, "x": 6, "width": 106, "name": "btn", "height": 120 }, "compId": 66 }] }] }] }, { "type": "List", "props": { "y": 241, "x": 596, "width": 105, "var": "GameListRight", "repeatY": 5, "repeatX": 1, "height": 652 }, "compId": 57, "child": [{ "type": "Box", "props": { "y": 0, "x": 0, "width": 106, "renderType": "render", "height": 141 }, "compId": 58, "child": [{ "type": "Sprite", "props": {}, "compId": 59, "child": [{ "type": "Image", "props": { "y": 0, "x": 12, "width": 100, "name": "icon", "height": 100 }, "compId": 60 }, { "type": "Text", "props": { "y": 100, "x": 12, "width": 100, "valign": "middle", "text": "游戏名字", "name": "name", "height": 20, "fontSize": 16, "font": "Microsoft YaHei", "color": "#ffffff", "align": "center", "runtime": "laya.display.Text" }, "compId": 61 }, { "type": "Button", "props": { "y": -1, "x": 6, "width": 106, "name": "btn", "height": 120 }, "compId": 67 }] }] }] }, { "type": "Box", "props": { "y": 841, "x": 361, "width": 305, "var": "BtnBox", "pivotY": 75, "pivotX": 153, "height": 150 }, "compId": 70, "child": [{ "type": "Button", "props": { "y": 5, "x": 4, "var": "DoubleBtn", "stateNum": 1, "skin": "offline/双倍.png" }, "compId": 9 }, { "type": "Button", "props": { "y": 93, "x": 76, "width": 172, "var": "GetBtn", "height": 57 }, "compId": 63, "child": [{ "type": "Text", "props": { "y": 8, "x": -12, "width": 172, "valign": "middle", "text": "直接领取", "height": 57, "fontSize": 35, "font": "SimHei", "color": "#f9ffff", "bold": false, "align": "center", "runtime": "laya.display.Text" }, "compId": 65 }] }] }], "loadList": ["local/paiwei_xin_1_1.png", "offline/底.png", "offline/金币.png", "offline/双倍.png"], "loadList3D": [] };
  85. Window.OffLineWindowUI = OffLineWindowUI;
  86. REG("ui.Window.OffLineWindowUI", OffLineWindowUI);
  87. class QueueWindowUI extends Laya.Scene {
  88. constructor() { super(); }
  89. createChildren() {
  90. super.createChildren();
  91. this.createView(QueueWindowUI.uiView);
  92. }
  93. }
  94. QueueWindowUI.uiView = { "type": "Scene", "props": { "width": 720, "height": 1280 }, "compId": 2, "child": [{ "type": "Image", "props": { "width": 720, "top": 0, "skin": "local/paiwei_xin_1_1.png", "name": "bg", "bottom": 0, "sizeGrid": "50,50,50,50" }, "compId": 3 }, { "type": "Image", "props": { "y": 440, "x": 60, "width": 600, "skin": "queue/shangcheng_1_4_2.png", "height": 400, "sizeGrid": "100,100,100,100" }, "compId": 5, "child": [{ "type": "Sprite", "props": { "y": -33, "x": 60, "texture": "queue/pipei_1_1.png" }, "compId": 4 }] }, { "type": "Box", "props": { "y": 553, "x": 204, "width": 312, "var": "quelist", "height": 201 }, "compId": 6, "child": [{ "type": "Image", "props": { "width": 90, "visible": true, "skin": "queue/pipei_1_2.png", "height": 90 }, "compId": 7 }, { "type": "Image", "props": { "y": 0, "x": 110, "width": 90, "visible": true, "skin": "queue/pipei_1_2.png", "height": 90 }, "compId": 9 }, { "type": "Image", "props": { "y": 0, "x": 220, "width": 90, "visible": true, "skin": "queue/pipei_1_2.png", "height": 90 }, "compId": 10 }, { "type": "Image", "props": { "y": 110, "x": 0, "width": 90, "visible": true, "skin": "queue/pipei_1_2.png", "height": 90 }, "compId": 12 }, { "type": "Image", "props": { "y": 110, "x": 110, "width": 90, "visible": true, "skin": "queue/pipei_1_2.png", "height": 90 }, "compId": 13 }, { "type": "Image", "props": { "y": 110, "x": 220, "width": 90, "visible": true, "skin": "queue/pipei_1_2.png", "height": 90 }, "compId": 14 }] }], "loadList": ["local/paiwei_xin_1_1.png", "queue/shangcheng_1_4_2.png", "queue/pipei_1_1.png", "queue/pipei_1_2.png"], "loadList3D": [] };
  95. Window.QueueWindowUI = QueueWindowUI;
  96. REG("ui.Window.QueueWindowUI", QueueWindowUI);
  97. class RankWindowUI extends Laya.Scene {
  98. constructor() { super(); }
  99. createChildren() {
  100. super.createChildren();
  101. this.createView(RankWindowUI.uiView);
  102. }
  103. }
  104. RankWindowUI.uiView = { "type": "Scene", "props": { "width": 720, "height": 1280 }, "compId": 2, "child": [{ "type": "Image", "props": { "width": 720, "top": 0, "skin": "local/paiwei_xin_1_1.png", "name": "bg", "bottom": 0, "sizeGrid": "50,50,50,50" }, "compId": 3 }, { "type": "Image", "props": { "y": 137, "x": 80, "width": 560, "skin": "rank/shezhi_1_4.png", "height": 1050, "sizeGrid": "9,15,30,17" }, "compId": 22, "child": [{ "type": "Image", "props": { "y": 100, "x": 23, "width": 514, "skin": "rank/paihang_1_4.png", "height": 100, "sizeGrid": "18,85,24,105" }, "compId": 44 }, { "type": "Image", "props": { "y": 300, "x": 23, "width": 514, "skin": "rank/paihang_1_4.png", "height": 100, "sizeGrid": "18,85,24,105" }, "compId": 46 }, { "type": "Image", "props": { "y": 500, "x": 23, "width": 514, "skin": "rank/paihang_1_4.png", "height": 100, "sizeGrid": "18,85,24,105" }, "compId": 48 }, { "type": "Image", "props": { "y": 700, "x": 23, "width": 514, "skin": "rank/paihang_1_4.png", "height": 100, "sizeGrid": "18,85,24,105" }, "compId": 50 }, { "type": "Image", "props": { "y": 900, "x": 23, "width": 514, "skin": "rank/paihang_1_4.png", "height": 100, "sizeGrid": "18,85,24,105" }, "compId": 52 }] }, { "type": "Image", "props": { "y": 85, "x": 220, "skin": "rank/shezhi_1_2.png", "sizeGrid": "8,16,26,13" }, "compId": 43, "child": [{ "type": "Image", "props": { "x": 67, "top": 11, "skin": "rank/paihang_1_5.png" }, "compId": 4 }] }, { "type": "Button", "props": { "y": 618, "var": "nextpageBtn", "stateNum": 1, "skin": "rank/paiwei_xin_1_4.png", "scaleX": -1, "right": 40 }, "compId": 20 }, { "type": "Button", "props": { "y": 618, "var": "uppageBtn", "stateNum": 1, "skin": "rank/paiwei_xin_1_4.png", "rotation": 0, "left": 0 }, "compId": 21 }, { "type": "Button", "props": { "x": 578, "var": "closeBtn", "top": 137, "stateNum": 1, "skin": "rank/shezhi_1_3.png", "scaleY": 1.3, "scaleX": 1.3 }, "compId": 6 }], "loadList": ["local/paiwei_xin_1_1.png", "rank/shezhi_1_4.png", "rank/paihang_1_4.png", "rank/shezhi_1_2.png", "rank/paihang_1_5.png", "rank/paiwei_xin_1_4.png", "rank/shezhi_1_3.png"], "loadList3D": [] };
  105. Window.RankWindowUI = RankWindowUI;
  106. REG("ui.Window.RankWindowUI", RankWindowUI);
  107. class RecommendWindowUI extends Laya.Scene {
  108. constructor() { super(); }
  109. createChildren() {
  110. super.createChildren();
  111. this.createView(RecommendWindowUI.uiView);
  112. }
  113. }
  114. RecommendWindowUI.uiView = { "type": "Scene", "props": { "width": 720, "mouseThrough": true, "height": 1280 }, "compId": 2, "child": [{ "type": "Box", "props": { "x": 0, "width": 720, "visible": false, "var": "cainixihuan", "mouseThrough": true, "height": 210, "bottom": 0 }, "compId": 3, "child": [{ "type": "Image", "props": { "y": 5, "x": 0, "width": 750, "skin": "re/re_like-box-black.png", "height": 210, "bottom": 0 }, "compId": 4 }, { "type": "List", "props": { "width": 720, "var": "cainixihuanlist", "spaceX": 0, "repeatY": 1, "left": 60, "height": 210, "bottom": 0 }, "compId": 5, "child": [{ "type": "Box", "props": { "y": 10, "x": 0, "width": 154, "renderType": "render", "height": 204 }, "compId": 6, "child": [{ "type": "Sprite", "props": { "y": 14, "x": 5 }, "compId": 7, "child": [{ "type": "Image", "props": { "y": 5, "x": 2, "width": 140, "top": 5, "name": "icon", "height": 140 }, "compId": 8 }, { "type": "Text", "props": { "y": 152, "x": 2, "width": 140, "valign": "middle", "text": "猜你喜欢", "name": "name", "height": 23, "fontSize": 20, "color": "#ffffff", "bold": true, "align": "center", "runtime": "laya.display.Text" }, "compId": 37 }, { "type": "Button", "props": { "y": 7, "x": 2, "width": 139, "name": "btn", "height": 165 }, "compId": 34 }] }] }] }] }, { "type": "Box", "props": { "y": 701, "x": 62, "width": 129, "visible": false, "var": "baokuanyouxi", "styleSkin": "localview/超级好玩@2x.png", "pivotY": 81, "pivotX": 65, "mouseThrough": true, "height": 161 }, "compId": 10, "child": [{ "type": "Image", "props": { "y": 10, "x": 0, "width": 129, "skin": "re/re_item.png", "height": 140, "sizeGrid": "9,10,12,8" }, "compId": 33 }, { "type": "Image", "props": { "y": 20, "x": 4, "width": 120, "name": "icon", "height": 120 }, "compId": 13 }, { "type": "Button", "props": { "y": 8, "x": 5, "width": 119, "name": "btn", "height": 145 }, "compId": 36 }] }, { "type": "Box", "props": { "y": 358, "x": 0, "width": 720, "visible": false, "var": "siwangtuijian", "mouseThrough": true, "height": 452 }, "compId": 53, "child": [{ "type": "Box", "props": { "y": 0, "x": 0, "width": 720, "styleSkin": "localview/chouti_bg.png", "height": 449 }, "compId": 54, "child": [{ "type": "Image", "props": { "y": 27, "x": 35, "width": 650, "skin": "re/re_end-box.png", "height": 420 }, "compId": 55, "child": [{ "type": "Sprite", "props": { "y": -42, "x": 48, "texture": "re/re_end-title.png" }, "compId": 56 }] }] }, { "type": "List", "props": { "y": 54, "x": 69, "width": 582, "var": "siwangtuijianlist", "spaceY": 5, "spaceX": 20, "repeatY": 2, "repeatX": 3, "height": 379 }, "compId": 57, "child": [{ "type": "Box", "props": { "y": 0, "x": 0, "width": 180, "renderType": "render", "height": 185 }, "compId": 58, "child": [{ "type": "Image", "props": { "y": 0, "x": 0, "width": 180, "skin": "re/re_item.png", "height": 180, "sizeGrid": "9,10,12,8" }, "compId": 59, "child": [{ "type": "Image", "props": { "y": 10, "x": 20, "width": 140, "top": 10, "name": "icon", "height": 140 }, "compId": 60 }, { "type": "Text", "props": { "y": 150, "x": 8, "width": 163, "valign": "middle", "text": "猜你喜欢", "name": "name", "height": 27, "fontSize": 25, "font": "SimHei", "color": "#4c4040", "bold": true, "align": "center", "runtime": "laya.display.Text" }, "compId": 61 }, { "type": "Button", "props": { "y": 7, "x": 15, "width": 150, "name": "btn", "height": 165 }, "compId": 62 }] }] }] }] }, { "type": "Box", "props": { "x": 0, "width": 720, "visible": false, "var": "chouti", "top": 10, "mouseThrough": true, "bottom": 0 }, "compId": 39, "child": [{ "type": "Button", "props": { "y": 640, "x": 720, "var": "choutiBtn", "stateNum": 1, "skin": "re/arrow-right.png", "scaleX": -1 }, "compId": 79 }, { "type": "Image", "props": { "x": 0, "width": 720, "visible": false, "var": "choutiview", "top": 0, "skin": "re/res1(1).png", "bottom": 0 }, "compId": 64, "child": [{ "type": "Button", "props": { "x": 242, "var": "sharebtn", "top": 82, "stateNum": 1, "skin": "re/分享.png", "scaleY": 1, "scaleX": 1 }, "compId": 66 }, { "type": "Button", "props": { "x": 0, "var": "closeCt", "top": 80, "stateNum": 1, "skin": "re/res2.png", "scaleY": 0.6, "scaleX": 0.6 }, "compId": 65 }, { "type": "Image", "props": { "x": 29, "width": 661, "top": 200, "skin": "re/re_item.png", "height": 140, "sizeGrid": "9,10,12,8" }, "compId": 71, "child": [{ "type": "List", "props": { "y": 10, "x": 10, "width": 640, "var": "ctList", "spaceX": 10, "repeatY": 1, "height": 120 }, "compId": 72, "child": [{ "type": "Box", "props": { "y": 0, "x": 0, "width": 120, "renderType": "render", "height": 120 }, "compId": 73, "child": [{ "type": "Image", "props": { "y": 0, "x": 0, "width": 120, "name": "icon", "height": 120 }, "compId": 75 }, { "type": "Button", "props": { "y": 0, "x": 0, "width": 120, "name": "btn", "height": 120 }, "compId": 80 }] }] }, { "type": "Text", "props": { "y": 151, "x": 0, "width": 121, "valign": "middle", "text": "热门推荐", "height": 36, "fontSize": 30, "font": "SimHei", "color": "#ffffff", "align": "left", "runtime": "laya.display.Text" }, "compId": 67 }, { "type": "Text", "props": { "y": -40, "x": 1, "width": 121, "valign": "middle", "text": "好友在玩", "height": 36, "fontSize": 30, "font": "SimHei", "color": "#ffffff", "align": "left", "runtime": "laya.display.Text" }, "compId": 69 }] }, { "type": "List", "props": { "x": 43, "width": 661, "var": "choutilist", "top": 410, "spaceX": 10, "repeatY": 3, "repeatX": 3, "height": 860, "bottom": 0 }, "compId": 45, "child": [{ "type": "Box", "props": { "width": 210, "renderType": "render", "height": 280 }, "compId": 46, "child": [{ "type": "Image", "props": { "y": 0, "x": 0, "width": 210, "skin": "re/re_item.png", "height": 256, "sizeGrid": "9,10,12,8" }, "compId": 47, "child": [{ "type": "Image", "props": { "x": 9, "width": 192, "top": 15, "name": "icon", "height": 183 }, "compId": 49 }, { "type": "Text", "props": { "y": 212, "x": 10, "width": 105, "valign": "middle", "text": "猜你喜欢", "name": "name", "height": 44, "fontSize": 15, "color": "#00a3ff", "bold": true, "align": "left", "runtime": "laya.display.Text" }, "compId": 50 }, { "type": "Button", "props": { "y": 0, "x": 0, "width": 211, "name": "btn", "height": 254 }, "compId": 51 }, { "type": "Text", "props": { "y": 212, "x": 61, "width": 140, "valign": "middle", "text": "654654人玩", "name": "num", "height": 44, "fontSize": 15, "font": "SimHei", "color": "#ff001e", "bold": true, "align": "right", "runtime": "laya.display.Text" }, "compId": 68 }] }] }] }] }] }], "animations": [{ "nodes": [{ "target": 10, "keyframes": { "scaleY": [{ "value": 1, "tweenMethod": "linearNone", "tween": true, "target": 10, "key": "scaleY", "index": 0 }, { "value": 1.3, "tweenMethod": "linearNone", "tween": true, "target": 10, "key": "scaleY", "index": 15 }, { "value": 1, "tweenMethod": "linearNone", "tween": true, "target": 10, "key": "scaleY", "index": 30 }], "scaleX": [{ "value": 1, "tweenMethod": "linearNone", "tween": true, "target": 10, "key": "scaleX", "index": 0 }, { "value": 1.3, "tweenMethod": "linearNone", "tween": true, "target": 10, "key": "scaleX", "index": 15 }, { "value": 1, "tweenMethod": "linearNone", "tween": true, "target": 10, "key": "scaleX", "index": 30 }] } }], "name": "ani1", "id": 1, "frameRate": 24, "action": 2 }], "loadList": ["re/re_like-box-black.png", "localview/超级好玩@2x.png", "re/re_item.png", "localview/chouti_bg.png", "re/re_end-box.png", "re/re_end-title.png", "re/arrow-right.png", "re/res1(1).png", "re/分享.png", "re/res2.png"], "loadList3D": [] };
  115. Window.RecommendWindowUI = RecommendWindowUI;
  116. REG("ui.Window.RecommendWindowUI", RecommendWindowUI);
  117. class ReviveWindowUI extends Laya.Scene {
  118. constructor() { super(); }
  119. createChildren() {
  120. super.createChildren();
  121. this.createView(ReviveWindowUI.uiView);
  122. }
  123. }
  124. ReviveWindowUI.uiView = { "type": "Scene", "props": { "width": 720, "height": 1280 }, "compId": 2, "child": [{ "type": "Image", "props": { "width": 720, "top": 0, "skin": "local/paiwei_xin_1_1.png", "name": "bg", "bottom": 0, "sizeGrid": "50,50,50,50" }, "compId": 3 }, { "type": "Image", "props": { "y": 47, "x": 148, "skin": "revive/fuhuo_1_1.png" }, "compId": 4, "child": [{ "type": "FontClip", "props": { "y": 8.5, "x": 5, "width": 64, "var": "stagetex", "value": "1", "skin": "revive/fuhuo_1_1_3.png", "sheet": "0123456789", "height": 29, "align": "center" }, "compId": 6 }, { "type": "ProgressBar", "props": { "y": 5, "x": 69, "width": 346, "var": "stagepre", "value": 0.25, "skin": "revive/fuhuo_1_1_.png", "height": 36 }, "compId": 7 }] }, { "type": "Sprite", "props": { "y": 124, "x": 243.5, "texture": "revive/fuhuo_1_1_4.png" }, "compId": 8 }, { "type": "Box", "props": { "y": 174, "x": 0, "width": 720, "var": "precent", "height": 92 }, "compId": 9, "child": [{ "type": "Box", "props": { "x": 292, "width": 136, "top": 0, "height": 60 }, "compId": 12, "child": [{ "type": "FontClip", "props": { "y": 8, "width": 73, "var": "stageClip", "value": "50", "skin": "revive/fuhuo_1_1_6.png", "sheet": "0123456789", "left": 0, "height": 43, "align": "center" }, "compId": 10 }, { "type": "Image", "props": { "y": 7, "skin": "revive/fuhuo_1_1_5.png", "right": 0 }, "compId": 11 }] }, { "type": "Image", "props": { "x": 311, "top": 60, "skin": "revive/fuhuo_1_1_7.png" }, "compId": 13 }, { "type": "Image", "props": { "x": 130, "skin": "revive/fuhuo_1_2.png", "bottom": 0 }, "compId": 14 }] }, { "type": "Sprite", "props": { "y": 257, "x": 571, "width": 218, "texture": "local/fuhuo_1_3_1.png", "rotation": 90, "pivotY": 108, "pivotX": 109, "height": 216 }, "compId": 16 }, { "type": "Sprite", "props": { "y": 272, "x": 279, "texture": "local/fuhuo_1_1_8.png" }, "compId": 17 }, { "type": "Sprite", "props": { "y": 137, "x": 462, "texture": "local/fuhuo_1_3_3.png" }, "compId": 18, "child": [{ "type": "FontClip", "props": { "y": 130, "x": 51, "width": 136, "var": "getmoney", "value": "120", "skin": "local/fuhuo_1_3_5.png", "sheet": "0123456789", "height": 36, "align": "left" }, "compId": 19, "child": [{ "type": "Sprite", "props": { "y": -1, "x": -35, "texture": "local/fuhuo_1_3_4.png", "scaleY": 1.5, "scaleX": 1.5 }, "compId": 20 }] }] }, { "type": "Box", "props": { "x": 235, "width": 250, "var": "showpan", "height": 250, "bottom": 445 }, "compId": 24 }, { "type": "Box", "props": { "x": 0, "width": 720, "var": "BtnPan", "height": 178, "bottom": 300 }, "compId": 23, "child": [{ "type": "Button", "props": { "y": 63, "x": 360, "width": 363, "var": "reviveBtn", "stateNum": 1, "skin": "revive/fuhuo_1_4.png", "pivotY": 63, "pivotX": 182, "height": 125 }, "compId": 21 }, { "type": "Button", "props": { "x": 308, "var": "passBtn", "stateNum": 1, "skin": "revive/fuhuo_1_4_1.png", "bottom": 0 }, "compId": 22 }] }], "animations": [{ "nodes": [{ "target": 21, "keyframes": { "scaleY": [{ "value": 1, "tweenMethod": "linearNone", "tween": true, "target": 21, "key": "scaleY", "index": 0 }, { "value": 1.3, "tweenMethod": "linearNone", "tween": true, "target": 21, "key": "scaleY", "index": 15 }, { "value": 1, "tweenMethod": "linearNone", "tween": true, "target": 21, "key": "scaleY", "index": 30 }], "scaleX": [{ "value": 1, "tweenMethod": "linearNone", "tween": true, "target": 21, "key": "scaleX", "index": 0 }, { "value": 1.3, "tweenMethod": "linearNone", "tween": true, "target": 21, "key": "scaleX", "index": 15 }, { "value": 1, "tweenMethod": "linearNone", "tween": true, "target": 21, "key": "scaleX", "index": 30 }] } }], "name": "ani1", "id": 1, "frameRate": 24, "action": 2 }, { "nodes": [{ "target": 16, "keyframes": { "rotation": [{ "value": 0, "tweenMethod": "linearNone", "tween": true, "target": 16, "key": "rotation", "index": 0 }, { "value": 45, "tweenMethod": "linearNone", "tween": true, "target": 16, "key": "rotation", "index": 5 }, { "value": 90, "tweenMethod": "linearNone", "tween": true, "target": 16, "key": "rotation", "index": 10 }] } }], "name": "ani2", "id": 2, "frameRate": 24, "action": 2 }], "loadList": ["local/paiwei_xin_1_1.png", "revive/fuhuo_1_1.png", "revive/fuhuo_1_1_3.png", "revive/fuhuo_1_1_.png", "revive/fuhuo_1_1_4.png", "revive/fuhuo_1_1_6.png", "revive/fuhuo_1_1_5.png", "revive/fuhuo_1_1_7.png", "revive/fuhuo_1_2.png", "local/fuhuo_1_3_1.png", "local/fuhuo_1_1_8.png", "local/fuhuo_1_3_3.png", "local/fuhuo_1_3_5.png", "local/fuhuo_1_3_4.png", "revive/fuhuo_1_4.png", "revive/fuhuo_1_4_1.png"], "loadList3D": [] };
  125. Window.ReviveWindowUI = ReviveWindowUI;
  126. REG("ui.Window.ReviveWindowUI", ReviveWindowUI);
  127. class SettingWindowUI extends Laya.Scene {
  128. constructor() { super(); }
  129. createChildren() {
  130. super.createChildren();
  131. this.createView(SettingWindowUI.uiView);
  132. }
  133. }
  134. SettingWindowUI.uiView = { "type": "Scene", "props": { "width": 720, "height": 1280 }, "compId": 2, "child": [{ "type": "Image", "props": { "width": 720, "top": 0, "skin": "local/paiwei_xin_1_1.png", "name": "bg", "bottom": 0, "sizeGrid": "50,50,50,50" }, "compId": 3 }, { "type": "Box", "props": { "y": 340, "x": 35, "width": 650, "height": 600 }, "compId": 5, "child": [{ "type": "Image", "props": { "x": 0, "width": 650, "skin": "setting/shezhi_1_4.png", "height": 400, "bottom": 100, "sizeGrid": "35,215,24,194" }, "compId": 6 }, { "type": "Image", "props": { "x": 186, "top": 58, "skin": "setting/shezhi_1_2.png", "sizeGrid": "9,15,26,15" }, "compId": 7, "child": [{ "type": "Sprite", "props": { "y": 10, "x": 91.5, "texture": "setting/shezhi_1_1.png" }, "compId": 24 }] }, { "type": "Button", "props": { "var": "closeBtn", "top": 58, "stateNum": 1, "skin": "setting/shezhi_1_3.png", "scaleY": 1.3, "scaleX": 1.3, "right": -22 }, "compId": 8 }, { "type": "Image", "props": { "y": 344, "skin": "setting/shezhi_1_5_5.png", "left": 50 }, "compId": 9 }, { "type": "Image", "props": { "y": 208, "skin": "setting/shezhi_1_5_4.png", "left": 50 }, "compId": 10 }, { "type": "Image", "props": { "y": 360.5, "x": 420, "var": "shakePan", "skin": "setting/shezhi_1_5_1.png" }, "compId": 11, "child": [{ "type": "Image", "props": { "y": -29, "x": -20, "visible": false, "skin": "setting/shezhi_1_5_3.png", "name": "closeSprite", "left": -20 }, "compId": 12 }, { "type": "Image", "props": { "y": -29, "visible": false, "skin": "setting/shezhi_1_5_2.png", "right": -20, "name": "openSprite" }, "compId": 14 }, { "type": "Button", "props": { "y": -31, "x": -22, "width": 180, "name": "button", "height": 73 }, "compId": 16 }] }, { "type": "Image", "props": { "y": 224.5, "x": 420, "var": "soundPan", "skin": "setting/shezhi_1_5_1.png" }, "compId": 17, "child": [{ "type": "Image", "props": { "y": -29, "x": -20, "visible": false, "skin": "setting/shezhi_1_5_3.png", "name": "closeSprite", "left": -20 }, "compId": 18 }, { "type": "Image", "props": { "y": -29, "x": 88, "visible": false, "skin": "setting/shezhi_1_5_2.png", "right": -20, "name": "openSprite" }, "compId": 20 }, { "type": "Button", "props": { "y": -28, "x": -22, "width": 180, "name": "button", "height": 73 }, "compId": 22 }] }, { "type": "Text", "props": { "y": 519, "x": 24, "width": 602, "var": "userid", "valign": "middle", "text": "用户ID:0000", "height": 59, "fontSize": 30, "color": "#ffffff", "align": "center", "runtime": "laya.display.Text" }, "compId": 23 }] }], "loadList": ["local/paiwei_xin_1_1.png", "setting/shezhi_1_4.png", "setting/shezhi_1_2.png", "setting/shezhi_1_1.png", "setting/shezhi_1_3.png", "setting/shezhi_1_5_5.png", "setting/shezhi_1_5_4.png", "setting/shezhi_1_5_1.png", "setting/shezhi_1_5_3.png", "setting/shezhi_1_5_2.png"], "loadList3D": [] };
  135. Window.SettingWindowUI = SettingWindowUI;
  136. REG("ui.Window.SettingWindowUI", SettingWindowUI);
  137. class SettlementWindowUI extends Laya.Scene {
  138. constructor() { super(); }
  139. createChildren() {
  140. super.createChildren();
  141. this.createView(SettlementWindowUI.uiView);
  142. }
  143. }
  144. SettlementWindowUI.uiView = { "type": "Scene", "props": { "width": 720, "height": 1280 }, "compId": 2, "child": [{ "type": "Image", "props": { "x": 0, "width": 720, "top": 0, "skin": "local/paiwei_xin_1_1.png", "name": "bg", "bottom": 0, "sizeGrid": "50,50,50,50" }, "compId": 18 }, { "type": "Box", "props": { "width": 720, "var": "tipp", "height": 600 }, "compId": 5, "child": [{ "type": "Sprite", "props": { "y": 38, "x": 135, "visible": false, "var": "winshow", "texture": "settlement/jeisuan_chenggong_1_2.png" }, "compId": 6, "child": [{ "type": "Sprite", "props": { "y": -99, "x": 158, "visible": false, "texture": "settlement/jeisuan_chenggong_1_1.png" }, "compId": 7 }] }, { "type": "Sprite", "props": { "y": 38, "x": 134, "visible": false, "var": "loseshow", "texture": "settlement/jiesuan_shibai_1_2.png" }, "compId": 19, "child": [{ "type": "Sprite", "props": { "y": -99, "x": 158, "visible": false, "texture": "settlement/jiesuan_shibai_1_3.png" }, "compId": 20 }] }, { "type": "Sprite", "props": { "y": 214, "x": 284.5, "texture": "settlement/jeisuan_chenggong_1_4.png" }, "compId": 14 }, { "type": "Sprite", "props": { "y": 170, "x": 304, "texture": "settlement/jeisuan_chenggong_1_5.png" }, "compId": 8, "child": [{ "type": "FontClip", "props": { "y": -7, "x": -9, "width": 134, "var": "scoreTex", "value": "15", "skin": "settlement/jeisuan_chenggong_1_5_1.png", "sheet": "0123456789", "height": 45, "align": "center" }, "compId": 9 }] }, { "type": "Sprite", "props": { "y": 225, "x": 281, "texture": "local/fuhuo_1_1_8.png" }, "compId": 15 }, { "type": "Sprite", "props": { "y": 216.5, "x": 519, "width": 101, "visible": true, "texture": "local/fuhuo_1_3_1.png", "rotation": 90, "pivotY": 50, "pivotX": 51, "height": 100 }, "compId": 10 }, { "type": "Image", "props": { "y": 150, "x": 464, "width": 128, "skin": "local/fuhuo_1_3_3.png", "height": 127 }, "compId": 11, "child": [{ "type": "FontClip", "props": { "y": 91, "x": 18, "width": 136, "var": "getmoney", "value": "120", "skin": "local/fuhuo_1_3_5.png", "sheet": "0123456789", "scaleY": 0.6, "scaleX": 0.6, "height": 36, "align": "left" }, "compId": 13 }, { "type": "Sprite", "props": { "y": 51, "x": 18, "texture": "local/fuhuo_1_3_4.png" }, "compId": 31 }] }] }, { "type": "Box", "props": { "x": 0, "width": 720, "var": "BtnPan", "height": 216, "bottom": 300 }, "compId": 16, "child": [{ "type": "Button", "props": { "y": 63, "x": 360, "width": 363, "var": "awardBtn", "stateNum": 1, "skin": "settlement/jeisuan_chenggong_1_3.png", "pivotY": 63, "pivotX": 182, "labelStrokeColor": "#000000", "labelSize": 60, "labelAlign": "center", "height": 125 }, "compId": 3 }, { "type": "Button", "props": { "x": 247.5, "width": 225, "var": "backhome", "stateNum": 1, "skin": "settlement/jiesuan_shibai_1_1.png", "height": 78, "bottom": 0 }, "compId": 17 }] }], "animations": [{ "nodes": [{ "target": 10, "keyframes": { "rotation": [{ "value": 0, "tweenMethod": "linearNone", "tween": true, "target": 10, "key": "rotation", "index": 0 }, { "value": 45, "tweenMethod": "linearNone", "tween": true, "target": 10, "key": "rotation", "index": 3 }, { "value": 90, "tweenMethod": "linearNone", "tween": true, "target": 10, "key": "rotation", "index": 6 }] } }], "name": "ani1", "id": 1, "frameRate": 24, "action": 2 }, { "nodes": [{ "target": 3, "keyframes": { "scaleY": [{ "value": 1, "tweenMethod": "linearNone", "tween": true, "target": 3, "key": "scaleY", "index": 0 }, { "value": 1.3, "tweenMethod": "linearNone", "tween": true, "target": 3, "key": "scaleY", "index": 15 }, { "value": 1, "tweenMethod": "linearNone", "tween": true, "target": 3, "key": "scaleY", "index": 30 }], "scaleX": [{ "value": 1, "tweenMethod": "linearNone", "tween": true, "target": 3, "key": "scaleX", "index": 0 }, { "value": 1.3, "tweenMethod": "linearNone", "tween": true, "target": 3, "key": "scaleX", "index": 15 }, { "value": 1, "tweenMethod": "linearNone", "tween": true, "target": 3, "key": "scaleX", "index": 30 }] } }], "name": "ani2", "id": 2, "frameRate": 24, "action": 2 }], "loadList": ["local/paiwei_xin_1_1.png", "settlement/jeisuan_chenggong_1_2.png", "settlement/jeisuan_chenggong_1_1.png", "settlement/jiesuan_shibai_1_2.png", "settlement/jiesuan_shibai_1_3.png", "settlement/jeisuan_chenggong_1_4.png", "settlement/jeisuan_chenggong_1_5.png", "settlement/jeisuan_chenggong_1_5_1.png", "local/fuhuo_1_1_8.png", "local/fuhuo_1_3_1.png", "local/fuhuo_1_3_3.png", "local/fuhuo_1_3_5.png", "local/fuhuo_1_3_4.png", "settlement/jeisuan_chenggong_1_3.png", "settlement/jiesuan_shibai_1_1.png"], "loadList3D": [] };
  145. Window.SettlementWindowUI = SettlementWindowUI;
  146. REG("ui.Window.SettlementWindowUI", SettlementWindowUI);
  147. class ShopWindowUI extends Laya.Scene {
  148. constructor() { super(); }
  149. createChildren() {
  150. super.createChildren();
  151. this.createView(ShopWindowUI.uiView);
  152. }
  153. }
  154. ShopWindowUI.uiView = { "type": "Scene", "props": { "width": 720, "height": 1280 }, "compId": 2, "child": [{ "type": "Image", "props": { "x": 0, "width": 720, "top": 0, "skin": "shop/shangcheng_1_2.png", "bottom": 0, "sizeGrid": "30,30,30,30" }, "compId": 5 }, { "type": "Image", "props": { "width": 720, "top": 0, "skin": "local/shangcheng_1_1.png", "height": 600, "sizeGrid": "23,23,26,21" }, "compId": 3, "child": [{ "type": "Sprite", "props": { "y": 538, "x": 0, "texture": "shop/shangcheng_x_1_4.png" }, "compId": 36 }, { "type": "Image", "props": { "x": 206, "skin": "shop/shangcheng_1_4_9.png", "bottom": 63 }, "compId": 4 }, { "type": "Button", "props": { "y": 538, "x": 0, "width": 240, "var": "roleBtn", "stateNum": 1, "height": 62 }, "compId": 31, "child": [{ "type": "Image", "props": { "var": "rolebg", "skin": "shop/shangcheng_x_1_4_1.png" }, "compId": 41 }, { "type": "Sprite", "props": { "y": 17, "x": 92, "texture": "shop/shangcheng_x_1_1.png" }, "compId": 33 }] }, { "type": "Button", "props": { "y": 538, "x": 240, "width": 240, "var": "hatBtn", "stateNum": 1, "height": 62 }, "compId": 37, "child": [{ "type": "Image", "props": { "var": "hatbg", "skin": "shop/shangcheng_x_1_4_2.png" }, "compId": 42 }, { "type": "Sprite", "props": { "y": 17, "x": 91, "texture": "shop/shangcheng_x_1_2.png" }, "compId": 38 }] }, { "type": "Button", "props": { "y": 538, "x": 480, "width": 240, "var": "cbBtn", "stateNum": 1, "height": 62 }, "compId": 32, "child": [{ "type": "Image", "props": { "var": "cgbg", "skin": "shop/shangcheng_x_1_4_3.png" }, "compId": 43 }, { "type": "Sprite", "props": { "y": 17, "x": 91, "texture": "shop/shangcheng_x_1_3.png" }, "compId": 34 }] }, { "type": "Box", "props": { "y": 175, "x": 160, "width": 400, "var": "carShowPan", "mouseThrough": true, "mouseEnabled": false, "height": 500 }, "compId": 10 }] }, { "type": "List", "props": { "x": 48, "width": 624, "var": "renderList", "top": 605, "spaceY": 10, "spaceX": 20, "repeatX": 3, "bottom": 200 }, "compId": 6, "child": [{ "type": "Box", "props": { "width": 194, "renderType": "render", "height": 228 }, "compId": 8, "child": [{ "type": "Image", "props": { "y": 0, "x": 0, "width": 194, "skin": "shop/shangcheng_1_4_1.png", "name": "bg", "height": 228 }, "compId": 9 }, { "type": "Image", "props": { "visible": false, "skin": "shop/xiaoren1.png", "name": "roleicon", "centerY": 0, "centerX": 0 }, "compId": 12 }, { "type": "Image", "props": { "y": 66, "x": 46, "visible": false, "skin": "shop/hat1.png", "name": "haticon" }, "compId": 39 }, { "type": "Image", "props": { "y": 72, "x": 14, "visible": false, "skin": "shop/zi.png", "name": "cbicon" }, "compId": 40 }, { "type": "Button", "props": { "x": 0, "width": 194, "top": 0, "name": "tryBtn", "height": 140 }, "compId": 35 }, { "type": "Button", "props": { "y": 150, "x": 20, "width": 154, "stateNum": 1, "skin": "shop/shangcheng_1_4_3.png", "sizeGrid": "25,62,42,61", "name": "btn", "height": 78 }, "compId": 13, "child": [{ "type": "Box", "props": { "y": 0, "x": 0, "width": 154, "visible": false, "height": 78 }, "compId": 18, "child": [{ "type": "FontClip", "props": { "y": 23, "x": 65, "width": 73, "value": "x2000", "skin": "shop/shangcheng_1_4_8.png", "sheet": "x/0123456789", "name": "clip", "height": 20, "align": "left" }, "compId": 16 }, { "type": "Image", "props": { "y": 11, "x": 18, "skin": "shop/shangcheng_1_4_4.png" }, "compId": 15 }] }, { "type": "Box", "props": { "y": 0, "x": 0, "width": 154, "visible": false, "height": 78 }, "compId": 19, "child": [{ "type": "FontClip", "props": { "y": 23, "x": 68, "width": 73, "value": "1/5", "skin": "shop/shangcheng_1_4_8.png", "sheet": "x/0123456789", "name": "clip", "height": 20, "align": "left" }, "compId": 20 }, { "type": "Image", "props": { "y": 20.5, "x": 21, "skin": "shop/shangcheng_1_4_5.png" }, "compId": 21 }] }, { "type": "Box", "props": { "y": 0, "x": 0, "width": 154, "visible": false, "height": 78 }, "compId": 44, "child": [{ "type": "FontClip", "props": { "y": 23, "x": 68, "width": 73, "value": "1/5", "skin": "shop/shangcheng_1_4_8.png", "sheet": "x/0123456789", "name": "clip", "height": 20, "align": "left" }, "compId": 45 }, { "type": "Image", "props": { "y": 20.5, "x": 21, "skin": "shop/shangcheng_x_1_4_4.png" }, "compId": 46 }] }, { "type": "Box", "props": { "y": 0, "x": 0, "width": 154, "visible": false, "height": 78 }, "compId": 25, "child": [{ "type": "Sprite", "props": { "y": 23, "x": 34.5, "texture": "shop/shangcheng_1_4_7.png" }, "compId": 28 }] }] }] }] }, { "type": "Button", "props": { "x": 359, "var": "vdawardBtn", "stateNum": 1, "skin": "shop/shangcheng_xin_1_5.png", "bottom": 51 }, "compId": 7 }, { "type": "Button", "props": { "x": 46, "var": "closeBtn", "stateNum": 1, "skin": "shop/shangcheng_xin_1_4.png", "bottom": 51 }, "compId": 29 }], "loadList": ["shop/shangcheng_1_2.png", "local/shangcheng_1_1.png", "shop/shangcheng_x_1_4.png", "shop/shangcheng_1_4_9.png", "shop/shangcheng_x_1_4_1.png", "shop/shangcheng_x_1_1.png", "shop/shangcheng_x_1_4_2.png", "shop/shangcheng_x_1_2.png", "shop/shangcheng_x_1_4_3.png", "shop/shangcheng_x_1_3.png", "shop/shangcheng_1_4_1.png", "shop/xiaoren1.png", "shop/hat1.png", "shop/zi.png", "shop/shangcheng_1_4_3.png", "shop/shangcheng_1_4_8.png", "shop/shangcheng_1_4_4.png", "shop/shangcheng_1_4_5.png", "shop/shangcheng_x_1_4_4.png", "shop/shangcheng_1_4_7.png", "shop/shangcheng_xin_1_5.png", "shop/shangcheng_xin_1_4.png"], "loadList3D": [] };
  155. Window.ShopWindowUI = ShopWindowUI;
  156. REG("ui.Window.ShopWindowUI", ShopWindowUI);
  157. class SignWindowUI extends Laya.Scene {
  158. constructor() { super(); }
  159. createChildren() {
  160. super.createChildren();
  161. this.createView(SignWindowUI.uiView);
  162. }
  163. }
  164. SignWindowUI.uiView = { "type": "Scene", "props": { "width": 720, "height": 1280 }, "compId": 2, "child": [{ "type": "Image", "props": { "x": 0, "width": 720, "top": 0, "skin": "local/paiwei_xin_1_1.png", "name": "bg", "bottom": 0, "sizeGrid": "50,50,50,50" }, "compId": 3 }, { "type": "Box", "props": { "x": 70, "width": 580, "name": "dasda", "height": 641, "bottom": 550 }, "compId": 9, "child": [{ "type": "Image", "props": { "y": 50, "x": 0, "width": 580, "skin": "sign/shezhi_1_4.png", "height": 591, "bottom": 0, "sizeGrid": "11,16,24,18" }, "compId": 12 }, { "type": "Box", "props": { "y": 114, "x": 15, "width": 550, "var": "qiandaoPan", "height": 500 }, "compId": 19, "child": [{ "type": "Box", "props": { "y": 0, "width": 139, "left": 20, "height": 139 }, "compId": 14, "child": [{ "type": "Image", "props": { "width": 139, "skin": "sign/qiandao_1_3.png", "name": "bg", "height": 139 }, "compId": 15, "child": [{ "type": "Sprite", "props": { "y": 8, "x": 36, "texture": "sign/qiandao_1_5_1.png" }, "compId": 17, "child": [{ "type": "FontClip", "props": { "y": 0, "x": 14, "width": 39, "value": "1", "skin": "sign/qiandao_1_5_2.png", "sheet": "0123456789", "height": 21, "align": "center" }, "compId": 18 }] }] }, { "type": "Box", "props": { "x": 7.5, "width": 124, "name": "jiangli", "height": 85, "bottom": 11 }, "compId": 49, "child": [{ "type": "Box", "props": { "y": 0, "x": 0, "width": 124, "visible": false, "name": "money", "height": 85 }, "compId": 50, "child": [{ "type": "Image", "props": { "x": 38, "top": 0, "skin": "sign/qiandao_1_5_4.png", "scaleY": 0.8, "scaleX": 0.8 }, "compId": 53 }, { "type": "FontClip", "props": { "y": 64, "x": 32, "width": 59, "value": "x200", "skin": "sign/qiandao_1_5_3.png", "sheet": "x0123456789", "height": 21, "bottom": 0, "align": "center" }, "compId": 55 }] }, { "type": "Box", "props": { "y": 0, "x": 0, "width": 124, "visible": false, "name": "role", "height": 57 }, "compId": 51, "child": [{ "type": "Image", "props": { "skin": "shop/boluo.png", "scaleY": 0.5, "scaleX": 0.5, "centerY": 0, "centerX": 0 }, "compId": 56 }] }, { "type": "Box", "props": { "y": 0, "x": 0, "width": 124, "visible": false, "name": "cb", "height": 57 }, "compId": 395, "child": [{ "type": "Image", "props": { "y": 15, "x": 20, "scaleY": 0.5, "scaleX": 0.5 }, "compId": 396 }] }] }, { "type": "Button", "props": { "y": 0, "x": 0, "width": 139, "name": "button", "height": 139 }, "compId": 146 }, { "type": "Sprite", "props": { "y": 0, "x": 0, "width": 139, "visible": false, "texture": "sign/qiandao_1_4_2.png", "name": "complete", "height": 139 }, "compId": 47, "child": [{ "type": "Sprite", "props": { "y": 0, "x": 0, "texture": "sign/qiandao_1_4_3.png" }, "compId": 48 }] }] }, { "type": "Box", "props": { "y": 0, "x": 205, "width": 139, "height": 139 }, "compId": 397, "child": [{ "type": "Image", "props": { "width": 139, "skin": "sign/qiandao_1_3.png", "name": "bg", "height": 139 }, "compId": 398, "child": [{ "type": "Sprite", "props": { "y": 8, "x": 36, "texture": "sign/qiandao_1_5_1.png" }, "compId": 399, "child": [{ "type": "FontClip", "props": { "y": 0, "x": 14, "width": 39, "value": "2", "skin": "sign/qiandao_1_5_2.png", "sheet": "0123456789", "height": 21, "align": "center" }, "compId": 400 }] }] }, { "type": "Box", "props": { "x": 7.5, "width": 124, "name": "jiangli", "height": 85, "bottom": 11 }, "compId": 401, "child": [{ "type": "Box", "props": { "y": 0, "x": 0, "width": 124, "visible": false, "name": "money", "height": 85 }, "compId": 402, "child": [{ "type": "Image", "props": { "x": 38, "top": 0, "skin": "sign/qiandao_1_5_4.png", "scaleY": 0.8, "scaleX": 0.8 }, "compId": 403 }, { "type": "FontClip", "props": { "y": 64, "x": 32, "width": 59, "value": "x200", "skin": "sign/qiandao_1_5_3.png", "sheet": "x0123456789", "height": 21, "bottom": 0, "align": "center" }, "compId": 404 }] }, { "type": "Box", "props": { "y": 0, "x": 0, "width": 124, "visible": false, "name": "role", "height": 57 }, "compId": 405, "child": [{ "type": "Image", "props": { "skin": "shop/boluo.png", "scaleY": 0.5, "scaleX": 0.5, "centerY": 0, "centerX": 0 }, "compId": 491 }] }, { "type": "Box", "props": { "y": 0, "x": 0, "width": 124, "visible": false, "name": "cb", "height": 57 }, "compId": 407, "child": [{ "type": "Image", "props": { "y": 15, "x": 20, "skin": "shop/zi.png", "scaleY": 0.5, "scaleX": 0.5 }, "compId": 408 }] }] }, { "type": "Button", "props": { "y": 0, "x": 0, "width": 139, "name": "button", "height": 139 }, "compId": 409 }, { "type": "Sprite", "props": { "width": 139, "visible": false, "texture": "sign/qiandao_1_4_2.png", "name": "complete", "height": 139 }, "compId": 410, "child": [{ "type": "Sprite", "props": { "y": 0, "x": 0, "texture": "sign/qiandao_1_4_3.png" }, "compId": 411 }] }] }, { "type": "Box", "props": { "y": 0, "x": 391, "width": 139, "height": 139 }, "compId": 412, "child": [{ "type": "Image", "props": { "width": 139, "skin": "sign/qiandao_1_3.png", "name": "bg", "height": 139 }, "compId": 413, "child": [{ "type": "Sprite", "props": { "y": 8, "x": 36, "texture": "sign/qiandao_1_5_1.png" }, "compId": 414, "child": [{ "type": "FontClip", "props": { "y": 0, "x": 14, "width": 39, "value": "3", "skin": "sign/qiandao_1_5_2.png", "sheet": "0123456789", "height": 21, "align": "center" }, "compId": 415 }] }] }, { "type": "Box", "props": { "x": 7.5, "width": 124, "name": "jiangli", "height": 85, "bottom": 11 }, "compId": 416, "child": [{ "type": "Box", "props": { "y": 0, "x": 0, "width": 124, "visible": false, "name": "money", "height": 85 }, "compId": 417, "child": [{ "type": "Image", "props": { "x": 38, "top": 0, "skin": "sign/qiandao_1_5_4.png", "scaleY": 0.8, "scaleX": 0.8 }, "compId": 418 }, { "type": "FontClip", "props": { "y": 64, "x": 32, "width": 59, "value": "x200", "skin": "sign/qiandao_1_5_3.png", "sheet": "x0123456789", "height": 21, "bottom": 0, "align": "center" }, "compId": 419 }] }, { "type": "Box", "props": { "y": 0, "x": 0, "width": 124, "visible": false, "name": "role", "height": 57 }, "compId": 420, "child": [{ "type": "Image", "props": { "skin": "shop/boluo.png", "scaleY": 0.5, "scaleX": 0.5, "centerY": 0, "centerX": 0 }, "compId": 492 }] }, { "type": "Box", "props": { "y": 0, "x": 0, "width": 124, "visible": false, "name": "cb", "height": 57 }, "compId": 422, "child": [{ "type": "Image", "props": { "y": 15, "x": 20, "skin": "shop/zi.png", "scaleY": 0.5, "scaleX": 0.5 }, "compId": 423 }] }] }, { "type": "Button", "props": { "y": 0, "x": 0, "width": 139, "name": "button", "height": 139 }, "compId": 424 }, { "type": "Sprite", "props": { "width": 139, "visible": false, "texture": "sign/qiandao_1_4_2.png", "name": "complete", "height": 139 }, "compId": 425, "child": [{ "type": "Sprite", "props": { "y": 0, "x": 0, "texture": "sign/qiandao_1_4_3.png" }, "compId": 426 }] }] }, { "type": "Box", "props": { "y": 158, "x": 20, "width": 139, "height": 139 }, "compId": 427, "child": [{ "type": "Image", "props": { "width": 139, "skin": "sign/qiandao_1_3.png", "name": "bg", "height": 139 }, "compId": 428, "child": [{ "type": "Sprite", "props": { "y": 8, "x": 36, "texture": "sign/qiandao_1_5_1.png" }, "compId": 429, "child": [{ "type": "FontClip", "props": { "y": 0, "x": 14, "width": 39, "value": "4", "skin": "sign/qiandao_1_5_2.png", "sheet": "0123456789", "height": 21, "align": "center" }, "compId": 430 }] }] }, { "type": "Box", "props": { "x": 7.5, "width": 124, "name": "jiangli", "height": 85, "bottom": 11 }, "compId": 431, "child": [{ "type": "Box", "props": { "y": 0, "x": 0, "width": 124, "visible": false, "name": "money", "height": 85 }, "compId": 432, "child": [{ "type": "Image", "props": { "x": 38, "top": 0, "skin": "sign/qiandao_1_5_4.png", "scaleY": 0.8, "scaleX": 0.8 }, "compId": 433 }, { "type": "FontClip", "props": { "y": 64, "x": 32, "width": 59, "value": "x200", "skin": "sign/qiandao_1_5_3.png", "sheet": "x0123456789", "height": 21, "bottom": 0, "align": "center" }, "compId": 434 }] }, { "type": "Box", "props": { "y": 0, "x": 0, "width": 124, "visible": false, "name": "role", "height": 57 }, "compId": 435, "child": [{ "type": "Image", "props": { "skin": "shop/boluo.png", "scaleY": 0.5, "scaleX": 0.5, "centerY": 0, "centerX": 0 }, "compId": 493 }] }, { "type": "Box", "props": { "y": 0, "x": 0, "width": 124, "visible": false, "name": "cb", "height": 57 }, "compId": 437, "child": [{ "type": "Image", "props": { "y": 15, "x": 20, "skin": "shop/zi.png", "scaleY": 0.5, "scaleX": 0.5 }, "compId": 438 }] }] }, { "type": "Button", "props": { "y": 0, "x": 0, "width": 139, "name": "button", "height": 139 }, "compId": 439 }, { "type": "Sprite", "props": { "width": 139, "visible": false, "texture": "sign/qiandao_1_4_2.png", "name": "complete", "height": 139 }, "compId": 440, "child": [{ "type": "Sprite", "props": { "y": 0, "x": 0, "texture": "sign/qiandao_1_4_3.png" }, "compId": 441 }] }] }, { "type": "Box", "props": { "y": 158, "x": 205, "width": 139, "height": 139 }, "compId": 442, "child": [{ "type": "Image", "props": { "width": 139, "skin": "sign/qiandao_1_3.png", "name": "bg", "height": 139 }, "compId": 443, "child": [{ "type": "Sprite", "props": { "y": 8, "x": 36, "texture": "sign/qiandao_1_5_1.png" }, "compId": 444, "child": [{ "type": "FontClip", "props": { "y": 0, "x": 14, "width": 39, "value": "5", "skin": "sign/qiandao_1_5_2.png", "sheet": "0123456789", "height": 21, "align": "center" }, "compId": 445 }] }] }, { "type": "Box", "props": { "x": 7.5, "width": 124, "name": "jiangli", "height": 85, "bottom": 11 }, "compId": 446, "child": [{ "type": "Box", "props": { "y": 0, "x": 0, "width": 124, "visible": false, "name": "money", "height": 85 }, "compId": 447, "child": [{ "type": "Image", "props": { "x": 38, "top": 0, "skin": "sign/qiandao_1_5_4.png", "scaleY": 0.8, "scaleX": 0.8 }, "compId": 448 }, { "type": "FontClip", "props": { "y": 64, "x": 32, "width": 59, "value": "x200", "skin": "sign/qiandao_1_5_3.png", "sheet": "x0123456789", "height": 21, "bottom": 0, "align": "center" }, "compId": 449 }] }, { "type": "Box", "props": { "y": 0, "x": 0, "width": 124, "visible": false, "name": "role", "height": 57 }, "compId": 450, "child": [{ "type": "Image", "props": { "skin": "shop/boluo.png", "scaleY": 0.5, "scaleX": 0.5, "centerY": 0, "centerX": 0 }, "compId": 494 }] }, { "type": "Box", "props": { "y": 0, "x": 0, "width": 124, "visible": false, "name": "cb", "height": 57 }, "compId": 452, "child": [{ "type": "Image", "props": { "y": 15, "x": 20, "skin": "shop/zi.png", "scaleY": 0.5, "scaleX": 0.5 }, "compId": 453 }] }] }, { "type": "Button", "props": { "y": 0, "x": 0, "width": 139, "name": "button", "height": 139 }, "compId": 454 }, { "type": "Sprite", "props": { "width": 139, "visible": false, "texture": "sign/qiandao_1_4_2.png", "name": "complete", "height": 139 }, "compId": 455, "child": [{ "type": "Sprite", "props": { "y": 0, "x": 0, "texture": "sign/qiandao_1_4_3.png" }, "compId": 456 }] }] }, { "type": "Box", "props": { "y": 158, "x": 391, "width": 139, "height": 139 }, "compId": 457, "child": [{ "type": "Image", "props": { "width": 139, "skin": "sign/qiandao_1_3.png", "name": "bg", "height": 139 }, "compId": 458, "child": [{ "type": "Sprite", "props": { "y": 8, "x": 36, "texture": "sign/qiandao_1_5_1.png" }, "compId": 459, "child": [{ "type": "FontClip", "props": { "y": 0, "x": 14, "width": 39, "value": "6", "skin": "sign/qiandao_1_5_2.png", "sheet": "0123456789", "height": 21, "align": "center" }, "compId": 460 }] }] }, { "type": "Box", "props": { "x": 7.5, "width": 124, "name": "jiangli", "height": 85, "bottom": 11 }, "compId": 461, "child": [{ "type": "Box", "props": { "y": 0, "x": 0, "width": 124, "visible": false, "name": "money", "height": 85 }, "compId": 462, "child": [{ "type": "Image", "props": { "x": 38, "top": 0, "skin": "sign/qiandao_1_5_4.png", "scaleY": 0.8, "scaleX": 0.8 }, "compId": 463 }, { "type": "FontClip", "props": { "y": 64, "x": 32, "width": 59, "value": "x200", "skin": "sign/qiandao_1_5_3.png", "sheet": "x0123456789", "height": 21, "bottom": 0, "align": "center" }, "compId": 464 }] }, { "type": "Box", "props": { "y": 0, "x": 0, "width": 124, "visible": false, "name": "role", "height": 57 }, "compId": 465, "child": [{ "type": "Image", "props": { "skin": "shop/boluo.png", "scaleY": 0.5, "scaleX": 0.5, "centerY": 0, "centerX": 0 }, "compId": 495 }] }, { "type": "Box", "props": { "y": 0, "x": 0, "width": 124, "visible": false, "name": "cb", "height": 57 }, "compId": 467, "child": [{ "type": "Image", "props": { "y": 15, "x": 20, "skin": "shop/zi.png", "scaleY": 0.5, "scaleX": 0.5 }, "compId": 468 }] }] }, { "type": "Button", "props": { "y": 0, "x": 0, "width": 139, "name": "button", "height": 139 }, "compId": 469 }, { "type": "Sprite", "props": { "width": 139, "visible": false, "texture": "sign/qiandao_1_4_2.png", "name": "complete", "height": 139 }, "compId": 470, "child": [{ "type": "Sprite", "props": { "y": 0, "x": 0, "texture": "sign/qiandao_1_4_3.png" }, "compId": 471 }] }] }, { "type": "Box", "props": { "y": 321, "x": 22, "width": 506, "height": 139 }, "compId": 380, "child": [{ "type": "Image", "props": { "y": 0, "skin": "sign/qiandao_1_3.png", "right": 0, "name": "bg", "left": 0, "height": 139 }, "compId": 381, "child": [{ "type": "Sprite", "props": { "y": 8, "x": 219, "texture": "sign/qiandao_1_5_1.png" }, "compId": 382, "child": [{ "type": "FontClip", "props": { "y": 0, "x": 14, "width": 39, "value": "7", "skin": "sign/qiandao_1_5_2.png", "sheet": "0123456789", "height": 21, "align": "center" }, "compId": 383 }] }] }, { "type": "Box", "props": { "y": 43, "x": 191, "width": 124, "name": "jiangli", "height": 85, "bottom": 11 }, "compId": 384, "child": [{ "type": "Box", "props": { "y": 0, "x": 0, "width": 124, "visible": false, "name": "money", "height": 85 }, "compId": 385, "child": [{ "type": "Image", "props": { "x": 38, "top": 0, "skin": "sign/qiandao_1_5_4.png", "scaleY": 0.8, "scaleX": 0.8 }, "compId": 386 }, { "type": "FontClip", "props": { "x": 32, "width": 59, "value": "200", "skin": "sign/qiandao_1_5_3.png", "sheet": "x0123456789", "height": 21, "bottom": 0, "align": "center" }, "compId": 387 }] }, { "type": "Box", "props": { "y": 0, "x": 0, "width": 124, "visible": false, "name": "role", "height": 57 }, "compId": 487, "child": [{ "type": "Image", "props": { "skin": "shop/boluo.png", "scaleY": 0.5, "scaleX": 0.5, "centerY": 0, "centerX": 0 }, "compId": 496 }] }, { "type": "Box", "props": { "y": 0, "x": 0, "width": 124, "visible": false, "name": "cb", "height": 57 }, "compId": 488, "child": [{ "type": "Image", "props": { "y": 15, "x": 20, "skin": "shop/zi.png", "scaleY": 0.5, "scaleX": 0.5 }, "compId": 490 }] }] }, { "type": "Button", "props": { "y": 0, "x": 0, "width": 509, "name": "button", "height": 139 }, "compId": 391 }, { "type": "Sprite", "props": { "y": 0, "x": 183, "width": 139, "visible": false, "texture": "sign/qiandao_1_4_2.png", "name": "complete", "height": 139 }, "compId": 392, "child": [{ "type": "Sprite", "props": { "y": 0, "x": 0, "texture": "sign/qiandao_1_4_3.png" }, "compId": 393 }] }] }] }, { "type": "Sprite", "props": { "y": 0, "x": 151, "texture": "sign/shezhi_1_2.png" }, "compId": 295, "child": [{ "type": "Image", "props": { "x": 93.25, "top": 11, "skin": "sign/qiandao_1_1.png" }, "compId": 10 }] }, { "type": "Button", "props": { "x": 515, "var": "return", "top": 10, "stateNum": 1, "skin": "sign/shezhi_1_3.png", "scaleY": 1, "scaleX": 1 }, "compId": 11 }] }, { "type": "Box", "props": { "x": 184, "width": 352, "var": "BtnBox", "height": 218, "bottom": 300 }, "compId": 499, "child": [{ "type": "Button", "props": { "y": 73, "x": 177, "width": 314, "var": "ShuangBei", "stateNum": 1, "skin": "sign/qiandao_1_2.png", "scaleY": 1.1, "scaleX": 1.1, "pivotY": 56, "pivotX": 157, "height": 111 }, "compId": 46 }, { "type": "Button", "props": { "y": 150, "x": 122, "width": 108, "var": "ptBtn", "stateNum": 1, "skin": "sign/qiandao.png", "height": 51 }, "compId": 498 }] }], "loadList": ["local/paiwei_xin_1_1.png", "sign/shezhi_1_4.png", "sign/qiandao_1_3.png", "sign/qiandao_1_5_1.png", "sign/qiandao_1_5_2.png", "sign/qiandao_1_5_4.png", "sign/qiandao_1_5_3.png", "shop/boluo.png", "sign/qiandao_1_4_2.png", "sign/qiandao_1_4_3.png", "shop/zi.png", "sign/shezhi_1_2.png", "sign/qiandao_1_1.png", "sign/shezhi_1_3.png", "sign/qiandao_1_2.png", "sign/qiandao.png"], "loadList3D": [] };
  165. Window.SignWindowUI = SignWindowUI;
  166. REG("ui.Window.SignWindowUI", SignWindowUI);
  167. class TaskWindowUI extends Laya.Scene {
  168. constructor() { super(); }
  169. createChildren() {
  170. super.createChildren();
  171. this.createView(TaskWindowUI.uiView);
  172. }
  173. }
  174. TaskWindowUI.uiView = { "type": "Scene", "props": { "width": 720, "height": 1280 }, "compId": 2, "child": [{ "type": "Image", "props": { "width": 720, "top": 0, "skin": "local/paiwei_xin_1_1.png", "name": "bg", "bottom": 0, "sizeGrid": "50,50,50,50" }, "compId": 3 }, { "type": "Box", "props": { "y": 179, "x": 35, "width": 650, "height": 911 }, "compId": 9, "child": [{ "type": "Image", "props": { "y": 85, "x": -5, "width": 660, "skin": "task/shezhi_1_4.png", "height": 826, "sizeGrid": "11,14,27,19" }, "compId": 35 }, { "type": "Button", "props": { "var": "return", "top": 40, "stateNum": 1, "skin": "task/shezhi_1_3.png", "scaleY": 1.3, "scaleX": 1.3, "right": -22 }, "compId": 12 }, { "type": "List", "props": { "y": 166, "x": 0, "width": 650, "var": "renwupan", "spaceY": 10, "repeatX": 1, "height": 696 }, "compId": 13, "child": [{ "type": "Box", "props": { "y": 0, "x": 0, "width": 650, "renderType": "render", "height": 130 }, "compId": 14, "child": [{ "type": "Image", "props": { "y": 0, "x": 0, "width": 650, "skin": "task/paihang_1_4.png", "name": "dsd", "height": 130, "sizeGrid": "34,29,29,23" }, "compId": 15 }, { "type": "Image", "props": { "y": 13, "skin": "task/renwu_1_2_1.png", "left": 20 }, "compId": 36 }, { "type": "Text", "props": { "y": 0, "x": 142, "width": 202, "valign": "middle", "text": "赛车拥有者", "name": "miaoshu", "height": 38, "fontSize": 30, "color": "#282626", "bold": true, "align": "left", "runtime": "laya.display.Text" }, "compId": 16 }, { "type": "Text", "props": { "y": 39, "x": 146, "width": 350, "valign": "middle", "text": "至少拥有5辆7级车", "name": "xingxi", "height": 38, "fontSize": 18, "font": "Helvetica", "color": "#282626", "bold": true, "align": "left", "runtime": "laya.display.Text" }, "compId": 25 }, { "type": "ProgressBar", "props": { "width": 332, "value": 0.5, "skin": "task/renwu.png", "scaleX": 1.05, "name": "jindu", "left": 142, "height": 35, "bottom": 18 }, "compId": 17, "child": [{ "type": "FontClip", "props": { "y": 7, "x": 20, "value": "1/1", "skin": "task/shangcheng_1_4_8.png", "sheet": "x/0123456789", "name": "jinducp", "left": 20 }, "compId": 18 }, { "type": "Box", "props": { "y": -5, "x": 264, "width": 68, "right": 0, "name": "item", "height": 44 }, "compId": 20, "child": [{ "type": "Image", "props": { "y": 2, "x": 45, "skin": "task/renwu_1_2_5.png", "scaleY": 0.9, "scaleX": 0.9, "right": -10, "name": "itemin" }, "compId": 21 }, { "type": "FontClip", "props": { "y": 12, "x": 0, "value": "x20", "skin": "task/shangcheng_1_4_8.png", "sheet": "x/0123456789", "name": "itemnum", "left": 0, "height": 20, "align": "left" }, "compId": 23 }] }] }, { "type": "Button", "props": { "y": 27, "x": 517, "stateNum": 1, "skin": "task/renwu_1_2_6.png", "scaleY": 0.95, "scaleX": 0.95, "right": 10, "name": "completebtn" }, "compId": 19 }] }] }, { "type": "Image", "props": { "y": 24, "x": 144, "skin": "task/shezhi_1_2.png", "scaleY": 1.3, "scaleX": 1.3, "sizeGrid": "10,17,26,19" }, "compId": 34, "child": [{ "type": "Image", "props": { "y": 12, "x": 91.5, "skin": "task/renwu_1_1.png" }, "compId": 10 }] }] }], "loadList": ["local/paiwei_xin_1_1.png", "task/shezhi_1_4.png", "task/shezhi_1_3.png", "task/paihang_1_4.png", "task/renwu_1_2_1.png", "task/renwu.png", "task/shangcheng_1_4_8.png", "task/renwu_1_2_5.png", "task/renwu_1_2_6.png", "task/shezhi_1_2.png", "task/renwu_1_1.png"], "loadList3D": [] };
  175. Window.TaskWindowUI = TaskWindowUI;
  176. REG("ui.Window.TaskWindowUI", TaskWindowUI);
  177. class TrialWindowUI extends Laya.Scene {
  178. constructor() { super(); }
  179. createChildren() {
  180. super.createChildren();
  181. this.createView(TrialWindowUI.uiView);
  182. }
  183. }
  184. TrialWindowUI.uiView = { "type": "Scene", "props": { "width": 720, "height": 1280 }, "compId": 2, "child": [{ "type": "Image", "props": { "y": 221, "x": 123, "skin": "bg/底.png", "name": "bg" }, "compId": 3, "child": [{ "type": "Text", "props": { "y": 24, "x": 138, "width": 198, "valign": "middle", "text": "皮肤试玩", "height": 44, "fontSize": 35, "font": "SimHei", "color": "#ffffff", "bold": true, "align": "center", "runtime": "laya.display.Text" }, "compId": 12 }, { "type": "Text", "props": { "y": 90, "x": 120, "width": 234, "valign": "middle", "text": "炫酷皮肤,免费试玩", "height": 44, "fontSize": 25, "font": "SimHei", "color": "#5f9dbb", "bold": true, "align": "center", "runtime": "laya.display.Text" }, "compId": 13 }, { "type": "Button", "props": { "y": 702, "x": 86.5, "var": "videobtn", "stateNum": 1, "skin": "trial/随机.png" }, "compId": 4 }, { "type": "Button", "props": { "y": 800, "x": 137, "width": 200, "var": "passbtn", "height": 50 }, "compId": 5, "child": [{ "type": "Text", "props": { "y": 3, "x": 1, "width": 198, "valign": "middle", "text": "点击跳过", "height": 44, "fontSize": 30, "font": "SimHei", "color": "#ffffff", "bold": true, "align": "center", "runtime": "laya.display.Text" }, "compId": 6 }] }, { "type": "Button", "props": { "y": 590, "x": 113, "var": "hidebtn", "stateNum": 1, "skin": "trial/今日不再显示.png" }, "compId": 7, "child": [{ "type": "Sprite", "props": { "y": -9, "x": 7, "visible": false, "var": "ppp", "texture": "trial/√.png" }, "compId": 8 }] }, { "type": "List", "props": { "y": 148, "x": 41, "width": 391, "var": "skinlist", "spaceY": 20, "spaceX": 80, "repeatY": 2, "repeatX": 2, "height": 416 }, "compId": 9, "child": [{ "type": "Box", "props": { "renderType": "render" }, "compId": 10, "child": [{ "type": "Image", "props": { "y": 0, "x": 0, "width": 155, "skin": "trial/试玩.png", "height": 197 }, "compId": 11, "child": [{ "type": "Box", "props": { "width": 155, "height": 155 }, "compId": 15, "child": [{ "type": "Image", "props": { "y": 99, "x": 78, "skin": "trial/caomei.png", "scaleY": 0.6, "scaleX": 0.6, "name": "icon", "centerY": 0, "centerX": 0 }, "compId": 14 }] }, { "type": "Button", "props": { "x": 0, "width": 155, "name": "btn", "height": 197, "bottom": 0 }, "compId": 16 }] }] }] }] }], "loadList": ["bg/底.png", "trial/随机.png", "trial/今日不再显示.png", "trial/√.png", "trial/试玩.png", "trial/caomei.png"], "loadList3D": [] };
  185. Window.TrialWindowUI = TrialWindowUI;
  186. REG("ui.Window.TrialWindowUI", TrialWindowUI);
  187. })(Window = ui.Window || (ui.Window = {}));
  188. })(ui || (ui = {}));
  189. class ShareUtil {
  190. constructor() {
  191. }
  192. ShareUtil() {
  193. }
  194. beginShare(callBack) {
  195. ShareUtil.beginShareTime = new Date().getTime();
  196. console.log("分享点击时间=" + ShareUtil.beginShareTime);
  197. ShareUtil.isSharing = true;
  198. ShareUtil.callback = callBack;
  199. }
  200. onRegister() {
  201. if (Laya.Browser.window.wx == null) {
  202. return;
  203. }
  204. Laya.Browser.window.wx.onShow(function (option) {
  205. console.log("onshow share start");
  206. if (ShareUtil.isSharing) {
  207. ShareUtil.isSharing = false;
  208. let time = new Date().getTime();
  209. console.log("分享回到游戏时间" + time);
  210. let wait = (time - ShareUtil.beginShareTime) / 1000;
  211. console.log("分享停留时间为:" + wait);
  212. let shareSuccess = false;
  213. if (wait >= 2) {
  214. if (wait < 4) {
  215. shareSuccess = (Math.random() > 0.7) ? false : true;
  216. }
  217. else {
  218. shareSuccess = true;
  219. }
  220. }
  221. else {
  222. shareSuccess = false;
  223. }
  224. if (shareSuccess == false) {
  225. Laya.Browser.window.wx.showToast({ title: "请重试一次" });
  226. ShareUtil.callback(false);
  227. }
  228. else {
  229. Laya.Browser.window.wx.showToast({ title: "分享成功" });
  230. ShareUtil.callback(true);
  231. }
  232. }
  233. });
  234. }
  235. }
  236. ShareUtil.Instance = new ShareUtil();
  237. ShareUtil.shareSuccessTime = 0;
  238. ShareUtil.isSharing = false;
  239. var Event = Laya.Event;
  240. var HttpRequest = Laya.HttpRequest;
  241. const PROTOCOL_URL = "https://fallraceapi.94xj.net/";
  242. class PROTOCOLS {
  243. }
  244. PROTOCOLS.Login = "user/login";
  245. PROTOCOLS.game = "game/start";
  246. PROTOCOLS.end = "game/play";
  247. PROTOCOLS.Sign = "sign/sign";
  248. PROTOCOLS.EquipHero = "theme/equipHero";
  249. PROTOCOLS.BuyHero = "theme/buyHero";
  250. PROTOCOLS.EquipHat = "theme/equipHat";
  251. PROTOCOLS.BuyHat = "theme/buyHat";
  252. PROTOCOLS.BuyDance = "theme/buyDance";
  253. PROTOCOLS.EquipDance = "theme/equipDance";
  254. PROTOCOLS.share = "fission/share";
  255. PROTOCOLS.vd = "fission/vd";
  256. PROTOCOLS.revival = "game/revival";
  257. PROTOCOLS.fissionhat = "fission/hat";
  258. PROTOCOLS.fissionhero = "fission/hero";
  259. PROTOCOLS.fissiondance = "fission/dance";
  260. PROTOCOLS.treasure = "treasure/click";
  261. PROTOCOLS.Config = "config/table";
  262. class NetworkManager {
  263. static get Instance() {
  264. if (NetworkManager.instance) {
  265. return NetworkManager.instance;
  266. }
  267. else {
  268. return new NetworkManager();
  269. }
  270. }
  271. constructor() {
  272. NetworkManager.instance = this;
  273. }
  274. login(progresscb, completecb, errorcb) {
  275. var userInfor = PlayerAccount.CurrentAccount;
  276. var ver = Main.Ver;
  277. let args = `code=${userInfor.Code}&nickname=${userInfor.NickName}&avatar=${userInfor.Avatar}&gender=${userInfor.Gender}&country=${userInfor.Country}&province=${userInfor.Province}&city=${userInfor.City}& device=${userInfor.Device}$&share_id=${userInfor.ShareId}&scene=${userInfor.Scene}&v=${ver}`;
  278. let httpRequest = new HttpRequest();
  279. httpRequest.once(Event.PROGRESS, this, this.onHttpRequestProgress, [progresscb, httpRequest]);
  280. httpRequest.once(Event.COMPLETE, this, this.onLoginRequestComplete, [completecb, httpRequest]);
  281. httpRequest.once(Event.ERROR, this, this.onHttpRequestError, [errorcb, httpRequest]);
  282. httpRequest.send(PROTOCOL_URL + PROTOCOLS.Login, args, "post", "text");
  283. }
  284. onHttpRequestProgress(progresscb, httpRequest) {
  285. if (progresscb) {
  286. console.log("HttpRequestProgress:...");
  287. progresscb.run();
  288. }
  289. }
  290. onLoginRequestComplete(completecb, httpRequest) {
  291. let data = JSON.parse(httpRequest.data);
  292. if (data["code"] != "0") {
  293. console.log("登录异常错误!错误信息:", httpRequest.data);
  294. return;
  295. }
  296. PlayerAccount.ServerTime = data["t"];
  297. PlayerAccount.CurrentAccount.SetAccountData(data);
  298. completecb.runWith(data);
  299. }
  300. onHttpRequestError(errorcb, httpRequest) {
  301. if (errorcb != null) {
  302. errorcb.runWith(httpRequest);
  303. }
  304. console.log("Error! Http request error..." + httpRequest.data);
  305. }
  306. HttpPostRequest(protocol, param, completecb, errorcb, hasToken = true) {
  307. let args = "";
  308. let url = PROTOCOL_URL + protocol;
  309. var account = PlayerAccount.CurrentAccount;
  310. var accountdata = account.CurAccountData;
  311. if (hasToken == true) {
  312. args = `token=${accountdata.m_token}&`;
  313. }
  314. WxApi.ShowLoading("连接网络中...");
  315. if (protocol == PROTOCOLS.game || protocol == PROTOCOLS.end || protocol == PROTOCOLS.fissionhat || protocol == PROTOCOLS.fissionhero || protocol == PROTOCOLS.fissiondance || protocol == PROTOCOLS.vd) {
  316. let str = "abcdefghijkimnopqrstuvwxyz0123456789";
  317. let code = "{";
  318. let mask = "";
  319. for (let i = 0; i < 4; i++) {
  320. mask += str[Math.floor(Math.random() * 100) % str.length];
  321. }
  322. for (let i = 0; i < param.length; i++) {
  323. for (let key in param[i]) {
  324. code += `\"${key}\":\"${param[i][key]}\"`;
  325. }
  326. if (i < param.length - 1) {
  327. code += ",";
  328. }
  329. else {
  330. code += "}";
  331. }
  332. }
  333. args += "_r=" + mask + this.base64Encode(code);
  334. }
  335. else {
  336. if (param != null) {
  337. for (let i = 0; i < param.length; i++) {
  338. for (let key in param[i]) {
  339. let val = param[i][key];
  340. args += `${key}=${val}`;
  341. if (i < param.length - 1) {
  342. args += "&";
  343. }
  344. }
  345. }
  346. }
  347. }
  348. let httpRequest = new HttpRequest();
  349. httpRequest.once(Event.COMPLETE, this, this.onHttpRequestComplete, [completecb, errorcb, httpRequest]);
  350. httpRequest.once(Event.ERROR, this, this.onHttpRequestError, [errorcb, httpRequest]);
  351. httpRequest.send(url, args, "post", "text");
  352. }
  353. onHttpRequestComplete(succeedcb, failurecb, httpRequest) {
  354. WxApi.HideLoading();
  355. let data = JSON.parse(httpRequest.data);
  356. if (data["code"] == 0) {
  357. PlayerAccount.CurrentAccount.SetAccountData(data);
  358. if (succeedcb != null) {
  359. succeedcb.runWith(data);
  360. }
  361. }
  362. else {
  363. if (failurecb != null) {
  364. failurecb.runWith(data);
  365. }
  366. Laya.timer.once(5000, this, () => { WxApi.HideLoading(); });
  367. console.log("Error! Http request complete error, code: " + data["code"] + " message: " + data["message"]);
  368. }
  369. }
  370. base64Encode(str) {
  371. var c1, c2, c3;
  372. var base64EncodeChars = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/";
  373. var i = 0, len = str.length, string = '';
  374. while (i < len) {
  375. c1 = str.charCodeAt(i++) & 0xff;
  376. if (i == len) {
  377. string += base64EncodeChars.charAt(c1 >> 2);
  378. string += base64EncodeChars.charAt((c1 & 0x3) << 4);
  379. string += "==";
  380. break;
  381. }
  382. c2 = str.charCodeAt(i++);
  383. if (i == len) {
  384. string += base64EncodeChars.charAt(c1 >> 2);
  385. string += base64EncodeChars.charAt(((c1 & 0x3) << 4) | ((c2 & 0xF0) >> 4));
  386. string += base64EncodeChars.charAt((c2 & 0xF) << 2);
  387. string += "=";
  388. break;
  389. }
  390. c3 = str.charCodeAt(i++);
  391. string += base64EncodeChars.charAt(c1 >> 2);
  392. string += base64EncodeChars.charAt(((c1 & 0x3) << 4) | ((c2 & 0xF0) >> 4));
  393. string += base64EncodeChars.charAt(((c2 & 0xF) << 2) | ((c3 & 0xC0) >> 6));
  394. string += base64EncodeChars.charAt(c3 & 0x3F);
  395. }
  396. return string;
  397. }
  398. }
  399. class ConfigTest {
  400. }
  401. ConfigTest.mission = [];
  402. ConfigTest.road = [];
  403. ConfigTest.things = [];
  404. ConfigTest.herodic = [];
  405. ConfigTest.hat = [];
  406. ConfigTest.cb = [];
  407. ConfigTest.effect = [];
  408. var Sprite3D = Laya.Sprite3D;
  409. var Vector4 = Laya.Vector4;
  410. var RoadType;
  411. (function (RoadType) {
  412. RoadType[RoadType["baseroad"] = 0] = "baseroad";
  413. RoadType[RoadType["fixedroad"] = 1] = "fixedroad";
  414. RoadType[RoadType["things"] = 2] = "things";
  415. })(RoadType || (RoadType = {}));
  416. var baseroaddata;
  417. (function (baseroaddata) {
  418. baseroaddata[baseroaddata["ZhiRoad"] = 0] = "ZhiRoad";
  419. })(baseroaddata || (baseroaddata = {}));
  420. var fixedroaddata;
  421. (function (fixedroaddata) {
  422. fixedroaddata[fixedroaddata["Ramps"] = 0] = "Ramps";
  423. fixedroaddata[fixedroaddata["PlateFinish"] = 1] = "PlateFinish";
  424. })(fixedroaddata || (fixedroaddata = {}));
  425. var thingsdata;
  426. (function (thingsdata) {
  427. thingsdata[thingsdata["Obstacle1"] = 1] = "Obstacle1";
  428. thingsdata[thingsdata["Obstacle2"] = 2] = "Obstacle2";
  429. thingsdata[thingsdata["Obstacle3"] = 3] = "Obstacle3";
  430. thingsdata[thingsdata["Obstacle4"] = 4] = "Obstacle4";
  431. thingsdata[thingsdata["Obstacle5"] = 5] = "Obstacle5";
  432. thingsdata[thingsdata["PlateTrampoline"] = 6] = "PlateTrampoline";
  433. thingsdata[thingsdata["RingBoost"] = 7] = "RingBoost";
  434. thingsdata[thingsdata["RingEagle"] = 8] = "RingEagle";
  435. thingsdata[thingsdata["PlateBend"] = 9] = "PlateBend";
  436. thingsdata[thingsdata["Box"] = 10] = "Box";
  437. thingsdata[thingsdata["Box1"] = 11] = "Box1";
  438. thingsdata[thingsdata["Box2"] = 12] = "Box2";
  439. thingsdata[thingsdata["Coin"] = 13] = "Coin";
  440. })(thingsdata || (thingsdata = {}));
  441. var buildtype;
  442. (function (buildtype) {
  443. buildtype[buildtype["xrz"] = 0] = "xrz";
  444. buildtype[buildtype["tt"] = 1] = "tt";
  445. buildtype[buildtype["ft"] = 2] = "ft";
  446. })(buildtype || (buildtype = {}));
  447. var effecttype;
  448. (function (effecttype) {
  449. effecttype[effecttype["tuowei"] = 0] = "tuowei";
  450. effecttype[effecttype["caidai"] = 1] = "caidai";
  451. effecttype[effecttype["huo"] = 2] = "huo";
  452. })(effecttype || (effecttype = {}));
  453. var RoleType;
  454. (function (RoleType) {
  455. RoleType[RoleType["colorrole1"] = 0] = "colorrole1";
  456. RoleType[RoleType["colorrole2"] = 1] = "colorrole2";
  457. RoleType[RoleType["colorrole3"] = 2] = "colorrole3";
  458. RoleType[RoleType["colorrole4"] = 3] = "colorrole4";
  459. RoleType[RoleType["colorrole5"] = 4] = "colorrole5";
  460. RoleType[RoleType["colorrole6"] = 5] = "colorrole6";
  461. RoleType[RoleType["fruitrole1"] = 6] = "fruitrole1";
  462. RoleType[RoleType["fruitrole2"] = 7] = "fruitrole2";
  463. RoleType[RoleType["fruitrole3"] = 8] = "fruitrole3";
  464. RoleType[RoleType["fruitrole4"] = 9] = "fruitrole4";
  465. RoleType[RoleType["fruitrole5"] = 10] = "fruitrole5";
  466. RoleType[RoleType["fruitrole6"] = 11] = "fruitrole6";
  467. })(RoleType || (RoleType = {}));
  468. var decore;
  469. (function (decore) {
  470. decore[decore["hat"] = 0] = "hat";
  471. decore[decore["cibang"] = 1] = "cibang";
  472. })(decore || (decore = {}));
  473. var decoretype;
  474. (function (decoretype) {
  475. decoretype[decoretype["colorhat1"] = 0] = "colorhat1";
  476. decoretype[decoretype["colorhat2"] = 1] = "colorhat2";
  477. decoretype[decoretype["colorhat3"] = 2] = "colorhat3";
  478. decoretype[decoretype["colorhat4"] = 3] = "colorhat4";
  479. decoretype[decoretype["colorhat5"] = 4] = "colorhat5";
  480. decoretype[decoretype["colorhat6"] = 5] = "colorhat6";
  481. decoretype[decoretype["colorcb1"] = 6] = "colorcb1";
  482. decoretype[decoretype["colorcb2"] = 7] = "colorcb2";
  483. decoretype[decoretype["colorcb3"] = 8] = "colorcb3";
  484. decoretype[decoretype["colorcb4"] = 9] = "colorcb4";
  485. decoretype[decoretype["colorcb5"] = 10] = "colorcb5";
  486. decoretype[decoretype["colorcb6"] = 11] = "colorcb6";
  487. })(decoretype || (decoretype = {}));
  488. class AssetPaths {
  489. }
  490. AssetPaths.scencepath = "subpackage/res/gamescene/LayaScene_gamescene/Conventional/gamescene.ls";
  491. AssetPaths.playerpath = {
  492. 1: "subpackage/res/playermodel/player1/Conventional/playermodel.lh",
  493. 2: "subpackage/res/playermodel/player2/Conventional/playermodel.lh",
  494. 3: "subpackage/res/playermodel/player3/Conventional/playermodel.lh",
  495. 4: "subpackage/res/playermodel/player4/Conventional/playermodel.lh",
  496. 5: "subpackage/res/playermodel/player5/Conventional/playermodel.lh",
  497. 6: "subpackage/res/playermodel/player6/Conventional/playermodel.lh",
  498. 7: "subpackage/res/playermodel/player7/Conventional/playermodel.lh"
  499. };
  500. AssetPaths.roadpath = {
  501. 1: "subpackage/res/road/baseroad/Conventional/road.lh",
  502. 2: "subpackage/res/road/fixedroad/Conventional/road.lh",
  503. 3: "subpackage/res/road/things/Conventional/road.lh",
  504. };
  505. AssetPaths.buildpath = "subpackage/res/builds/builds/Conventional/building.lh";
  506. AssetPaths.decoratepath = "subpackage/res/decorate/decorate/Conventional/decorate.lh";
  507. AssetPaths.planetxture = [
  508. "subpackage/res/planetexture/1.png",
  509. "subpackage/res/planetexture/2.png",
  510. "subpackage/res/planetexture/3.png"
  511. ];
  512. class ResourcesManager {
  513. constructor() {
  514. this.rolecolor = [
  515. new Vector4(137 / 255, 67 / 255, 299 / 255, 1),
  516. new Vector4(201 / 255, 67 / 255, 229 / 255, 1),
  517. new Vector4(228 / 255, 69 / 255, 114 / 255, 1),
  518. new Vector4(223 / 255, 146 / 255, 39 / 255, 1),
  519. new Vector4(207 / 255, 61 / 255, 62 / 255, 1),
  520. new Vector4(53 / 255, 172 / 255, 24 / 255, 1)
  521. ];
  522. this.hatcolor = [
  523. new Vector4(9 / 255, 119 / 255, 183 / 255, 1),
  524. new Vector4(42 / 255, 166 / 255, 12 / 255, 1),
  525. new Vector4(96 / 255, 72 / 255, 20 / 255, 1),
  526. new Vector4(155 / 255, 53 / 255, 181 / 255, 1),
  527. new Vector4(234 / 255, 104 / 255, 127 / 255, 1),
  528. new Vector4(243 / 255, 136 / 255, 0, 1)
  529. ];
  530. this.playerassets = {};
  531. this.roleassets = {};
  532. this.decorateasset = {};
  533. this.hatasset = {};
  534. this.cbasset = {};
  535. this.bsroadassets = {};
  536. this.fxroadassets = {};
  537. this.tsroadassets = {};
  538. this.buildsassets = {};
  539. this.planetextures = {};
  540. ResourcesManager.instance = this;
  541. }
  542. static get Instance() {
  543. if (ResourcesManager.instance) {
  544. return ResourcesManager.instance;
  545. }
  546. else {
  547. return new ResourcesManager();
  548. }
  549. }
  550. InitSkinAsset() {
  551. for (var key in this.playerassets) {
  552. if (key == "1") {
  553. var role1 = this.playerassets[key];
  554. for (var i = 0; i < 6; i++) {
  555. var colorrole = i == 0 ? this.playerassets[key] : Sprite3D.instantiate(role1);
  556. var skin = colorrole.getChildAt(0).getChildAt(0).getChildAt(2);
  557. var materail = skin.skinnedMeshRenderer.material;
  558. materail.albedoColor = this.rolecolor[i];
  559. colorrole.getChildAt(0).name = RoleType[i];
  560. this.roleassets[i + 1] = colorrole;
  561. }
  562. }
  563. else {
  564. this.roleassets[5 + Number(key)] = this.playerassets[key];
  565. this.roleassets[5 + Number(key)].getChildAt(0).name = RoleType[5 + Number(key)];
  566. }
  567. }
  568. for (var key in this.decorateasset) {
  569. if (key == "0") {
  570. var hat = this.decorateasset[key];
  571. for (var i = 0; i < 6; i++) {
  572. var colorhat = i == 0 ? this.decorateasset[key] : Sprite3D.instantiate(hat);
  573. var Sprite = colorhat.getChildAt(0);
  574. var materail2 = Sprite.meshRenderer.material;
  575. materail2.albedoColor = this.hatcolor[i];
  576. Sprite.name = decoretype[i];
  577. this.hatasset[i + 1] = Sprite;
  578. }
  579. }
  580. else {
  581. var cb = this.decorateasset[key];
  582. for (var i = 0; i < 6; i++) {
  583. var colorcb = i == 0 ? this.decorateasset[key] : Sprite3D.instantiate(cb);
  584. var Sprite = colorcb.getChildAt(0);
  585. var materai3 = Sprite.meshRenderer.material;
  586. materai3.albedoColor = this.rolecolor[i];
  587. Sprite.name = decoretype[i + 6];
  588. this.cbasset[i + 1] = Sprite;
  589. }
  590. }
  591. }
  592. }
  593. LoadBSRoad(_id, _complete) {
  594. if (this.bsroadassets[_id]) {
  595. _complete(this.bsroadassets[_id]);
  596. }
  597. else {
  598. var path = AssetPaths.roadpath[_id];
  599. Laya.loader.create(path, Laya.Handler.create(this, () => {
  600. var asset = Laya.loader.getRes(path.url);
  601. this.bsroadassets[_id] = asset;
  602. _complete(asset);
  603. Laya.loader.clearRes(path.url);
  604. }));
  605. }
  606. }
  607. LoadFXRoad(_id, _complete) {
  608. if (this.fxroadassets[_id]) {
  609. _complete(this.fxroadassets[_id]);
  610. }
  611. else {
  612. var path = AssetPaths.roadpath[_id];
  613. Laya.loader.create(path, Laya.Handler.create(this, () => {
  614. var asset = Laya.loader.getRes(path.url);
  615. this.fxroadassets[_id] = asset;
  616. _complete(asset);
  617. Laya.loader.clearRes(path.url);
  618. }));
  619. }
  620. }
  621. LoadTSRoad(_id, _complete) {
  622. if (this.tsroadassets[_id]) {
  623. _complete(this.tsroadassets[_id]);
  624. }
  625. else {
  626. var path = AssetPaths.roadpath[_id];
  627. Laya.loader.create(path, Laya.Handler.create(this, () => {
  628. var asset = Laya.loader.getRes(path.url);
  629. this.tsroadassets[_id] = asset;
  630. _complete(asset);
  631. Laya.loader.clearRes(path.url);
  632. }));
  633. }
  634. }
  635. LoadPlayer(_id, _complete) {
  636. if (this.playerassets[_id]) {
  637. _complete.runWith(this.playerassets[_id]);
  638. }
  639. else {
  640. var path = AssetPaths.playerpath[_id];
  641. Laya.loader.create(path, Laya.Handler.create(this, () => {
  642. var asset = Laya.loader.getRes(path.url);
  643. this.playerassets[_id] = asset;
  644. _complete.runWith(asset);
  645. Laya.loader.clearRes(path.url);
  646. }));
  647. }
  648. }
  649. }
  650. var Vector3 = Laya.Vector3;
  651. class TextData {
  652. constructor(_message, _pos, _size, _fontSize, _color = null) {
  653. this.fontSize = 30;
  654. this.message = "";
  655. this.size = new Laya.Vector2(_size.x, _size.y);
  656. this.fontSize = _fontSize;
  657. this.color = _color;
  658. this.message = _message;
  659. this.pos = _pos;
  660. }
  661. }
  662. class GameUtils {
  663. static Vector3MulNumber(v3, f) {
  664. return new Vector3(v3.x * f, v3.y * f, v3.z * f);
  665. }
  666. static angleToEangle(_angle) {
  667. return _angle * Math.PI / 180;
  668. }
  669. static absEangle(_angle) {
  670. var x = _angle.x;
  671. if (x == -0) {
  672. x = 0;
  673. }
  674. var y = _angle.y;
  675. if (y == -0) {
  676. y = 0;
  677. }
  678. var z = _angle.z;
  679. if (z == -0) {
  680. z = 0;
  681. }
  682. return new Vector3(x, y, z);
  683. }
  684. static debugVector3(_vector3) {
  685. console.log(_vector3.x + " " + _vector3.y + " " + _vector3.z);
  686. }
  687. static getConverseVector3(_vector3) {
  688. return new Vector3(-_vector3.x, -_vector3.y, -_vector3.z);
  689. }
  690. static getRandomInt(left, right) {
  691. if (left >= right) {
  692. return 0;
  693. }
  694. var size = right - left + 1;
  695. var curNumber = Math.random() * size + left;
  696. return Math.floor(curNumber);
  697. }
  698. static getRandom(left, right) {
  699. if (left >= right) {
  700. return 0;
  701. }
  702. var size = right - left + 1;
  703. var curNumber = Math.random() * size + left;
  704. return curNumber;
  705. }
  706. static getRandoms(left, right) {
  707. if (left >= right) {
  708. return 0;
  709. }
  710. var size = right - left;
  711. var curNumber = Math.random() * size + left;
  712. return curNumber;
  713. }
  714. static TweenMove(targetTransform, TargetPos, duration, _completeHandle = null) {
  715. var curPos = targetTransform.position;
  716. var tween = Laya.Tween.to(curPos, { x: TargetPos.x, y: TargetPos.y, z: TargetPos.z, update: new Laya.Handler(this, function () {
  717. targetTransform.position = curPos;
  718. }) }, duration * 1000, null, Laya.Handler.create(this, function () {
  719. tween.clear();
  720. if (_completeHandle != null) {
  721. _completeHandle.run();
  722. }
  723. }));
  724. return tween;
  725. }
  726. static TweenProgress(_progress, _fromValue, _tovalue, _duration, _completeHandle = null) {
  727. _progress.value = _fromValue;
  728. var tween = Laya.Tween.to(_progress, { value: _tovalue }, _duration * 1000, null, _completeHandle);
  729. return tween;
  730. }
  731. static lerp(form, to, t) {
  732. if (t <= 0) {
  733. return form;
  734. }
  735. else if (t >= 1) {
  736. return to;
  737. }
  738. var a = t * to + (1 - t) * form;
  739. return a;
  740. }
  741. static LogVector3(name, Pos) {
  742. console.log(name + ":" + Pos.x + " " + Pos.y + " " + Pos.z);
  743. }
  744. static LogVector2(name, Pos) {
  745. console.log(name + ":" + Pos.x + " " + Pos.y);
  746. }
  747. static LogRotioion(name, Rot) {
  748. console.log(name + ":" + Rot.x + " " + Rot.y + " " + Rot.z + " " + Rot.w);
  749. }
  750. static DelayToDo(_delayDuration, _doFunction, agrs = null) {
  751. Laya.timer.once(_delayDuration * 1000, this, _doFunction, [agrs], false);
  752. }
  753. static CopyDic(_obj) {
  754. var curObj = {};
  755. for (var key in _obj) {
  756. curObj[key] = _obj[key];
  757. }
  758. return curObj;
  759. }
  760. static TweenLookAtMove(targetTransform, TargetPos, lookPos, duration, _completeHandle = null) {
  761. var curPos = targetTransform.position;
  762. var tween = Laya.Tween.to(curPos, { x: TargetPos.x, y: TargetPos.y, z: TargetPos.z, update: new Laya.Handler(this, () => {
  763. targetTransform.position = curPos;
  764. var quaternion1 = new Laya.Quaternion();
  765. Laya.Quaternion.lookAt(curPos, lookPos, new Vector3(0, 1, 0), quaternion1);
  766. quaternion1.invert(quaternion1);
  767. Laya.Quaternion.slerp(targetTransform.rotation, quaternion1, 0.3, quaternion1);
  768. targetTransform.rotation = quaternion1;
  769. }) }, duration * 1000, null, Laya.Handler.create(this, function () {
  770. tween.clear();
  771. if (_completeHandle != null) {
  772. _completeHandle();
  773. }
  774. }));
  775. return tween;
  776. }
  777. static TweenGoldAward(_num, _pos = null, _completeHandle = null) {
  778. if (_num == 0)
  779. return;
  780. var parent = new Laya.Box;
  781. parent.width = 400;
  782. parent.height = 100;
  783. parent.pivotX = parent.width / 2;
  784. parent.pivotY = parent.height / 2;
  785. if (_pos == null) {
  786. _pos = new Laya.Vector2(Laya.stage.width / 2, Laya.stage.height / 2);
  787. }
  788. parent.pos(_pos.x, _pos.y);
  789. var _Image = new Laya.Image;
  790. _Image.skin = "localview/shoujiemian_1_6_1.png";
  791. _Image.width = 60;
  792. _Image.height = 60;
  793. _Image.left = 50;
  794. _Image.y = 10;
  795. parent.addChild(_Image);
  796. var curText = new Laya.Text;
  797. curText.width = 300;
  798. curText.height = 50;
  799. curText.align = "center";
  800. curText.valign = "middle";
  801. curText.font = "Microsoft YaHei";
  802. curText.fontSize = 35;
  803. curText.color = "#ff8e00";
  804. curText.bold = true;
  805. curText.font = "Microsoft YaHei";
  806. curText.text = "金币 +" + _num;
  807. curText.x = 60;
  808. curText.y = 10;
  809. parent.addChild(curText);
  810. Laya.stage.addChild(parent);
  811. var tween = Laya.Tween.to(parent, { y: parent.y - 200 }, 1000, Laya.Ease.expoInOut, Laya.Handler.create(this, () => {
  812. tween.clear();
  813. parent.destroy();
  814. if (_completeHandle) {
  815. _completeHandle.run();
  816. }
  817. }), 100);
  818. }
  819. static TweenText(textData, _hight, _completeHandle = null, hide = true) {
  820. var curText = new Laya.Text();
  821. curText.width = textData.size.x;
  822. curText.height = textData.size.y;
  823. curText.align = "center";
  824. curText.valign = "middle";
  825. curText.font = "Microsoft YaHei";
  826. curText.fontSize = textData.fontSize;
  827. curText.pivotX = curText.width / 2;
  828. curText.pivotY = curText.height / 2;
  829. curText.color = "#5ad122";
  830. curText.bold = true;
  831. curText.stroke = 5;
  832. curText.strokeColor = "#ffffff";
  833. if (textData.color) {
  834. textData.color = textData.color;
  835. }
  836. curText.text = textData.message;
  837. curText.zOrder = 1;
  838. Laya.stage.addChild(curText);
  839. curText.pos(textData.pos.x, textData.pos.y);
  840. var tween = Laya.Tween.to(curText, { y: curText.y - _hight, update: new Laya.Handler(this, function () {
  841. }) }, 500, Laya.Ease.expoInOut, Laya.Handler.create(this, function () {
  842. tween.clear();
  843. if (hide) {
  844. curText.destroy();
  845. }
  846. if (_completeHandle) {
  847. _completeHandle.run();
  848. }
  849. }));
  850. if (hide) {
  851. Laya.Tween.to(curText, { alpha: 0.4 }, 500);
  852. }
  853. return curText;
  854. }
  855. static GetMoney(_num, _pos = null, _completeHandle = null) {
  856. if (_num == 0)
  857. return;
  858. var fafaafsfa = new Laya.Box;
  859. fafaafsfa.width = 400;
  860. fafaafsfa.height = 100;
  861. fafaafsfa.pivotX = fafaafsfa.width / 2;
  862. fafaafsfa.pivotY = fafaafsfa.height / 2;
  863. if (_pos == null) {
  864. _pos = new Laya.Vector2(Laya.stage.width / 2, Laya.stage.height / 2);
  865. }
  866. fafaafsfa.pos(_pos.x, _pos.y);
  867. var aafafaffa = new Laya.Image;
  868. aafafaffa.skin = "sign/qiandao_1_5_4.png";
  869. aafafaffa.width = 60;
  870. aafafaffa.height = 60;
  871. aafafaffa.left = 50;
  872. aafafaffa.y = 10;
  873. fafaafsfa.addChild(aafafaffa);
  874. var faasfafsafs = new Laya.Text;
  875. faasfafsafs.width = 300;
  876. faasfafsafs.height = 50;
  877. faasfafsafs.align = "center";
  878. faasfafsafs.valign = "middle";
  879. faasfafsafs.font = "Microsoft YaHei";
  880. faasfafsafs.fontSize = 35;
  881. faasfafsafs.color = "#ff8e00";
  882. faasfafsafs.bold = true;
  883. faasfafsafs.font = "Microsoft YaHei";
  884. faasfafsafs.text = "金币 +" + _num;
  885. faasfafsafs.x = 60;
  886. faasfafsafs.y = 10;
  887. fafaafsfa.addChild(faasfafsafs);
  888. Laya.stage.addChild(fafaafsfa);
  889. var faasfsaf = Laya.Tween.to(fafaafsfa, { y: fafaafsfa.y - 200 }, 1000, Laya.Ease.expoInOut, Laya.Handler.create(this, () => {
  890. faasfsaf.clear();
  891. fafaafsfa.destroy();
  892. if (_completeHandle) {
  893. _completeHandle.run();
  894. }
  895. }), 100);
  896. }
  897. }
  898. class ADPlayer {
  899. static initAd() {
  900. if (this.isInit)
  901. return;
  902. if (!Main.OnWx)
  903. return;
  904. this.rewardedVideoAd = Laya.Browser.window.wx.createRewardedVideoAd({ adUnitId: this.videlAdUnitId });
  905. this.rewardedVideoAd.onLoad(() => {
  906. console.log('激励视频 广告加载成功');
  907. this.videoAdIsload = true;
  908. });
  909. this.rewardedVideoAd.onError(err => {
  910. console.log("激励视屏加载失败:" + err);
  911. this.videoAdIsload = false;
  912. });
  913. this.bannerCreateTimes = 0;
  914. this.isInit = true;
  915. }
  916. static showVideoAd(callback) {
  917. if (Main.OnWx) {
  918. console.log("showVideoAd , videoAdIsload:" + this.videoAdIsload);
  919. if (PlayerAccount.CurrentAccount.CurAccountData.share) {
  920. WxApi.shareImage("看视频", null, "看视频");
  921. }
  922. if (PlayerAccount.CurrentAccount.CurAccountData.video == false) {
  923. return;
  924. }
  925. this.RegVideo(callback);
  926. this.rewardedVideoAd.show().catch(err => {
  927. this.rewardedVideoAd.load().then(() => {
  928. this.RegVideo(callback);
  929. this.rewardedVideoAd.show();
  930. });
  931. });
  932. }
  933. else {
  934. callback(false);
  935. }
  936. }
  937. static RegVideo(callback) {
  938. this.rewardedVideoAd.offClose();
  939. this.rewardedVideoAd.onClose(res => {
  940. console.log("激励视频关闭:" + res.isEnded);
  941. console.log(callback);
  942. if (res && res.isEnded || res === undefined) {
  943. callback && callback(true);
  944. }
  945. else {
  946. callback && callback(false);
  947. }
  948. this.rewardedVideoAd.offClose();
  949. });
  950. }
  951. static showBannerAd(gap = 0, callVack = null, iswait = false) {
  952. if (!Main.OnWx)
  953. return;
  954. if (this.bannerCreateTimes >= 10000) {
  955. var hh = this.ResetBannerHight(gap);
  956. if (iswait) {
  957. this.bannerAd.hide();
  958. Laya.timer.once(PlayerAccount.CurrentAccount.CurAccountData.cheattime * 1000, this, () => {
  959. if (callVack != null) {
  960. callVack(hh);
  961. }
  962. this.bannerAd.show();
  963. });
  964. }
  965. else {
  966. if (callVack != null) {
  967. callVack(hh);
  968. }
  969. this.bannerAd.show();
  970. }
  971. }
  972. else {
  973. var idd = this.bannerAdUnitId;
  974. console.log("adUnitId:" + idd);
  975. let newBanner = Laya.Browser.window.wx.createBannerAd({
  976. adUnitId: idd,
  977. style: {
  978. left: 0,
  979. top: 0,
  980. width: 460
  981. }
  982. });
  983. newBanner.onError(err => {
  984. console.log(err);
  985. if (callVack != null) {
  986. callVack(null);
  987. }
  988. this.ResetBannerHight(gap);
  989. });
  990. newBanner.onLoad(() => {
  991. this.bannerCreateTimes++;
  992. if (this.bannerAd)
  993. this.bannerAd.destroy();
  994. this.bannerAd = newBanner;
  995. var hight = this.ResetBannerHight(gap);
  996. if (iswait) {
  997. this.bannerAd.hide();
  998. Laya.timer.once(PlayerAccount.CurrentAccount.CurAccountData.cheattime * 1000, this, () => {
  999. if (callVack != null) {
  1000. callVack(hight);
  1001. }
  1002. this.bannerAd.show();
  1003. });
  1004. }
  1005. else {
  1006. if (callVack != null) {
  1007. callVack(hight);
  1008. }
  1009. this.bannerAd.show();
  1010. }
  1011. });
  1012. }
  1013. }
  1014. static ResetBannerHight(gap) {
  1015. if (this.bannerAd) {
  1016. let info = Laya.Browser.window.wx.getSystemInfoSync();
  1017. this.bannerAd.style.width = info.windowWidth;
  1018. this.bannerAd.style.top = info.windowHeight - this.bannerAd.style.realHeight - gap;
  1019. return Laya.stage.height / info.windowHeight * this.bannerAd.style.realHeight;
  1020. }
  1021. }
  1022. static ClearBanner() {
  1023. Laya.timer.clearAll(this);
  1024. if (!Main.OnWx)
  1025. return;
  1026. if (this.bannerAd)
  1027. this.bannerAd.hide();
  1028. }
  1029. static hiddenBannerAd() {
  1030. if (!Main.OnWx)
  1031. return;
  1032. if (this.bannerAd)
  1033. this.bannerAd.hide();
  1034. }
  1035. static BannerAdEnable() {
  1036. if (!Main.OnWx)
  1037. return;
  1038. if (this.bannerAd)
  1039. this.bannerAd.show();
  1040. }
  1041. static get CanCheat() {
  1042. var cheat = PlayerAccount.CurrentAccount.CurAccountData.cheat;
  1043. if (cheat == false) {
  1044. console.log("cheat:" + cheat);
  1045. return false;
  1046. }
  1047. if (Main.sceneValue == "1037" || Main.sceneValue == "1058"
  1048. || Main.sceneValue == "1067" || Main.sceneValue == "1095") {
  1049. console.log("cheat:true-> " + Main.sceneValue);
  1050. return true;
  1051. }
  1052. else {
  1053. var checkscence = PlayerAccount.CurrentAccount.CurAccountData.checkscence;
  1054. if (checkscence == false) {
  1055. console.log("cheat:true->checkscence: " + checkscence);
  1056. return true;
  1057. }
  1058. }
  1059. console.log("cheat:false-> " + Main.sceneValue);
  1060. return false;
  1061. }
  1062. static MoveButton(btn, ShowBanner = true, complete = null, gap = 0) {
  1063. if (PlayerAccount.CurrentAccount.CurAccountData.banner) {
  1064. ADPlayer.hiddenBannerAd();
  1065. if (ADPlayer.CanCheat == false) {
  1066. btn.bottom = 350;
  1067. ADPlayer.showBannerAd();
  1068. }
  1069. else {
  1070. if (ShowBanner) {
  1071. btn.bottom = 100;
  1072. btn.mouseEnabled = false;
  1073. ADPlayer.showBannerAd(gap, (height) => {
  1074. var end = Laya.stage.height - height - btn.height;
  1075. btn.y = end - 40;
  1076. }, true);
  1077. Laya.timer.once(PlayerAccount.CurrentAccount.CurAccountData.cheattime * 1000, this, () => {
  1078. btn.mouseEnabled = true;
  1079. if (complete != null) {
  1080. complete();
  1081. }
  1082. });
  1083. }
  1084. else {
  1085. if (complete != null) {
  1086. complete();
  1087. }
  1088. }
  1089. }
  1090. }
  1091. }
  1092. }
  1093. ADPlayer.videlAdUnitId = "adunit-99203ac49ea44bd0";
  1094. ADPlayer.bannerAdUnitId = "adunit-398817d584c5941d";
  1095. ADPlayer.isInit = false;
  1096. ADPlayer.videoAdIsload = false;
  1097. ADPlayer.bannerCreateTimes = 0;
  1098. class RecommendWindow extends ui.Window.RecommendWindowUI {
  1099. constructor() {
  1100. super();
  1101. this.cheat = false;
  1102. this.index = 0;
  1103. this.loopdir = 1;
  1104. RecommendWindow.instance = this;
  1105. }
  1106. static get Instance() {
  1107. return RecommendWindow.instance;
  1108. }
  1109. OnOpen(_data = null) {
  1110. this.choutiview.visible = false;
  1111. this.height = Laya.stage.height;
  1112. }
  1113. ShowRecommendWindow(_cainixihuan, fuhuotuijian, _chouti, _siwangtuijian, _baokuanyouxi) {
  1114. Laya.timer.clearAll(this);
  1115. if (_cainixihuan || (!_cainixihuan && !fuhuotuijian)) {
  1116. this.ShowCaiNiXiHuanView(_cainixihuan);
  1117. }
  1118. if (fuhuotuijian || (!_cainixihuan && !fuhuotuijian)) {
  1119. this.ShowCaiNiXiHuanView(fuhuotuijian);
  1120. }
  1121. this.ShowSiWangTuiJianView(_siwangtuijian);
  1122. this.ShowChouTi(_chouti);
  1123. this.ShowBaoKuanYouXiView(_baokuanyouxi);
  1124. }
  1125. ShowBaoKuanYouXiView(_open) {
  1126. this.baokuanyouxi.visible = _open;
  1127. if (_open == false)
  1128. return;
  1129. this.RefreshBaoKuanYouXi();
  1130. Laya.timer.loop(2000, this, this.LoopBaoKuan);
  1131. }
  1132. LoopBaoKuan() {
  1133. this.index++;
  1134. if (this.index > PlayerAccount.CurrentAccount.CurAccountData.redata.length - 1) {
  1135. this.index = 0;
  1136. }
  1137. this.RefreshBaoKuanYouXi();
  1138. }
  1139. RefreshBaoKuanYouXi() {
  1140. var data = PlayerAccount.CurrentAccount.CurAccountData.redata[this.index];
  1141. var icon = this.baokuanyouxi.getChildByName("icon");
  1142. icon.skin = data.icon;
  1143. var btn = this.baokuanyouxi.getChildByName("btn");
  1144. btn.clickHandler = Laya.Handler.create(this, this.ClickBNavigate, [data], false);
  1145. }
  1146. ShowCaiNiXiHuanView(_open) {
  1147. this.cainixihuan.visible = _open;
  1148. if (_open == false)
  1149. return;
  1150. this.cainixihuan.bottom = 0;
  1151. this.cainixihuanlist.hScrollBarSkin = "";
  1152. this.cainixihuanlist.array = PlayerAccount.CurrentAccount.CurAccountData.redata;
  1153. this.cainixihuanlist.renderHandler = Laya.Handler.create(this, this.RenderList, null, false);
  1154. Laya.timer.loop(10, this, this.LoopList, [this.cainixihuanlist]);
  1155. this.loopdir = 1;
  1156. }
  1157. ShowChouTi(_open) {
  1158. this.chouti.visible = _open;
  1159. this.choutiBtn.visible = true;
  1160. if (_open == false)
  1161. return;
  1162. ADPlayer.ClearBanner();
  1163. this.choutiBtn.clickHandler = Laya.Handler.create(this, this.OpenChouTiView);
  1164. this.closeCt.clickHandler = Laya.Handler.create(this, this.OnBackHome);
  1165. }
  1166. OnBackHome() {
  1167. WindowManager.Instance.ClosePopView(WindowType.RecommendWindow);
  1168. }
  1169. OpenChouTiView(_open) {
  1170. this.choutiview.visible = _open;
  1171. this.sharebtn.visible = true;
  1172. if (_open == false) {
  1173. if (WindowManager.Instance.curOpenedView.name == "HomeWindow")
  1174. WindowManager.Instance.ShowWindow(WindowType.HomeWindow);
  1175. return;
  1176. }
  1177. this.choutilist.vScrollBarSkin = "";
  1178. this.choutilist.array = PlayerAccount.CurrentAccount.CurAccountData.redata;
  1179. this.choutilist.renderHandler = Laya.Handler.create(this, this.RenderList, null, false);
  1180. this.ctList.hScrollBarSkin = "";
  1181. this.ctList.array = PlayerAccount.CurrentAccount.CurAccountData.redata;
  1182. this.ctList.renderHandler = Laya.Handler.create(this, this.Renderct2List, null, false);
  1183. Laya.timer.loop(10, this, this.LoopList, [this.ctList]);
  1184. this.loopdir = 1;
  1185. this.closeCt.clickHandler = Laya.Handler.create(this, this.OpenChouTiView, [false], false);
  1186. this.sharebtn.clickHandler = Laya.Handler.create(this, this.OnShare, null, false);
  1187. }
  1188. ShowSiWangTuiJianView(_open) {
  1189. this.siwangtuijian.visible = _open;
  1190. if (_open == false)
  1191. return;
  1192. this.siwangtuijianlist.vScrollBarSkin = "";
  1193. this.siwangtuijianlist.array = PlayerAccount.CurrentAccount.CurAccountData.redata;
  1194. this.siwangtuijianlist.renderHandler = Laya.Handler.create(this, this.RenderList, null, false);
  1195. Laya.timer.loop(10, this, this.LoopList, [this.siwangtuijianlist]);
  1196. this.loopdir = 1;
  1197. for (var i = 0; i < this.siwangtuijianlist.array.length; i++) {
  1198. this.siwangtuijianlist.array[i].shownum++;
  1199. }
  1200. }
  1201. OnShare() {
  1202. WxApi.shareImage("互推界面分享", null, "1");
  1203. }
  1204. static ListSort(a, b) {
  1205. if (a.sort > b.sort) {
  1206. return 1;
  1207. }
  1208. else {
  1209. return -1;
  1210. }
  1211. }
  1212. RenderList(_box, index) {
  1213. var data = _box.dataSource;
  1214. var icon = _box.getChildAt(0).getChildByName("icon");
  1215. icon.skin = data.icon;
  1216. var name = _box.getChildAt(0).getChildByName("name");
  1217. name.text = data.title;
  1218. var btn = _box.getChildAt(0).getChildByName("btn");
  1219. var num = _box.getChildAt(0).getChildByName("num");
  1220. if (num)
  1221. num.text = GameUtils.getRandomInt(24841, 654878).toString() + "人玩";
  1222. if (this.cheat) {
  1223. btn.clickHandler = Laya.Handler.create(this, this.ClickBNavigate, [data], false);
  1224. }
  1225. else {
  1226. btn.clickHandler = Laya.Handler.create(this, this.ClickNavigate, [data], false);
  1227. }
  1228. }
  1229. Renderct2List(_box, index) {
  1230. var data = _box.dataSource;
  1231. var icon = _box.getChildByName("icon");
  1232. icon.skin = data.icon;
  1233. var btn = _box.getChildByName("btn");
  1234. if (this.cheat) {
  1235. btn.clickHandler = Laya.Handler.create(this, this.ClickBNavigate, [data], false);
  1236. }
  1237. else {
  1238. btn.clickHandler = Laya.Handler.create(this, this.ClickNavigate, [data], false);
  1239. }
  1240. }
  1241. ClickBNavigate(data) {
  1242. var appid = data.appid;
  1243. var path = data.path;
  1244. let param = { "appId": appid.toString(), "path": path.toString() };
  1245. RecommendWindow.Instance.OpenChouTiView(true);
  1246. if (WindowManager.Instance.curOpenedView.name == "ReviveWindow") {
  1247. RecommendWindow.Instance.closeCt.clickHandler = Laya.Handler.create(this, () => {
  1248. RecommendWindow.Instance.ShowRecommendWindow(false, false, false, true, false);
  1249. });
  1250. }
  1251. if (Main.OnWx) {
  1252. WxApi.Instance.recordAldEvent("导出-总点击数", "1");
  1253. if (data.jump) {
  1254. Laya.Browser.window.wx.navigateToMiniProgram({
  1255. appId: appid.toString(),
  1256. path: path.toString(),
  1257. extraData: {
  1258. next_appid: data.next_appid,
  1259. next_path: data.next_path
  1260. },
  1261. envVersion: 'develop',
  1262. success: res => {
  1263. WxApi.Instance.recordAldEvent("导出成功-总用户数", "1");
  1264. WxApi.Instance.recordAldEvent("导出成功-" + data.title, "1");
  1265. console.log("跳转成功...");
  1266. },
  1267. fail: res => {
  1268. console.log("跳转失败...");
  1269. }
  1270. });
  1271. }
  1272. else {
  1273. var marray = [data.image];
  1274. Laya.Browser.window.wx.previewImage({
  1275. current: data.image,
  1276. urls: marray,
  1277. success: res => {
  1278. WxApi.Instance.recordAldEvent("显示游戏二维码成功", "1");
  1279. },
  1280. fail: res => {
  1281. }
  1282. });
  1283. }
  1284. }
  1285. }
  1286. ClickNavigate(data) {
  1287. var appid = data.appid;
  1288. var path = data.path;
  1289. let param = { "appId": appid.toString(), "path": path.toString() };
  1290. if (Main.OnWx) {
  1291. WxApi.Instance.recordAldEvent("导出-总点击数", "1");
  1292. if (data.jump) {
  1293. Laya.Browser.window.wx.navigateToMiniProgram({
  1294. appId: appid.toString(),
  1295. path: path.toString(),
  1296. extraData: {
  1297. next_appid: data.next_appid,
  1298. next_path: data.next_path
  1299. },
  1300. envVersion: 'develop',
  1301. success: res => {
  1302. WxApi.Instance.recordAldEvent("导出成功-总用户数", "1");
  1303. WxApi.Instance.recordAldEvent("导出成功-" + data.title, "1");
  1304. console.log("跳转成功...");
  1305. },
  1306. fail: res => {
  1307. console.log("跳转失败...");
  1308. }
  1309. });
  1310. }
  1311. else {
  1312. var marray = [data.image];
  1313. Laya.Browser.window.wx.previewImage({
  1314. current: data.image,
  1315. urls: marray,
  1316. success: res => {
  1317. WxApi.Instance.recordAldEvent("显示游戏二维码成功", "1");
  1318. },
  1319. fail: res => {
  1320. }
  1321. });
  1322. }
  1323. }
  1324. }
  1325. LoopList(_list) {
  1326. if (this.loopdir > 0) {
  1327. if (_list.scrollBar.value < _list.scrollBar.max) {
  1328. _list.scrollBar.value += 1;
  1329. }
  1330. else {
  1331. this.loopdir *= -1;
  1332. }
  1333. }
  1334. else {
  1335. if (_list.scrollBar.value > 0) {
  1336. _list.scrollBar.value -= 1;
  1337. }
  1338. else {
  1339. this.loopdir *= -1;
  1340. }
  1341. }
  1342. }
  1343. OnHide() {
  1344. this.cheat = false;
  1345. this.ShowRecommendWindow(false, false, false, false, false);
  1346. Laya.timer.clearAll(this);
  1347. }
  1348. }
  1349. var Vector3$1 = Laya.Vector3;
  1350. class Rigbody extends Laya.Script3D {
  1351. constructor() {
  1352. super(...arguments);
  1353. this.m_life = 1;
  1354. this.m_time = 0;
  1355. this.m_resistance = 0.03;
  1356. this.OnLand = true;
  1357. this.hit = new Laya.HitResult();
  1358. this.offestY = 0;
  1359. this.g = 1;
  1360. this.curdir = new Vector3$1();
  1361. this.curPos = new Vector3$1();
  1362. }
  1363. onAwake() {
  1364. this.m_sprite = this.owner;
  1365. Laya.timer.once(this.m_life * 1000, this, this.OnEnd);
  1366. Laya.timer.frameLoop(1, this, this.Update);
  1367. }
  1368. OnEnd() {
  1369. Laya.timer.clearAll(this);
  1370. this.destroy();
  1371. }
  1372. CheckPlaneCollider() {
  1373. var startpoint = new Vector3$1(this.m_sprite.transform.position.x, this.m_sprite.transform.position.y, this.m_sprite.transform.position.z);
  1374. var dir = new Vector3$1(0, -1, 0);
  1375. var ray = new Laya.Ray(startpoint, dir);
  1376. if (ScenceManager.Instance.GameScence.physicsSimulation.rayCast(ray, this.hit, 0.5)) {
  1377. if (this.hit.collider.collisionGroup != ColliderLay.Plane)
  1378. return;
  1379. var dis = this.m_sprite.transform.position.y - this.hit.point.y;
  1380. if (this.OnLand) {
  1381. if (dis > 0.15) {
  1382. this.OnLand = false;
  1383. return;
  1384. }
  1385. else {
  1386. this.m_sprite.transform.position = new Vector3$1(this.m_sprite.transform.position.x, this.hit.point.y + 0.1, this.m_sprite.transform.position.z);
  1387. }
  1388. }
  1389. else {
  1390. if (dis < 0.01) {
  1391. this.OnLand = true;
  1392. this.OnPlane();
  1393. }
  1394. }
  1395. }
  1396. else {
  1397. this.OnLand = false;
  1398. }
  1399. }
  1400. OnPlane() {
  1401. }
  1402. gravity() {
  1403. this.offestY -= this.g * this.m_time * this.m_time;
  1404. }
  1405. AddVelocity(_dir, _speed) {
  1406. Vector3$1.normalize(_dir, this.curdir);
  1407. Vector3$1.scale(this.curdir, _speed, this.curdir);
  1408. Laya.timer.frameLoop(1, this, this.Move);
  1409. }
  1410. Update() {
  1411. this.m_time += 0.012;
  1412. this.gravity();
  1413. this.CheckPlaneCollider();
  1414. }
  1415. Move() {
  1416. var mpos = this.m_sprite.transform.position;
  1417. Vector3$1.add(mpos, this.curdir, this.curPos);
  1418. if (this.OnLand) {
  1419. this.curPos = new Vector3$1(this.curPos.x, this.m_sprite.transform.position.y, this.curPos.z);
  1420. }
  1421. else {
  1422. Vector3$1.add(this.curPos, new Vector3$1(0, this.offestY, 0), this.curPos);
  1423. }
  1424. this.m_sprite.transform.position = this.curPos;
  1425. Vector3$1.lerp(this.curdir, new Vector3$1(0, 0, 0), this.m_resistance, this.curdir);
  1426. if (Vector3$1.scalarLength(this.curdir) < 0.01) {
  1427. Laya.timer.clear(this, this.Move);
  1428. }
  1429. }
  1430. }
  1431. var SoundType;
  1432. (function (SoundType) {
  1433. SoundType[SoundType["crash"] = 0] = "crash";
  1434. SoundType[SoundType["die"] = 1] = "die";
  1435. SoundType[SoundType["extraspeed"] = 2] = "extraspeed";
  1436. SoundType[SoundType["gold"] = 3] = "gold";
  1437. SoundType[SoundType["jump"] = 4] = "jump";
  1438. SoundType[SoundType["land"] = 5] = "land";
  1439. SoundType[SoundType["xp"] = 6] = "xp";
  1440. SoundType[SoundType["fly"] = 7] = "fly";
  1441. })(SoundType || (SoundType = {}));
  1442. class PlaySoundManager {
  1443. static SoundPath(_type) {
  1444. return "subpackage/res/sound/" + SoundType[_type] + ".wav";
  1445. }
  1446. static Play(type) {
  1447. if (PlaySoundManager.CanPlaySound) {
  1448. this.NomalSources = Laya.SoundManager.playSound(this.SoundPath(type));
  1449. }
  1450. }
  1451. }
  1452. PlaySoundManager.SoundVolume = 100;
  1453. PlaySoundManager.CanPlaySound = true;
  1454. class Queue {
  1455. constructor() {
  1456. this.players = [];
  1457. Queue.instance = this;
  1458. this.InitQueue();
  1459. }
  1460. static get Instance() {
  1461. if (Queue.instance) {
  1462. return Queue.instance;
  1463. }
  1464. else {
  1465. return new Queue();
  1466. }
  1467. }
  1468. InitQueue() {
  1469. EventManager.GameStateEventOn(GameState.Win, this, this.OnGameEnd);
  1470. EventManager.GameStateEventOn(GameState.End, this, this.OnGameOver);
  1471. EventManager.GameStateEventOn(GameState.Playing, this, this.OnGamePlaying);
  1472. EventManager.EventOn(EventType.CompleteStage, this, this.OnPlayerStageChange);
  1473. }
  1474. signup(runner) {
  1475. this.players.push(runner);
  1476. }
  1477. OnGamePlaying() {
  1478. Laya.timer.once(1000, this, () => {
  1479. Laya.timer.frameLoop(1, this, this.SortPlayer);
  1480. });
  1481. }
  1482. OnGameEnd() {
  1483. Laya.timer.clear(this, this.SortPlayer);
  1484. }
  1485. OnGameOver() {
  1486. this.players = [];
  1487. Laya.timer.clear(this, this.SortPlayer);
  1488. }
  1489. OnPlayerStageChange() {
  1490. for (var i = 0; i < this.players.length; i++) {
  1491. if (this.players[i].Ai) {
  1492. if (this.players[i].die) {
  1493. this.players[i].Cheat();
  1494. }
  1495. }
  1496. }
  1497. }
  1498. SortPlayer() {
  1499. this.players.sort(this.Sort);
  1500. EventManager.EventTrigger(EventType.PlayerRank, [this.players]);
  1501. if (this.Champion == null || this.Champion.Id != this.players[0].Id) {
  1502. this.Champion = this.players[0];
  1503. EventManager.EventTrigger(EventType.crownchange, this.players[0].Id);
  1504. EventManager.EventTrigger(EventType.ScoreChange, this.GetPlayerScore);
  1505. }
  1506. }
  1507. get GetPlayerScore() {
  1508. for (var i = 0; i < this.players.length; i++) {
  1509. var player = this.players[i];
  1510. if (!player.Ai) {
  1511. return i + 1;
  1512. }
  1513. }
  1514. }
  1515. Sort(a, b) {
  1516. if (a.m_sprite.transform.position.z > b.m_sprite.transform.position.z) {
  1517. return -1;
  1518. }
  1519. else {
  1520. return 1;
  1521. }
  1522. }
  1523. }
  1524. var Animator = Laya.Animator;
  1525. var Vector3$2 = Laya.Vector3;
  1526. var ColliderLay;
  1527. (function (ColliderLay) {
  1528. ColliderLay[ColliderLay["Play"] = Laya.Physics3DUtils.COLLISIONFILTERGROUP_CUSTOMFILTER1] = "Play";
  1529. ColliderLay[ColliderLay["Npc"] = Laya.Physics3DUtils.COLLISIONFILTERGROUP_CUSTOMFILTER2] = "Npc";
  1530. ColliderLay[ColliderLay["Plane"] = Laya.Physics3DUtils.COLLISIONFILTERGROUP_CUSTOMFILTER10] = "Plane";
  1531. ColliderLay[ColliderLay["things"] = Laya.Physics3DUtils.COLLISIONFILTERGROUP_CUSTOMFILTER3] = "things";
  1532. ColliderLay[ColliderLay["dieplane"] = Laya.Physics3DUtils.COLLISIONFILTERGROUP_CUSTOMFILTER5] = "dieplane";
  1533. })(ColliderLay || (ColliderLay = {}));
  1534. class Runner extends Laya.Script3D {
  1535. constructor() {
  1536. super(...arguments);
  1537. this.Ai = false;
  1538. this.aioffestx = 0;
  1539. this.aimiss = 0;
  1540. this.m_speed = 1;
  1541. this.m_curstages = [];
  1542. this.offest = new Vector3$2();
  1543. this.outlandtime = 0;
  1544. this.OnLand = true;
  1545. this.hit = new Laya.HitResult();
  1546. this.JS = false;
  1547. this.delayMove = false;
  1548. this.nextpoint = [];
  1549. this.oldpoint = [];
  1550. this.LandTime = 0;
  1551. this.enteroutplane = false;
  1552. this.fly = false;
  1553. this.flytime = 0;
  1554. this.flyspeed = 2;
  1555. this.flycutrate = 0.01;
  1556. this.flycounttime = 0;
  1557. this.extracutrate = 0.01;
  1558. this.extraspeed = 0;
  1559. this.extraspeedtime = 0;
  1560. this.JumpDuration = 0;
  1561. this.jump = false;
  1562. this.csp = 0;
  1563. this.JumpHigth = 0;
  1564. this.bacoZ = 2;
  1565. this.currotV = new Vector3$2();
  1566. this.currot = new Laya.Quaternion;
  1567. this.NormalizeSpeed = new Vector3$2();
  1568. this.turndir = new Vector3$2(1, 0, 0);
  1569. this.backrot = false;
  1570. this.canmove = false;
  1571. this.die = false;
  1572. this.curpos = new Vector3$2();
  1573. this.endroad = false;
  1574. this.curspeed = 0;
  1575. this.AutoMoveSpeed = 0.5;
  1576. this.curautospeed = 0;
  1577. }
  1578. onAwake() {
  1579. this.m_sprite = this.owner;
  1580. this.m_model = this.m_sprite.getChildAt(0);
  1581. this.m_animator = this.m_sprite.getChildAt(0).getComponent(Animator);
  1582. this.m_flySprite = PoolManager.Instance.CreatMeshSprite3D(ResourcesManager.Instance.FalconMesh, "");
  1583. this.m_sprite.addChild(this.m_flySprite);
  1584. this.m_flySprite.transform.localPosition = new Vector3$2(0, 0.95, 0);
  1585. this.m_flySprite.transform.localScale = new Vector3$2(0.36, 0.36, 0.36);
  1586. this.m_flySprite.active = false;
  1587. this.m_hat = this.m_model.getChildAt(0).getChildAt(0);
  1588. this.m_cb = this.m_model.getChildAt(1).getChildAt(0);
  1589. this.m_head = this.m_model.getChildAt(0);
  1590. this.m_crown = this.m_crown ? this.m_crown : PoolManager.Instance.CreatMeshSprite3D(ResourcesManager.Instance.crown, "");
  1591. this.m_head.addChild(this.m_crown);
  1592. this.m_crown.transform.localScale = new Vector3$2(13, 13, 13);
  1593. this.m_crown.transform.localPosition = new Vector3$2(0, 0, 0);
  1594. this.m_crown.transform.rotationEuler = new Vector3$2(0, 0, 0);
  1595. this.m_crown.active = false;
  1596. this.m_effect = this.m_sprite.getChildByName("effect");
  1597. this.GetStages();
  1598. EventManager.GameStateEventOn(GameState.Playing, this, this.OnEnterPlaying);
  1599. EventManager.EventOn(EventType.crownchange, this, this.OnCrownChange);
  1600. }
  1601. onStart() {
  1602. }
  1603. GetStages() {
  1604. var curstages = LevelManager.Instance.curLevel.stages;
  1605. var stages = [];
  1606. for (var i = 0; i < curstages.length; i++) {
  1607. var st = curstages[i];
  1608. var news = new Stage(st.id.toString(), st.roadsdata);
  1609. news.sprite = st.sprite;
  1610. news.startz = st.startz;
  1611. news.endz = st.endz;
  1612. news.starty = st.starty;
  1613. news.endy = st.endy;
  1614. news.roadpointxs = st.roadpointxs;
  1615. stages.push(news);
  1616. }
  1617. this.m_curstages = stages;
  1618. }
  1619. onDestroy() {
  1620. EventManager.GameStateEventOff(GameState.Playing, this, this.OnEnterPlaying);
  1621. EventManager.EventOff(EventType.crownchange, this, this.OnCrownChange);
  1622. }
  1623. OnEnterPlaying() {
  1624. this.SetMove();
  1625. }
  1626. OnCrownChange(_id) {
  1627. if (_id != this.Id) {
  1628. this.CloseCrown();
  1629. }
  1630. else {
  1631. this.GetCrown();
  1632. }
  1633. }
  1634. SetMove() {
  1635. this.Start();
  1636. this.enteroutplane = false;
  1637. this.fly = false;
  1638. this.die = false;
  1639. this.endroad = false;
  1640. this.outlandtime = 0;
  1641. Laya.timer.clearAll(this);
  1642. Laya.timer.frameLoop(1, this, this.OnFrameLoop);
  1643. }
  1644. OnFrameLoop() {
  1645. if (this.canmove) {
  1646. var startpoint = new Vector3$2(this.m_sprite.transform.position.x, this.m_sprite.transform.position.y + 1, this.m_sprite.transform.position.z);
  1647. var dir = new Vector3$2(0, -1, 0);
  1648. var ray = new Laya.Ray(startpoint, dir);
  1649. if (ScenceManager.Instance.GameScence.physicsSimulation.rayCast(ray, this.hit, 20)) {
  1650. if (this.hit.collider.collisionGroup != ColliderLay.Plane && this.hit.collider.collisionGroup != ColliderLay.things)
  1651. return;
  1652. if (this.OnLand) {
  1653. var dis = this.m_sprite.transform.position.y - this.hit.point.y;
  1654. if (this.hit.collider.owner.name == "JS") {
  1655. this.JS = true;
  1656. }
  1657. if (dis > 0.01) {
  1658. this.OnLand = false;
  1659. this.OnEnterOutPlane();
  1660. return;
  1661. }
  1662. else {
  1663. if (this.hit.collider.owner.name == "Coin") {
  1664. this.OnEnterPlane();
  1665. return;
  1666. }
  1667. this.m_sprite.transform.position = new Vector3$2(this.m_sprite.transform.position.x, this.hit.point.y, this.m_sprite.transform.position.z);
  1668. }
  1669. }
  1670. else {
  1671. var dis = this.m_sprite.transform.position.y - this.hit.point.y;
  1672. if (dis < 0.0001) {
  1673. this.OnEnterPlane();
  1674. }
  1675. }
  1676. }
  1677. else {
  1678. this.OnLand = false;
  1679. this.OnEnterOutPlane();
  1680. }
  1681. this.RayCastUpdate();
  1682. }
  1683. }
  1684. OnGetRoadPoint(_ps) {
  1685. this.nextpoint = _ps;
  1686. this.TriggerAuto();
  1687. this.oldpoint = _ps;
  1688. }
  1689. TriggerAuto(now = false) {
  1690. if (this.nextpoint.length == 1) {
  1691. if (this.oldpoint.length == 0 || this.oldpoint.length > 1) {
  1692. if (this.aimiss <= Math.random()) {
  1693. this.AutoMoveX(this.nextpoint[0]);
  1694. }
  1695. }
  1696. if (this.oldpoint.length == 1) {
  1697. this.delayMove = true;
  1698. }
  1699. }
  1700. if (this.delayMove) {
  1701. this.AutoMoveX(this.oldpoint[0]);
  1702. }
  1703. }
  1704. OnEnterOutPlane() {
  1705. if (this.enteroutplane)
  1706. return;
  1707. this.enteroutplane = true;
  1708. if (!this.Ai)
  1709. EventManager.EventTrigger(EventType.OutLand);
  1710. if (this.JS) {
  1711. this.SetExtraSpeed(ThingsEffect.JSEffect, ThingsEffect.Jstime);
  1712. this.JS = false;
  1713. }
  1714. if (!this.fly) {
  1715. this.m_animator.play("land1");
  1716. }
  1717. }
  1718. OnEnterPlane() {
  1719. if (this.OnLand)
  1720. return;
  1721. if (this.hit.collider.collisionGroup == ColliderLay.things) {
  1722. this.TriggerThings(this.hit.collider);
  1723. }
  1724. if (!this.Ai) {
  1725. PlaySoundManager.Play(SoundType.land);
  1726. WxApi.Shake();
  1727. }
  1728. if (!this.Ai)
  1729. EventManager.EventTrigger(EventType.OnLand);
  1730. this.enteroutplane = false;
  1731. this.m_flySprite.active = false;
  1732. this.fly = false;
  1733. this.flytime = 0;
  1734. this.flycounttime = 0;
  1735. this.m_animator.play("run");
  1736. this.outlandtime = 0;
  1737. this.LandTime = 0;
  1738. if (!this.Ai)
  1739. EventManager.EventTrigger(EventType.flytime, this.flytime);
  1740. this.OnLand = true;
  1741. this.jump = false;
  1742. var cp = new Vector3$2(this.m_sprite.transform.position.x, this.hit.point.y, this.m_sprite.transform.position.z);
  1743. Vector3$2.lerp(this.m_sprite.transform.position, cp, 0.3, this.curpos);
  1744. this.m_sprite.transform.position = this.curpos;
  1745. }
  1746. Start() {
  1747. this.JS = false;
  1748. this.canmove = true;
  1749. this.m_animator.play("run");
  1750. }
  1751. Pause() {
  1752. this.canmove = false;
  1753. }
  1754. Stop() {
  1755. this.Pause();
  1756. Laya.timer.clearAll(this);
  1757. }
  1758. LandDown() {
  1759. this.curspeed = 0;
  1760. }
  1761. SetFly() {
  1762. this.extraspeed = 0;
  1763. this.extraspeedtime = 0;
  1764. this.flytime = ThingsEffect.flytime;
  1765. this.flyspeed = ThingsEffect.flyeffect;
  1766. this.m_flySprite.active = true;
  1767. this.fly = true;
  1768. this.m_animator.play("fly");
  1769. this.BackRote();
  1770. }
  1771. SetExtraSpeed(_speed, time = 0) {
  1772. if (!this.Ai) {
  1773. PlaySoundManager.Play(SoundType.extraspeed);
  1774. WxApi.Shake();
  1775. }
  1776. this.extraspeed = _speed;
  1777. this.extraspeedtime += time;
  1778. }
  1779. Jump(_csp) {
  1780. this.csp = _csp * 0.1;
  1781. this.csp = Math.pow(this.csp, 0.5);
  1782. this.JumpHigth = 1;
  1783. this.JumpDuration = 0;
  1784. this.jump = true;
  1785. this.OnLand = false;
  1786. }
  1787. CurHight(csp = 1, dd, a = 3.5) {
  1788. var hight = csp * dd - (dd * dd * a);
  1789. if (hight < 0) {
  1790. this.jump = false;
  1791. }
  1792. return hight;
  1793. }
  1794. HitObstacle(_node) {
  1795. var target = _node;
  1796. this.curspeed *= 0.5;
  1797. var curpos = this.m_sprite.transform.position;
  1798. var offesxx = curpos.x - target.transform.position.x >= 0 ? 0.4 : -0.4;
  1799. this.m_sprite.transform.position = new Vector3$2(curpos.x + offesxx, curpos.y, curpos.z - this.bacoZ);
  1800. }
  1801. RayCastUpdate() {
  1802. this.CheckForward();
  1803. this.Gravity();
  1804. }
  1805. TurnDir(_dir) {
  1806. if (_dir.x != 0) {
  1807. Vector3$2.lerp(this.currotV, _dir, 0.35, _dir);
  1808. this.currotV = _dir;
  1809. Laya.Quaternion.rotationLookAt(_dir, new Vector3$2(0, 1, 0), this.currot);
  1810. Laya.Quaternion.slerp(this.m_sprite.transform.rotation, this.currot, 0.025, this.currot);
  1811. this.currot = new Laya.Quaternion(0, this.currot.y, 0);
  1812. this.m_sprite.transform.rotation = this.currot;
  1813. }
  1814. else {
  1815. Laya.Quaternion.slerp(this.m_sprite.transform.rotation, new Laya.Quaternion(0, 0, 0, 0), 0.1, this.currot);
  1816. this.currot = new Laya.Quaternion(0, this.currot.y, 0);
  1817. this.m_sprite.transform.rotation = this.currot;
  1818. }
  1819. }
  1820. BackRote() {
  1821. this.backrot = true;
  1822. }
  1823. Cheat() {
  1824. var stage = Player.Instance.m_runner.completeStage;
  1825. if (0.65 < Math.random())
  1826. return;
  1827. if (!stage || Player.Instance.m_runner.m_curstages[Player.Instance.m_runner.m_curstages.length - 1].enter || Player.Instance.m_runner.die)
  1828. return;
  1829. stage.complete = false;
  1830. this.curstage = stage;
  1831. this.die = false;
  1832. this.m_crown.active = false;
  1833. var pp = Player.Instance.m_runner;
  1834. this.m_sprite.transform.position = new Vector3$2(pp.m_sprite.transform.position.x, stage.endy, stage.endz - 5);
  1835. this.SetMove();
  1836. this.SetExtraSpeed(0.01, 2);
  1837. this.curspeed = this.m_speed;
  1838. }
  1839. onUpdate() {
  1840. if (this.canmove) {
  1841. this.Move(new Vector3$2(0, 0, 1), this.m_speed);
  1842. }
  1843. if (this.backrot) {
  1844. Laya.Quaternion.slerp(this.m_sprite.transform.rotation, new Laya.Quaternion(0, 0, 0, 0), 0.25, this.currot);
  1845. this.currot = new Laya.Quaternion(0, this.currot.y, 0);
  1846. this.m_sprite.transform.rotation = this.currot;
  1847. if (Math.abs(this.m_sprite.transform.rotation.y) < 0.0001) {
  1848. this.backrot = false;
  1849. }
  1850. }
  1851. if (this.m_curstages[this.m_curstages.length - 1].complete == false) {
  1852. for (var i = 0; i < this.m_curstages.length; i++) {
  1853. var stage = this.m_curstages[i];
  1854. if (stage.complete == false && this.m_sprite.transform.position.z > stage.endz) {
  1855. this.completeStage = stage;
  1856. stage.complete = true;
  1857. EventManager.EventTrigger(EventType.CompleteStage, stage);
  1858. }
  1859. if (stage.enter == false && this.m_sprite.transform.position.z > stage.startz - 3) {
  1860. this.curstage = stage;
  1861. stage.enter = true;
  1862. if (!this.Ai) {
  1863. if (i == this.m_curstages.length - 1)
  1864. LevelManager.Instance.curLevel.endroadsprite.active = true;
  1865. this.SetRoad(i);
  1866. EventManager.EventTrigger(EventType.GetRoadPoint, i + 1);
  1867. }
  1868. else {
  1869. this.OnEnterStage(stage);
  1870. }
  1871. }
  1872. }
  1873. }
  1874. else {
  1875. this.curstage.endy = LevelManager.Instance.curLevel.endroadsprite.transform.position.y - 5;
  1876. }
  1877. if (this.curstage && this.flytime == 0 && !this.die && this.m_sprite.transform.position.y < this.curstage.endy - 8) {
  1878. this.die = true;
  1879. this.Stop();
  1880. if (this.m_flySprite.active) {
  1881. this.m_flySprite.active = false;
  1882. }
  1883. if (!this.Ai) {
  1884. PlaySoundManager.Play(SoundType.die);
  1885. WxApi.Shake(false);
  1886. GameManager.Instance.ChangeState(GameState.Die);
  1887. }
  1888. }
  1889. }
  1890. SetRoad(_stageid) {
  1891. if (_stageid + 2 < LevelManager.Instance.curLevel.stages.length) {
  1892. var nextroads = LevelManager.Instance.curLevel.stages[_stageid + 2].roads;
  1893. for (var i = 0; i < nextroads.length; i++) {
  1894. var road = nextroads[i];
  1895. road.SetActive(true);
  1896. }
  1897. var builds = LevelManager.Instance.curLevel.stages[_stageid + 2].builds;
  1898. for (var i = 0; i < builds.length; i++) {
  1899. var build = builds[i];
  1900. build.active = true;
  1901. }
  1902. }
  1903. if (_stageid - 1 >= 0) {
  1904. var oldroads = LevelManager.Instance.curLevel.stages[_stageid - 1].roads;
  1905. for (var i = 0; i < oldroads.length; i++) {
  1906. var road = oldroads[i];
  1907. Laya.timer.once(1000, this, () => {
  1908. road.SetActive(false);
  1909. });
  1910. }
  1911. var oldbuilds = LevelManager.Instance.curLevel.stages[_stageid - 1].builds;
  1912. for (var i = 0; i < oldbuilds.length; i++) {
  1913. var build = oldbuilds[i];
  1914. build.active = false;
  1915. }
  1916. }
  1917. }
  1918. OnEnterStage(_stage) {
  1919. this.OnGetRoadPoint(_stage.roadpointxs);
  1920. }
  1921. GetCrown() {
  1922. this.m_crown.active = true;
  1923. Laya.timer.clear(this, this.RotCrown);
  1924. Laya.timer.frameLoop(1, this, this.RotCrown);
  1925. }
  1926. CloseCrown() {
  1927. this.m_crown.active = false;
  1928. Laya.timer.clear(this, this.RotCrown);
  1929. }
  1930. RotCrown() {
  1931. this.m_crown.transform.rotate(new Vector3$2(0, 2, 0));
  1932. }
  1933. Move(_dir, _speed) {
  1934. if (this.flytime > 0) {
  1935. this.flytime -= this.flycutrate;
  1936. this.flycounttime += (this.flycutrate * 0.6);
  1937. if (!this.Ai)
  1938. EventManager.EventTrigger(EventType.flytime, this.flytime);
  1939. _speed = this.flyspeed + this.extraspeed;
  1940. if (this.flytime < 0) {
  1941. this.flytime = 0;
  1942. this.flycounttime = 0;
  1943. }
  1944. }
  1945. else {
  1946. if (this.fly) {
  1947. _speed = (this.flyspeed * 0.8) + this.extraspeed;
  1948. }
  1949. }
  1950. if (this.extraspeedtime > 0 || this.extraspeed > 0) {
  1951. this.extraspeedtime -= this.extracutrate;
  1952. if (!this.Ai)
  1953. EventManager.EventTrigger(EventType.extraspeedtime, this.extraspeedtime);
  1954. var esp = _speed + this.extraspeed;
  1955. _speed = GameUtils.lerp(_speed, esp, 0.9);
  1956. if (this.extraspeedtime < 0) {
  1957. this.extraspeed = 0;
  1958. this.extraspeedtime = 0;
  1959. }
  1960. }
  1961. var sp = GameUtils.lerp(this.curspeed, _speed, 0.1);
  1962. this.curspeed = sp;
  1963. Vector3$2.scale(_dir, this.curspeed, this.offest);
  1964. Vector3$2.add(this.m_sprite.transform.position, this.offest, this.curpos);
  1965. Vector3$2.lerp(this.m_sprite.transform.position, this.curpos, 0.15, this.curpos);
  1966. if (this.JumpHigth > 0) {
  1967. this.JumpDuration += ThingsEffect.jumptime;
  1968. this.JumpHigth = this.CurHight(this.csp, this.JumpDuration);
  1969. this.curpos = new Vector3$2(this.curpos.x, this.curpos.y + this.JumpHigth, this.curpos.z);
  1970. }
  1971. this.curpos = new Vector3$2(this.curpos.x + this.aioffestx, this.curpos.y, this.curpos.z);
  1972. this.m_sprite.transform.position = this.curpos;
  1973. if (this.endroad == false && (this.m_sprite.transform.position.z > LevelManager.Instance.curLevel.endroadsprite.transform.position.z)) {
  1974. this.endroad = true;
  1975. if (this.fly) {
  1976. this.fly = false;
  1977. this.flytime = 0;
  1978. this.flycounttime = 0;
  1979. this.m_flySprite.active = false;
  1980. if (this.OnLand) {
  1981. this.m_animator.play("land1");
  1982. }
  1983. }
  1984. }
  1985. }
  1986. CheckForward() {
  1987. var startpoint = new Vector3$2(this.m_sprite.transform.position.x, this.m_sprite.transform.position.y + 0.5, this.m_sprite.transform.position.z);
  1988. var dir = new Vector3$2(0, 0, 1);
  1989. var ray = new Laya.Ray(startpoint, dir);
  1990. if (ScenceManager.Instance.GameScence.physicsSimulation.rayCast(ray, this.hit, 0.5)) {
  1991. if (this.hit.collider.collisionGroup != ColliderLay.things)
  1992. return;
  1993. this.TriggerThings(this.hit.collider);
  1994. }
  1995. }
  1996. TriggerThings(_collider) {
  1997. if (this.curcollider == _collider && _collider.owner.name != "obstacle")
  1998. return;
  1999. this.curcollider = _collider;
  2000. if (_collider.owner.name == "Box") {
  2001. if (!this.Ai) {
  2002. PlaySoundManager.Play(SoundType.crash);
  2003. WxApi.Shake();
  2004. }
  2005. _collider.enabled = false;
  2006. this.HitBox(_collider.owner);
  2007. }
  2008. else if (_collider.owner.name == "obstacle") {
  2009. if (!this.Ai) {
  2010. PlaySoundManager.Play(SoundType.crash);
  2011. WxApi.Shake();
  2012. }
  2013. this.fly = false;
  2014. this.flytime = 0;
  2015. this.flycounttime = 0;
  2016. this.extraspeed = 0;
  2017. this.HitObstacle(_collider.owner);
  2018. }
  2019. else if (_collider.owner.name == "fly") {
  2020. if (!this.Ai) {
  2021. PlaySoundManager.Play(SoundType.fly);
  2022. WxApi.Shake();
  2023. }
  2024. this.SetFly();
  2025. }
  2026. else if (_collider.owner.name == "rocket") {
  2027. if (!this.Ai) {
  2028. PlaySoundManager.Play(SoundType.xp);
  2029. WxApi.Shake();
  2030. }
  2031. this.SetExtraSpeed(ThingsEffect.rocketeffect, ThingsEffect.rockettime);
  2032. }
  2033. else if (_collider.owner.name == "Jump") {
  2034. if (!this.Ai) {
  2035. PlaySoundManager.Play(SoundType.jump);
  2036. WxApi.Shake();
  2037. }
  2038. this.outlandtime = 0;
  2039. this.fly = false;
  2040. this.flytime = 0;
  2041. this.flycounttime = 0;
  2042. this.Jump(ThingsEffect.jumpeffect);
  2043. this.SetExtraSpeed(0.3, 0.2);
  2044. }
  2045. else if (_collider.owner.name == "Coin") {
  2046. if (!this.Ai) {
  2047. PlaySoundManager.Play(SoundType.gold);
  2048. WxApi.Shake();
  2049. EventManager.EventTrigger(EventType.GetMoney);
  2050. }
  2051. var sprite = _collider.owner.parent;
  2052. sprite.active = false;
  2053. }
  2054. else if (_collider.owner.name == "Win") {
  2055. this.m_animator.play("win");
  2056. if (this.m_flySprite.active) {
  2057. this.m_flySprite.active = false;
  2058. }
  2059. if (!this.Ai) {
  2060. if (Queue.Instance.GetPlayerScore == 1) {
  2061. GameManager.Instance.ChangeState(GameState.Win);
  2062. }
  2063. else {
  2064. Player.CanInput = false;
  2065. this.Stop();
  2066. this.m_animator.play("idle2");
  2067. GameManager.Instance.ChangeState(GameState.End, false);
  2068. }
  2069. }
  2070. else {
  2071. this.Stop();
  2072. this.m_animator.play("fly");
  2073. }
  2074. }
  2075. }
  2076. Gravity() {
  2077. if (this.OnLand == false) {
  2078. if (this.extraspeed > 0 && this.flytime <= 0) {
  2079. if (this.jump) {
  2080. this.outlandtime += 0.007;
  2081. }
  2082. else {
  2083. this.outlandtime += 0.007;
  2084. }
  2085. }
  2086. else if (this.flytime > 0) {
  2087. if (this.flycounttime > 0 && this.flycounttime < 0.5) {
  2088. this.outlandtime += 0.004;
  2089. }
  2090. else if (this.flycounttime > 0.5 && this.flycounttime < 1.3 && this.outlandtime > 0) {
  2091. this.outlandtime -= 0.004;
  2092. }
  2093. else {
  2094. this.outlandtime += 0.0035;
  2095. }
  2096. }
  2097. else {
  2098. if (this.fly) {
  2099. this.outlandtime += 0.003;
  2100. }
  2101. else {
  2102. this.outlandtime += 0.011;
  2103. }
  2104. }
  2105. var offesty = this.outlandtime * this.outlandtime;
  2106. this.m_sprite.transform.position = new Vector3$2(this.m_sprite.transform.position.x, this.m_sprite.transform.position.y - offesty, this.m_sprite.transform.position.z);
  2107. }
  2108. }
  2109. delayDestory(_sprite) {
  2110. _sprite.destroy();
  2111. }
  2112. HitBox(_box) {
  2113. var bp = _box;
  2114. var boxspite = _box.parent.getChildAt(0);
  2115. var pps = _box.parent;
  2116. Laya.timer.once(1000, this, this.delayDestory, [_box.parent]);
  2117. this.TriggerHit(boxspite, bp.transform.position.clone());
  2118. }
  2119. TriggerHit(_node, _center) {
  2120. var childNumber = _node.numChildren;
  2121. for (var i = 0; i < childNumber; i++) {
  2122. var box = _node.getChildAt(i);
  2123. var rig = box.addComponent(Rigbody);
  2124. var dir = new Vector3$2();
  2125. Vector3$2.subtract(box.transform.position, _center, dir);
  2126. Vector3$2.normalize(dir, dir);
  2127. rig.AddVelocity(dir, GameUtils.getRandoms(0.1, 0.5));
  2128. }
  2129. }
  2130. MoveX(_speed) {
  2131. _speed *= 0.07;
  2132. this.m_sprite.transform.translate(new Vector3$2(_speed, 0, 0));
  2133. this.m_sprite.transform.position = this.m_sprite.transform.position.x < -4.5 ? new Vector3$2(-4.5, this.m_sprite.transform.position.y, this.m_sprite.transform.position.z) : this.m_sprite.transform.position;
  2134. this.m_sprite.transform.position = this.m_sprite.transform.position.x > 4.5 ? new Vector3$2(4.5, this.m_sprite.transform.position.y, this.m_sprite.transform.position.z) : this.m_sprite.transform.position;
  2135. }
  2136. AutoMoveX(_targetx) {
  2137. this.curautospeed = 0;
  2138. Laya.timer.clear(this, this.AutoMoveLoop);
  2139. Laya.timer.frameLoop(1, this, this.AutoMoveLoop, [_targetx]);
  2140. }
  2141. AutoMoveLoop(_targetx) {
  2142. if (Math.abs(_targetx - this.m_sprite.transform.position.x) < 0.01) {
  2143. Laya.timer.clear(this, this.AutoMoveLoop);
  2144. }
  2145. var speed = GameUtils.lerp(this.curautospeed, this.AutoMoveSpeed, 0.25);
  2146. if (_targetx > this.m_sprite.transform.position.x) {
  2147. this.MoveX(speed);
  2148. }
  2149. else {
  2150. this.MoveX(-speed);
  2151. }
  2152. }
  2153. }
  2154. var Vector3$3 = Laya.Vector3;
  2155. class CameraManager extends Laya.Script {
  2156. constructor() {
  2157. super();
  2158. this.follow = false;
  2159. this.lookat = false;
  2160. this.offest = new Vector3$3();
  2161. this.curCameraPos = new Vector3$3();
  2162. this.startPos = new Vector3$3();
  2163. this.starRot = new Vector3$3();
  2164. this.forwardDistance = 2;
  2165. this.addspeed = 1;
  2166. this.followrate = 0.3;
  2167. this.lerpPos = new Vector3$3();
  2168. this.lerprot = new Laya.Quaternion();
  2169. this.lookdir = new Vector3$3();
  2170. this.offesty = 0;
  2171. this.offestz = 0;
  2172. CameraManager.CameraManagerInstance = this;
  2173. }
  2174. static get Instance() {
  2175. return CameraManager.CameraManagerInstance;
  2176. }
  2177. onAwake() {
  2178. this.camera = this.owner;
  2179. }
  2180. SetFollow(_target, _lookat = false) {
  2181. this.curTarget = _target;
  2182. Vector3$3.subtract(_target.position, this.camera.transform.position, this.offest);
  2183. this.follow = true;
  2184. this.lookat = _lookat;
  2185. this.startPos = this.camera.transform.position.clone();
  2186. this.starRot = this.camera.transform.rotationEuler.clone();
  2187. Laya.timer.clearAll(this);
  2188. }
  2189. StopFollow() {
  2190. this.follow = false;
  2191. this.curTarget = null;
  2192. this.offesty = 0;
  2193. this.offestz = 0;
  2194. this.offest = new Vector3$3(0, 0, 0);
  2195. this.curCameraPos = new Vector3$3(0, 0, 0);
  2196. this.lerpPos = new Vector3$3(0, 0, 0);
  2197. }
  2198. PauseFollow() {
  2199. this.follow = false;
  2200. }
  2201. ResumeFollow() {
  2202. this.follow = true;
  2203. }
  2204. onUpdate() {
  2205. if (this.follow && this.curTarget) {
  2206. Vector3$3.subtract(this.curTarget.position, this.offest, this.curCameraPos);
  2207. this.offesty = GameUtils.lerp(this.offesty, 1, 0.02);
  2208. this.curCameraPos = new Vector3$3(this.curCameraPos.x, this.curCameraPos.y + this.offesty, this.curCameraPos.z + this.offestz);
  2209. Vector3$3.lerp(this.camera.transform.position, this.curCameraPos, this.followrate, this.lerpPos);
  2210. this.camera.transform.position = new Vector3$3(this.curCameraPos.x, this.lerpPos.y, this.lerpPos.z);
  2211. var quaternion1 = new Laya.Quaternion();
  2212. var lookpos = new Vector3$3(this.lerpPos.x, this.lerpPos.y - 0.7, this.lerpPos.z);
  2213. Laya.Quaternion.lookAt(lookpos, this.curTarget.position, new Vector3$3(0, 1, 0), quaternion1);
  2214. quaternion1.invert(quaternion1);
  2215. Laya.Quaternion.slerp(this.camera.transform.rotation, quaternion1, 0.05, quaternion1);
  2216. this.camera.transform.rotation = quaternion1;
  2217. }
  2218. }
  2219. SetCameraPos() {
  2220. Vector3$3.subtract(this.curTarget.position, this.offest, this.curCameraPos);
  2221. Vector3$3.lerp(this.camera.transform.position, this.curCameraPos, 0.7, this.lerpPos);
  2222. this.camera.transform.position = new Vector3$3(this.lerpPos.x, this.camera.transform.position.y, this.camera.transform.position.z);
  2223. }
  2224. get GetCurCameraPos() {
  2225. Vector3$3.subtract(this.curTarget.position, this.offest, this.curCameraPos);
  2226. return this.curCameraPos;
  2227. }
  2228. }
  2229. var Vector3$4 = Laya.Vector3;
  2230. var Vector2 = Laya.Vector2;
  2231. var InputState;
  2232. (function (InputState) {
  2233. InputState[InputState["None"] = 0] = "None";
  2234. InputState[InputState["ClickDown"] = 1] = "ClickDown";
  2235. InputState[InputState["ClickUp"] = 2] = "ClickUp";
  2236. InputState[InputState["Slider"] = 3] = "Slider";
  2237. })(InputState || (InputState = {}));
  2238. class Player {
  2239. constructor(_sprite) {
  2240. this.m_inputState = InputState.None;
  2241. this.curMousePos = new Vector2(0, 0);
  2242. this.offestx = 0;
  2243. this.m_sprite = _sprite;
  2244. this.m_model = this.m_sprite.getChildAt(0);
  2245. this.m_runner = _sprite.addComponent(Runner);
  2246. this.m_runner.m_speed = LevelManager.Instance.curLevel.playerspeed;
  2247. Queue.Instance.signup(this.m_runner);
  2248. this.m_runner.name = "hehe";
  2249. Player.Instance = this;
  2250. this.RegEvent();
  2251. }
  2252. Reset(_sprite) {
  2253. this.m_sprite = _sprite;
  2254. this.m_model = this.m_sprite.getChildAt(0);
  2255. this.m_runner.m_effect = this.m_sprite.getChildByName("effect");
  2256. this.m_runner.Id = 6;
  2257. this.m_runner = _sprite.addComponent(Runner);
  2258. this.m_runner.OnLand = true;
  2259. this.m_inputState = InputState.None;
  2260. this.m_runner.name = "hehe";
  2261. Queue.Instance.signup(this.m_runner);
  2262. this.RegEvent();
  2263. }
  2264. RegEvent() {
  2265. Laya.stage.on(Laya.Event.MOUSE_DOWN, this, this.OnClickDown);
  2266. Laya.stage.on(Laya.Event.MOUSE_UP, this, this.OnClickUp);
  2267. Laya.stage.on(Laya.Event.MOUSE_OUT, this, this.OnClickUp);
  2268. EventManager.EventOn(EventType.InputState, this, this.OnInput);
  2269. EventManager.GameStateEventOn(GameState.Playing, this, this.OnEnterPlaying);
  2270. EventManager.GameStateEventOn(GameState.Win, this, this.OnPlayerWin);
  2271. EventManager.GameStateEventOn(GameState.Die, this, this.OnPlayerDie);
  2272. EventManager.GameStateEventOn(GameState.End, this, this.OnGameOver);
  2273. }
  2274. UnRegEvent() {
  2275. Laya.stage.off(Laya.Event.MOUSE_DOWN, this, this.OnClickDown);
  2276. Laya.stage.off(Laya.Event.MOUSE_UP, this, this.OnClickUp);
  2277. Laya.stage.off(Laya.Event.MOUSE_OUT, this, this.OnClickUp);
  2278. EventManager.EventOff(EventType.InputState, this, this.OnInput);
  2279. EventManager.GameStateEventOff(GameState.Playing, this, this.OnEnterPlaying);
  2280. EventManager.GameStateEventOff(GameState.Win, this, this.OnPlayerWin);
  2281. EventManager.GameStateEventOff(GameState.Die, this, this.OnPlayerDie);
  2282. EventManager.GameStateEventOff(GameState.End, this, this.OnGameOver);
  2283. Laya.timer.clearAll(this);
  2284. }
  2285. OnClickDown(e) {
  2286. if (e.target instanceof Laya.UIComponent) {
  2287. return;
  2288. }
  2289. this.m_inputState = InputState.ClickDown;
  2290. if (!Player.CanInput)
  2291. return;
  2292. EventManager.EventTrigger(EventType.InputState, InputState.ClickDown);
  2293. }
  2294. OnClickUp(e) {
  2295. if (e.target instanceof Laya.UIComponent) {
  2296. return;
  2297. }
  2298. this.m_inputState = InputState.ClickDown;
  2299. if (!Player.CanInput)
  2300. return;
  2301. EventManager.EventTrigger(EventType.InputState, InputState.ClickUp);
  2302. }
  2303. OnSlider() {
  2304. this.m_inputState = InputState.Slider;
  2305. if (!Player.CanInput)
  2306. return;
  2307. EventManager.EventTrigger(EventType.InputState, InputState.Slider);
  2308. }
  2309. OnInput(_state) {
  2310. if (_state == InputState.ClickDown) {
  2311. this.OnInputDown();
  2312. }
  2313. if (_state == InputState.ClickUp) {
  2314. this.OnInputUp();
  2315. }
  2316. if (_state == InputState.Slider) {
  2317. this.OnInputSlider();
  2318. }
  2319. }
  2320. RessetPlayer(_hero = null) {
  2321. if (this.m_runner.m_hat)
  2322. PoolManager.Instance.RecoverMeshSprite3D(this.m_runner.m_hat);
  2323. if (this.m_runner.m_cb)
  2324. PoolManager.Instance.RecoverMeshSprite3D(this.m_runner.m_cb);
  2325. if (this.m_runner.m_crown)
  2326. this.m_runner.m_crown.active = true;
  2327. PoolManager.Instance.RecoverMeshSprite3D(this.m_runner.m_crown);
  2328. if (this.m_sprite)
  2329. PoolManager.Instance.RecoverMeshSprite3D(this.m_sprite);
  2330. var playerid = Number(PlayerAccount.CurrentAccount.CurAccountData.GetUser(AccountUser.equip_hero));
  2331. if (_hero)
  2332. playerid = _hero.id;
  2333. var player = ResourcesManager.Instance.roleassets[playerid].getChildAt(0);
  2334. var playermodel = PoolManager.Instance.CreatMeshSprite3D(player, "");
  2335. var startpoint = new Vector3$4(0, 0, 10);
  2336. playermodel.transform.position = startpoint;
  2337. var hatid = Number(PlayerAccount.CurrentAccount.CurAccountData.GetUser(AccountUser.equip_hat));
  2338. if (hatid > 0) {
  2339. var hat = ResourcesManager.Instance.hatasset[hatid];
  2340. var hatmodel = PoolManager.Instance.CreatMeshSprite3D(hat, "");
  2341. var head = playermodel.getChildAt(0).getChildAt(0);
  2342. head.addChild(hatmodel);
  2343. hatmodel.transform.localPosition = new Laya.Vector3(0.06, 0, 0);
  2344. hatmodel.transform.localRotationEuler = new Laya.Vector3(0, 90, 0);
  2345. }
  2346. var cbid = Number(PlayerAccount.CurrentAccount.CurAccountData.GetUser(AccountUser.equip_hat));
  2347. if (cbid > 0) {
  2348. var cb = ResourcesManager.Instance.cbasset[cbid];
  2349. var cbmodel = PoolManager.Instance.CreatMeshSprite3D(cb, "");
  2350. var back = playermodel.getChildAt(0).getChildAt(1);
  2351. back.addChild(cbmodel);
  2352. cbmodel.transform.localPosition = new Laya.Vector3(0, -0.01, 0);
  2353. cbmodel.transform.localRotationEuler = new Laya.Vector3(-25, 90, 180);
  2354. }
  2355. ScenceManager.Instance.GameScence.addChild(playermodel);
  2356. this.m_runner.Id = 6;
  2357. CameraManager.Instance.StopFollow();
  2358. ScenceManager.Instance.GameCamera.transform.position = new Vector3$4(0, 0.6, 8.5);
  2359. ScenceManager.Instance.GameCamera.transform.rotationEuler = new Vector3$4(-5, 180, 0);
  2360. this.Reset(playermodel);
  2361. }
  2362. ClearPlayer() {
  2363. this.m_runner.m_flySprite.active = true;
  2364. this.m_runner.m_crown.active = true;
  2365. PoolManager.Instance.RecoverMeshSprite3D(this.m_runner.m_flySprite);
  2366. PoolManager.Instance.RecoverMeshSprite3D(this.m_runner.m_crown);
  2367. if (this.m_runner.m_hat)
  2368. PoolManager.Instance.RecoverMeshSprite3D(this.m_runner.m_hat);
  2369. if (this.m_runner.m_cb)
  2370. PoolManager.Instance.RecoverMeshSprite3D(this.m_runner.m_cb);
  2371. PoolManager.Instance.RecoverMeshSprite3D(this.m_sprite);
  2372. CameraManager.Instance.StopFollow();
  2373. ScenceManager.Instance.GameCamera.transform.position = new Vector3$4(0, 0.6, 8.5);
  2374. ScenceManager.Instance.GameCamera.transform.rotationEuler = new Vector3$4(-5, 180, 0);
  2375. }
  2376. RevivePlayer() {
  2377. var stage = this.m_runner.curstage;
  2378. this.m_runner.die = false;
  2379. this.m_runner.m_crown.active = false;
  2380. this.m_sprite.transform.position = new Vector3$4(0, stage.starty + 5, stage.startz + 5);
  2381. this.m_runner.SetMove();
  2382. this.m_runner.curspeed = this.m_runner.m_speed;
  2383. this.m_runner.SetFly();
  2384. ScenceManager.Instance.GameCamera.transform.position = new Vector3$4(0, this.m_sprite.transform.position.y + 0.6, this.m_sprite.transform.position.z - 1.5);
  2385. CameraManager.Instance.SetFollow(this.m_sprite.transform);
  2386. Player.CanInput = true;
  2387. }
  2388. get CurLevelPrecent() {
  2389. return this.m_runner.m_sprite.transform.position.z / LevelManager.Instance.curLevel.endroadsprite.transform.position.z;
  2390. }
  2391. OnEnterIdle() {
  2392. CameraManager.Instance.SetFollow(this.m_sprite.transform);
  2393. }
  2394. OnEnterPlaying() {
  2395. CameraManager.Instance.SetFollow(this.m_sprite.transform);
  2396. }
  2397. OnPlayerWin() {
  2398. Player.CanInput = false;
  2399. this.m_runner.Stop();
  2400. CameraManager.Instance.StopFollow();
  2401. ScenceManager.Instance.GameLight.transform.rotationEuler = new Vector3$4(-50, 0, 0);
  2402. var camera = ScenceManager.Instance.GameCamera;
  2403. var camerapos = new Vector3$4(1, this.m_sprite.transform.position.y + 1.5, this.m_sprite.transform.position.z + 2.5);
  2404. var lookpos = new Vector3$4(this.m_sprite.transform.position.x, this.m_sprite.transform.position.y + 0.5, this.m_sprite.transform.position.z);
  2405. GameUtils.TweenLookAtMove(camera.transform, camerapos, this.m_sprite.transform.position, 1.5, () => {
  2406. Laya.timer.once(1000, this, () => {
  2407. GameManager.Instance.ChangeState(GameState.End, true);
  2408. });
  2409. });
  2410. }
  2411. OnPlayerDie() {
  2412. Player.CanInput = false;
  2413. this.m_runner.Stop();
  2414. CameraManager.Instance.StopFollow();
  2415. GameManager.Instance.ChangeState(GameState.Revive);
  2416. }
  2417. OnGameOver() {
  2418. this.offestx = 0;
  2419. this.UnRegEvent();
  2420. }
  2421. OnInputDown() {
  2422. this.curMousePos = new Laya.Vector2(Laya.MouseManager.instance.mouseX, Laya.MouseManager.instance.mouseY);
  2423. Laya.timer.frameLoop(1, this, this.OnSlider);
  2424. }
  2425. OnInputUp() {
  2426. this.offestx = 0;
  2427. this.m_runner.BackRote();
  2428. Laya.timer.clear(this, this.OnSlider);
  2429. }
  2430. OnInputSlider() {
  2431. var MousePos = new Laya.Vector2(Laya.MouseManager.instance.mouseX, Laya.MouseManager.instance.mouseY);
  2432. var offestX = MousePos.x - this.curMousePos.x;
  2433. offestX = offestX > 100 ? 100 : offestX;
  2434. offestX = offestX < -100 ? -100 : offestX;
  2435. this.offestx = GameUtils.lerp(this.offestx, offestX, 0.015);
  2436. this.m_runner.MoveX(-this.offestx);
  2437. var dir = new Vector3$4(-offestX * 0.005, 0, 0);
  2438. if (!this.m_runner.fly)
  2439. this.m_runner.TurnDir(dir);
  2440. this.curMousePos = MousePos;
  2441. }
  2442. }
  2443. Player.CanInput = true;
  2444. class TrialWindow extends ui.Window.TrialWindowUI {
  2445. constructor() {
  2446. super();
  2447. TrialWindow.instance = this;
  2448. }
  2449. static get Instance() {
  2450. return TrialWindow.instance;
  2451. }
  2452. OnOpen(_data = null) {
  2453. this.hidebtn.clickHandler = Laya.Handler.create(this, this.OnTrialHide, null, false);
  2454. var trialid = [2, 3, 4, 5, 6, 8, 9, 10, 11];
  2455. var curids = [];
  2456. for (var i = 0; i < trialid.length; i++) {
  2457. var id = trialid[i];
  2458. if (!PlayerAccount.CurrentAccount.CurAccountData.HasHero(id)) {
  2459. curids.push(id);
  2460. }
  2461. }
  2462. var useids = [];
  2463. for (var i = curids.length - 1; i > -1; i--) {
  2464. if (useids.length < 4) {
  2465. var index = GameUtils.getRandomInt(0, curids.length - 1);
  2466. useids.push(curids[index]);
  2467. curids.splice(index, 1);
  2468. }
  2469. }
  2470. if (curids.length)
  2471. var skins = [];
  2472. if (useids.length > 0) {
  2473. for (var i = 0; i < useids.length; i++) {
  2474. var heroid = useids[i];
  2475. skins.push(PlayerAccount.CurrentAccount.CurAccountData.m_heroDic[heroid]);
  2476. }
  2477. }
  2478. else {
  2479. this.Pass();
  2480. return;
  2481. }
  2482. this.skinlist.array = skins;
  2483. for (var i = 0; i < this.skinlist.cells.length; i++) {
  2484. var cell = this.skinlist.cells[i];
  2485. var config = skins[i];
  2486. var icon = cell.getChildAt(0).getChildAt(0).getChildAt(0);
  2487. icon.skin = config.id > 6 ? "trial/" + config.curicon + ".png" : "shop/" + config.curicon + ".png";
  2488. var btn = cell.getChildAt(0).getChildAt(1);
  2489. btn.clickHandler = Laya.Handler.create(this, this.OnTrialHero, [config], false);
  2490. }
  2491. this.passbtn.clickHandler = Laya.Handler.create(this, this.Pass);
  2492. this.height = Laya.stage.height;
  2493. Laya.stage.on(Laya.Event.RESIZE, this, () => {
  2494. this.height = Laya.stage.height;
  2495. });
  2496. }
  2497. OnTrialHero(_skin) {
  2498. ADPlayer.showVideoAd((flag) => {
  2499. if (flag) {
  2500. Player.Instance.RessetPlayer(_skin);
  2501. GameManager.Instance.ChangeState(GameState.Queue);
  2502. }
  2503. });
  2504. }
  2505. Pass() {
  2506. GameManager.Instance.ChangeState(GameState.Queue);
  2507. }
  2508. OnTrialHide() {
  2509. TrialWindow.trial = !TrialWindow.trial;
  2510. this.ppp.visible = !TrialWindow.trial;
  2511. }
  2512. OnHide() {
  2513. }
  2514. }
  2515. TrialWindow.trial = true;
  2516. class OffLineWindow extends ui.Window.OffLineWindowUI {
  2517. constructor() {
  2518. super();
  2519. this.num = 0;
  2520. this.left = [];
  2521. this.right = [];
  2522. OffLineWindow.instance = this;
  2523. }
  2524. OnOpen() {
  2525. for (var i = 0; i < PlayerAccount.CurrentAccount.CurAccountData.redata.length; i++) {
  2526. if (i <= 5) {
  2527. this.left.push(PlayerAccount.CurrentAccount.CurAccountData.redata[i]);
  2528. }
  2529. else if (i >= 6 && i <= 10) {
  2530. this.right.push(PlayerAccount.CurrentAccount.CurAccountData.redata[i]);
  2531. }
  2532. }
  2533. this.GameListLeft.array = this.left;
  2534. this.GameListLeft.renderHandler = Laya.Handler.create(this, this.RenderList, null, false);
  2535. this.GameListRight.array = this.right;
  2536. this.GameListRight.renderHandler = Laya.Handler.create(this, this.RenderList, null, false);
  2537. this.GetBtn.clickHandler = Laya.Handler.create(this, this.GetCoin);
  2538. this.DoubleBtn.clickHandler = Laya.Handler.create(this, this.DoubleGetCoin);
  2539. var Gold = this.panel.getChildByName("Box").getChildByName("Num");
  2540. Gold.text = this.RandomGold().toString();
  2541. this.num = this.RandomGold();
  2542. Gold.text = this.num.toString();
  2543. ADPlayer.MoveButton(this.BtnBox);
  2544. this.height = Laya.stage.height;
  2545. }
  2546. ;
  2547. RenderList(_box, index) {
  2548. var data = _box.dataSource;
  2549. var icon = _box.getChildAt(0).getChildByName("icon");
  2550. icon.skin = data.icon;
  2551. var name = _box.getChildAt(0).getChildByName("name");
  2552. name.text = data.title;
  2553. var btn = _box.getChildAt(0).getChildByName("btn");
  2554. var num = _box.getChildAt(0).getChildByName("num");
  2555. if (num)
  2556. num.text = GameUtils.getRandomInt(24841, 654878).toString() + "人玩";
  2557. btn.clickHandler = Laya.Handler.create(this, this.ClickBNavigate, [data], false);
  2558. }
  2559. ClickBNavigate(data) {
  2560. var appid = data.appid;
  2561. var path = data.path;
  2562. let param = { "appId": appid.toString(), "path": path.toString() };
  2563. if (Main.OnWx) {
  2564. WxApi.Instance.recordAldEvent("导出-总点击数", "1");
  2565. if (data.jump) {
  2566. Laya.Browser.window.wx.navigateToMiniProgram({
  2567. appId: appid.toString(),
  2568. path: path.toString(),
  2569. extraData: {
  2570. next_appid: data.next_appid,
  2571. next_path: data.next_path
  2572. },
  2573. envVersion: 'develop',
  2574. success: res => {
  2575. WxApi.Instance.recordAldEvent("导出成功-总用户数", "1");
  2576. WxApi.Instance.recordAldEvent("导出成功-" + data.title, "1");
  2577. console.log("跳转成功...");
  2578. },
  2579. fail: res => {
  2580. WindowManager.Instance.ClosePopView(WindowType.OffLineWindow);
  2581. WindowManager.Instance.OpenPopView(WindowType.RecommendWindow);
  2582. RecommendWindow.Instance.OpenChouTiView(true);
  2583. RecommendWindow.Instance.closeCt.clickHandler = Laya.Handler.create(this, () => {
  2584. WindowManager.Instance.ClosePopView(WindowType.RecommendWindow);
  2585. WindowManager.Instance.OpenPopView(WindowType.OffLineWindow);
  2586. });
  2587. console.log("跳转失败...");
  2588. }
  2589. });
  2590. }
  2591. else {
  2592. var marray = [data.image];
  2593. Laya.Browser.window.wx.previewImage({
  2594. current: data.image,
  2595. urls: marray,
  2596. success: res => {
  2597. WxApi.Instance.recordAldEvent("显示游戏二维码成功", "1");
  2598. },
  2599. fail: res => {
  2600. }
  2601. });
  2602. }
  2603. }
  2604. }
  2605. ShowOffLine(leftList, Right, panel, DoubleBtn, GetBtn) {
  2606. this.GameListLeft.visible = leftList;
  2607. this.GameListRight.visible = Right;
  2608. this.panel.visible = panel;
  2609. this.DoubleBtn.visible = DoubleBtn;
  2610. this.GetBtn.visible = GetBtn;
  2611. }
  2612. DoubleGetCoin() {
  2613. ADPlayer.showVideoAd((flag) => {
  2614. if (flag) {
  2615. var awardmoney = this.num * 2;
  2616. var agrs = [{ "reward_item": "1000" }, { "reward_num": awardmoney.toString() }, { "t": PlayerAccount.CurrentAccount.ServerTime.toString() }];
  2617. NetworkManager.Instance.HttpPostRequest(PROTOCOLS.vd, agrs, Laya.Handler.create(this, () => {
  2618. GameManager.Instance.videogetmoney -= 1;
  2619. }), null);
  2620. }
  2621. else {
  2622. var awardmoney = this.num;
  2623. var agrs = [{ "reward_item": "1000" }, { "reward_num": awardmoney.toString() }, { "t": PlayerAccount.CurrentAccount.ServerTime.toString() }];
  2624. NetworkManager.Instance.HttpPostRequest(PROTOCOLS.vd, agrs, Laya.Handler.create(this, () => {
  2625. GameManager.Instance.videogetmoney -= 1;
  2626. }), null);
  2627. }
  2628. WindowManager.Instance.ClosePopView(WindowType.OffLineWindow);
  2629. GameManager.Instance.GetGoin = true;
  2630. HomeWindow.Instance.goldTex.value = PlayerAccount.CurrentAccount.CurAccountData.GetUser(AccountUser.money);
  2631. });
  2632. }
  2633. GetCoin() {
  2634. var awardmoney = this.RandomGold();
  2635. var agrs = [{ "reward_item": "1000" }, { "reward_num": awardmoney.toString() }, { "t": PlayerAccount.CurrentAccount.ServerTime.toString() }];
  2636. NetworkManager.Instance.HttpPostRequest(PROTOCOLS.vd, agrs, Laya.Handler.create(this, () => {
  2637. GameManager.Instance.videogetmoney -= 1;
  2638. }), null);
  2639. WindowManager.Instance.ClosePopView(WindowType.OffLineWindow);
  2640. WindowManager.Instance.OpenPopView(WindowType.RecommendWindow);
  2641. GameManager.Instance.GetGoin = true;
  2642. HomeWindow.Instance.goldTex.value = PlayerAccount.CurrentAccount.CurAccountData.GetUser(AccountUser.money);
  2643. }
  2644. RandomGold() {
  2645. var goldnum = GameUtils.getRandomInt(100, 1000);
  2646. return goldnum;
  2647. }
  2648. ShowList() {
  2649. }
  2650. OnHide() {
  2651. RecommendWindow.Instance.ShowRecommendWindow(true, false, true, false, true);
  2652. }
  2653. ;
  2654. }
  2655. class HomeWindow extends ui.Window.HomeWindowUI {
  2656. constructor() {
  2657. super();
  2658. this.index = 0;
  2659. this.offestx = 0;
  2660. this.offestx2 = 0;
  2661. HomeWindow.instance = this;
  2662. }
  2663. static get Instance() {
  2664. return HomeWindow.instance;
  2665. }
  2666. OnOpen(_data = null) {
  2667. this.baginBtn.clickHandler = Laya.Handler.create(this, this.OnClickBagin, null, false);
  2668. this.skinshop.clickHandler = Laya.Handler.create(this, this.OnOpenSkinShop);
  2669. this.settingBtn.clickHandler = Laya.Handler.create(this, this.OnOpenSetting);
  2670. this.rankBtn.clickHandler = Laya.Handler.create(this, this.OnOpenRank);
  2671. this.signBtn.clickHandler = Laya.Handler.create(this, this.OnOpenSign);
  2672. this.taskBtn.clickHandler = Laya.Handler.create(this, this.OnOpenTask, null, false);
  2673. this.LeaveBtn.clickHandler = Laya.Handler.create(this, this.onOpenLeave);
  2674. this.moreFunBtn.clickHandler = Laya.Handler.create(this, this.onOpenMoreFun);
  2675. this.guide.on(Laya.Event.MOUSE_DOWN, this, this.OnGuideClick);
  2676. WindowManager.Instance.OpenPopView(WindowType.RecommendWindow);
  2677. if (!GameManager.Instance.GetGoin) {
  2678. WindowManager.Instance.OpenPopView(WindowType.OffLineWindow);
  2679. }
  2680. RecommendWindow.Instance.cheat = true;
  2681. OffLineWindow.instance.ShowOffLine(true, true, true, true, true);
  2682. RecommendWindow.Instance.cainixihuan.bottom = 0;
  2683. RecommendWindow.Instance.choutiBtn.clickHandler = Laya.Handler.create(this, this.OnCloseCT, null, false);
  2684. this.ShowBaoKuanYouXiView();
  2685. this.goldTex.value = PlayerAccount.CurrentAccount.CurAccountData.GetUser(AccountUser.money);
  2686. this.curswtage.value = (Number(PlayerAccount.CurrentAccount.CurAccountData.GetUser(AccountUser.stage)) + 1).toString();
  2687. this.height = Laya.stage.height;
  2688. }
  2689. ShowBaoKuanYouXiView() {
  2690. this.index = PlayerAccount.CurrentAccount.CurAccountData.redata.length - 1;
  2691. this.RefreshBaoKuanYouXi();
  2692. Laya.timer.loop(3000, this, this.LoopBaoKuan);
  2693. }
  2694. LoopBaoKuan() {
  2695. this.index--;
  2696. if (this.index < 0) {
  2697. this.index = PlayerAccount.CurrentAccount.CurAccountData.redata.length - 1;
  2698. }
  2699. this.RefreshBaoKuanYouXi();
  2700. }
  2701. RefreshBaoKuanYouXi() {
  2702. var data = PlayerAccount.CurrentAccount.CurAccountData.redata[this.index];
  2703. var icon = this.rebtn.getChildByName("icon");
  2704. icon.skin = data.icon;
  2705. var name = this.rebtn.getChildByName("name");
  2706. name.text = data.title;
  2707. this.rebtn.clickHandler = Laya.Handler.create(this, this.ClickBNavigate, [data], false);
  2708. }
  2709. ClickBNavigate(data) {
  2710. var appid = data.appid;
  2711. var path = data.path;
  2712. let param = { "appId": appid.toString(), "path": path.toString() };
  2713. if (Main.OnWx) {
  2714. WxApi.Instance.recordAldEvent("导出-总点击数", "1");
  2715. if (data.jump) {
  2716. Laya.Browser.window.wx.navigateToMiniProgram({
  2717. appId: appid.toString(),
  2718. path: path.toString(),
  2719. extraData: {
  2720. next_appid: data.next_appid,
  2721. next_path: data.next_path
  2722. },
  2723. envVersion: 'develop',
  2724. success: res => {
  2725. WxApi.Instance.recordAldEvent("导出成功-总用户数", "1");
  2726. WxApi.Instance.recordAldEvent("导出成功-" + data.title, "1");
  2727. console.log("跳转成功...");
  2728. },
  2729. fail: res => {
  2730. RecommendWindow.Instance.OpenChouTiView(true);
  2731. console.log("跳转失败...");
  2732. }
  2733. });
  2734. }
  2735. else {
  2736. var marray = [data.image];
  2737. Laya.Browser.window.wx.previewImage({
  2738. current: data.image,
  2739. urls: marray,
  2740. success: res => {
  2741. WxApi.Instance.recordAldEvent("显示游戏二维码成功", "1");
  2742. },
  2743. fail: res => {
  2744. }
  2745. });
  2746. }
  2747. }
  2748. }
  2749. OnGuideClick() {
  2750. this.guide.on(Laya.Event.MOUSE_MOVE, this, this.OnClickBagin);
  2751. }
  2752. ShowGuide() {
  2753. this.Mask1 = new Laya.Sprite();
  2754. this.Mask1.graphics.drawRect(0, 0, this.guide1.width, this.guide1.height, "#000000");
  2755. this.Mask1.pivot(this.guide1.width, 0);
  2756. this.guide1.mask = this.Mask1;
  2757. this.Mask2 = new Laya.Sprite();
  2758. this.Mask2.graphics.drawRect(0, 0, this.guide2.width, this.guide2.height, "#000000");
  2759. this.Mask2.pivot(this.guide2.width, 0);
  2760. this.guide2.mask = this.Mask2;
  2761. this.offestx = 0;
  2762. this.offestx2 = 0;
  2763. Laya.timer.frameLoop(1, this, this.RefreshMask1);
  2764. }
  2765. RefreshMask1() {
  2766. this.offestx += 3;
  2767. if (this.offestx > this.guide1.width) {
  2768. Laya.timer.clear(this, this.RefreshMask1);
  2769. this.offestx = 0;
  2770. this.Mask1.pos(this.offestx, 0);
  2771. Laya.timer.frameLoop(1, this, this.RefreshMask2);
  2772. return;
  2773. }
  2774. this.Mask1.pos(this.offestx, 0);
  2775. this.hand.x = this.guide1.x + this.offestx;
  2776. }
  2777. RefreshMask2() {
  2778. this.offestx2 += 3;
  2779. if (this.offestx2 > this.guide2.width) {
  2780. Laya.timer.clear(this, this.RefreshMask2);
  2781. this.offestx2 = 0;
  2782. this.Mask2.pos(this.guide1.x + this.guide1.width, 0);
  2783. Laya.timer.frameLoop(1, this, this.RefreshMask1);
  2784. return;
  2785. }
  2786. this.Mask2.pos(this.offestx2, 0);
  2787. this.hand.x = this.guide2.x - this.offestx2;
  2788. }
  2789. OnClickBagin() {
  2790. WxApi.Instance.recordAldEvent("主界面点击开始游戏", "");
  2791. if (TrialWindow.trial && PlayerAccount.CurrentAccount.CurAccountData.trial) {
  2792. WindowManager.Instance.ShowWindow(WindowType.TrialWindow);
  2793. }
  2794. else {
  2795. GameManager.Instance.ChangeState(GameState.Queue);
  2796. }
  2797. }
  2798. OnOpenSkinShop() {
  2799. WxApi.Instance.recordAldEvent("主界面点击皮肤商城", "");
  2800. WindowManager.Instance.ShowWindow(WindowType.ShopWindow);
  2801. }
  2802. OnOpenSetting() {
  2803. WxApi.Instance.recordAldEvent("主界面点击设置界面", "");
  2804. WindowManager.Instance.ShowWindow(WindowType.SettingWindow);
  2805. }
  2806. OnOpenRank() {
  2807. WxApi.Instance.recordAldEvent("主界面点击排行榜", "");
  2808. WindowManager.Instance.ShowWindow(WindowType.RankWindow);
  2809. }
  2810. OnOpenSign() {
  2811. WxApi.Instance.recordAldEvent("主界面点击签到界面", "");
  2812. WindowManager.Instance.ShowWindow(WindowType.SignWindow);
  2813. }
  2814. OnOpenTask() {
  2815. WxApi.Instance.recordAldEvent("主界面点击任务界面", "");
  2816. WxApi.Message("暂未开放");
  2817. }
  2818. onOpenLeave() {
  2819. WxApi.Instance.recordAldEvent("主界面点击离开游戏", "");
  2820. WindowManager.Instance.ShowWindow(WindowType.MoreFunWindow);
  2821. }
  2822. onOpenMoreFun() {
  2823. WxApi.Instance.recordAldEvent("主界面点击更多好玩游戏", "");
  2824. WindowManager.Instance.ShowWindow(WindowType.FriendPlayingWindow);
  2825. }
  2826. OnOpenOffLine() {
  2827. WxApi.Instance.recordAldEvent("离线收益界面开启", "");
  2828. WindowManager.Instance.ShowWindow(WindowType.OffLineWindow);
  2829. }
  2830. OnCloseCT() {
  2831. RecommendWindow.Instance.OpenChouTiView(true);
  2832. RecommendWindow.Instance.closeCt.clickHandler = Laya.Handler.create(this, () => {
  2833. WindowManager.Instance.ShowWindow(WindowType.HomeWindow);
  2834. });
  2835. }
  2836. OnHide() {
  2837. this.guide.off(Laya.Event.MOUSE_DOWN, this, this.OnGuideClick);
  2838. this.guide.off(Laya.Event.MOUSE_MOVE, this, this.OnClickBagin);
  2839. Laya.timer.clearAll(this);
  2840. }
  2841. }
  2842. class InGameWindow extends ui.Window.InGameWindowUI {
  2843. constructor() {
  2844. super();
  2845. this.nextpoint = [];
  2846. this.oldpoint = [];
  2847. this.index = 0;
  2848. InGameWindow.instance = this;
  2849. }
  2850. static get Instance() {
  2851. return InGameWindow.instance;
  2852. }
  2853. OnOpen(_data = null) {
  2854. EventManager.EventOn(EventType.MoneyChange, this, this.OnHover);
  2855. this.RefreshBaoKuanYouXi();
  2856. Laya.timer.loop(3000, this, this.LoopBaoKuan);
  2857. this.height = Laya.stage.height;
  2858. }
  2859. OnPlayerRank(_playerList) {
  2860. this.ranklist.array = _playerList;
  2861. this.ranklist.renderHandler = Laya.Handler.create(this, this.OnRank, null, false);
  2862. }
  2863. OnRank(_box) {
  2864. var data = _box.dataSource;
  2865. var name = _box.getChildAt(0).getChildByName("name");
  2866. name.text = data.name;
  2867. var score = _box.getChildAt(0).getChildByName("score");
  2868. score.text = Math.round(data.m_sprite.transform.position.z).toString();
  2869. }
  2870. OnHover(_time) {
  2871. this.score.value = _time.toString();
  2872. }
  2873. OnExtraspeedtime(_time) {
  2874. this.extraspeedtime.text = Math.round(_time).toString();
  2875. }
  2876. OnSpeed(_time) {
  2877. this.speed.text = _time;
  2878. }
  2879. OnFly(_time) {
  2880. this.flytime.text = Math.round(_time).toString();
  2881. }
  2882. OnGetRoadPoint(_ps) {
  2883. this.road.text = Math.floor(_ps).toString();
  2884. }
  2885. LoopBaoKuan() {
  2886. this.index++;
  2887. if (this.index > PlayerAccount.CurrentAccount.CurAccountData.redata.length - 1) {
  2888. this.index = 0;
  2889. }
  2890. this.RefreshBaoKuanYouXi();
  2891. }
  2892. RefreshBaoKuanYouXi() {
  2893. var data = PlayerAccount.CurrentAccount.CurAccountData.redata[this.index];
  2894. var icon = this.shiwan.getChildByName("icon");
  2895. icon.skin = data.icon;
  2896. var btn = this.shiwan.getChildByName("btn");
  2897. btn.clickHandler = Laya.Handler.create(this, this.ClickBNavigate, [data], false);
  2898. }
  2899. RenderList(_box, index) {
  2900. var data = _box.dataSource;
  2901. var icon = _box.getChildAt(0).getChildByName("icon");
  2902. icon.skin = data.icon;
  2903. var btn = _box.getChildAt(0).getChildByName("btn");
  2904. btn.clickHandler = Laya.Handler.create(this, this.ClickBNavigate, [data], false);
  2905. }
  2906. ClickBNavigate(data) {
  2907. var appid = data.appid;
  2908. var path = data.path;
  2909. let param = { "appId": appid.toString(), "path": path.toString() };
  2910. if (Main.OnWx) {
  2911. WxApi.Instance.recordAldEvent("导出-总点击数", "1");
  2912. if (data.jump) {
  2913. Laya.Browser.window.wx.navigateToMiniProgram({
  2914. appId: appid.toString(),
  2915. path: path.toString(),
  2916. extraData: {
  2917. next_appid: data.next_appid,
  2918. next_path: data.next_path
  2919. },
  2920. envVersion: 'develop',
  2921. success: res => {
  2922. WxApi.Instance.recordAldEvent("导出成功-总用户数", "1");
  2923. WxApi.Instance.recordAldEvent("导出成功-" + data.title, "1");
  2924. console.log("跳转成功...");
  2925. },
  2926. fail: res => {
  2927. WindowManager.Instance.OpenPopView(WindowType.RecommendWindow);
  2928. RecommendWindow.Instance.OpenChouTiView(true);
  2929. RecommendWindow.Instance.closeCt.clickHandler = Laya.Handler.create(this, () => {
  2930. WindowManager.Instance.ClosePopView(WindowType.RecommendWindow);
  2931. });
  2932. console.log("跳转失败...");
  2933. }
  2934. });
  2935. }
  2936. else {
  2937. var marray = [data.image];
  2938. Laya.Browser.window.wx.previewImage({
  2939. current: data.image,
  2940. urls: marray,
  2941. success: res => {
  2942. WxApi.Instance.recordAldEvent("显示游戏二维码成功", "1");
  2943. },
  2944. fail: res => {
  2945. }
  2946. });
  2947. }
  2948. }
  2949. }
  2950. OnHide() {
  2951. EventManager.EventOff(EventType.Hover, this, this.OnHover);
  2952. EventManager.EventOff(EventType.extraspeedtime, this, this.OnExtraspeedtime);
  2953. EventManager.EventOff(EventType.speed, this, this.OnSpeed);
  2954. EventManager.EventOff(EventType.flytime, this, this.OnFly);
  2955. EventManager.EventOff(EventType.GetRoadPoint, this, this.OnGetRoadPoint);
  2956. EventManager.EventOff(EventType.PlayerRank, this, this.OnPlayerRank);
  2957. }
  2958. }
  2959. var SignItemState;
  2960. (function (SignItemState) {
  2961. SignItemState[SignItemState["ready"] = 0] = "ready";
  2962. SignItemState[SignItemState["locking"] = 1] = "locking";
  2963. SignItemState[SignItemState["complete"] = 2] = "complete";
  2964. })(SignItemState || (SignItemState = {}));
  2965. class JiangLi {
  2966. constructor(_num, _amount) {
  2967. this.jianglinum = _num;
  2968. this.jiangliamount = _amount;
  2969. }
  2970. }
  2971. class QianDao {
  2972. get JiangLiShuJu() {
  2973. var jianglishuju = this.jianglis.split(";");
  2974. if (jianglishuju.length > 1) {
  2975. return new JiangLi(Number(6000), Number(1));
  2976. }
  2977. else {
  2978. return new JiangLi(Number(this.jianglis), Number(this.jiangliamount));
  2979. }
  2980. }
  2981. }
  2982. class SignWindow extends ui.Window.SignWindowUI {
  2983. constructor() {
  2984. super();
  2985. this.JiangLiLieBiao = {};
  2986. this.qiandaoshujus = [];
  2987. SignWindow.Viewmode = this;
  2988. }
  2989. static get Mode() {
  2990. return SignWindow.Viewmode;
  2991. }
  2992. OnOpen(_data = null) {
  2993. this.qiandaoshujus = this.GetQinDaoShuJu();
  2994. this.ShuaXinLieBiao();
  2995. this.ShuangBei.visible = SignWindow.keyiqiandao;
  2996. this.ShuangBei.clickHandler = Laya.Handler.create(this, this.OnDoubleSign, null, false);
  2997. this.return.clickHandler = Laya.Handler.create(this, this.GoHome);
  2998. this.ptBtn.clickHandler = Laya.Handler.create(this, this.OnSign, null, false);
  2999. ADPlayer.MoveButton(this.BtnBox);
  3000. this.height = Laya.stage.height;
  3001. }
  3002. GoHome() {
  3003. WindowManager.Instance.ShowWindow(WindowType.HomeWindow);
  3004. }
  3005. GetQinDaoShuJu() {
  3006. var qiandaos = [];
  3007. var peizhi = PlayerAccount.CurrentAccount.CurAccountData.GetConfig(AccountConfig.sign);
  3008. var qiandaotian = Number(PlayerAccount.CurrentAccount.CurAccountData.GetSign(signdata.sign_days));
  3009. var diyizhou = qiandaotian < 7;
  3010. var afsafssfa = diyizhou ? 0 : 7;
  3011. for (var i = afsafssfa; i < afsafssfa + 7; i++) {
  3012. this.JiangLiLieBiao[peizhi[i].id] = peizhi[i].rewards;
  3013. }
  3014. for (var key in this.JiangLiLieBiao) {
  3015. var jianglinum = this.JiangLiLieBiao[key];
  3016. var jiangli = PlayerAccount.CurrentAccount.CurAccountData.GetRewardConfig(jianglinum);
  3017. var afsfsafs = new QianDao();
  3018. afsfsafs.miaoshu = jiangli.group_name;
  3019. afsfsafs.logo = jiangli.icon;
  3020. afsfsafs.qiandaonum = Number(jiangli.id);
  3021. afsfsafs.jianglis = jiangli.reward_item;
  3022. afsfsafs.jiangliamount = jiangli.reward_num;
  3023. afsfsafs.weight = jiangli.reward_weight;
  3024. var fasafsaf = Number(key);
  3025. if (qiandaotian > fasafsaf - 1)
  3026. afsfsafs.mold = SignItemState.complete;
  3027. if (qiandaotian < fasafsaf - 1)
  3028. afsfsafs.mold = SignItemState.locking;
  3029. if (qiandaotian == fasafsaf - 1 && SignWindow.keyiqiandao) {
  3030. afsfsafs.mold = SignItemState.ready;
  3031. }
  3032. qiandaos.push(afsfsafs);
  3033. }
  3034. return qiandaos;
  3035. }
  3036. ShuaXinLieBiao() {
  3037. for (var i = 0; i < this.qiandaoPan.numChildren; i++) {
  3038. var qindao = this.qiandaoPan.getChildAt(i);
  3039. var shuju = this.qiandaoshujus[i];
  3040. var jianglinum = shuju.JiangLiShuJu.jianglinum;
  3041. var award = qindao.getChildByName("jiangli").getChildByName("money");
  3042. award.visible = true;
  3043. var clip = award.getChildAt(1);
  3044. clip.value = "x" + shuju.JiangLiShuJu.jiangliamount.toString();
  3045. var icon = award.getChildAt(0);
  3046. icon.skin = "sign/qiandao_1_5_4.png";
  3047. var bg = qindao.getChildByName("bg");
  3048. bg.skin = "sign/qiandao_1_3.png";
  3049. var money = qindao.getChildByName("jiangli").getChildByName("money");
  3050. money.visible = false;
  3051. var role = qindao.getChildByName("jiangli").getChildByName("role");
  3052. role.visible = false;
  3053. var cb = qindao.getChildByName("jiangli").getChildByName("cb");
  3054. cb.visible = false;
  3055. if (jianglinum == 1000) {
  3056. money.visible = true;
  3057. var clip = money.getChildAt(1);
  3058. clip.value = shuju.JiangLiShuJu.jiangliamount.toString();
  3059. var sprite = money.getChildAt(0);
  3060. sprite.skin = "sign/qiandao_1_5_4.png";
  3061. }
  3062. else if (jianglinum >= 7001 && jianglinum <= 70012) {
  3063. role.visible = true;
  3064. var roleicon = PlayerAccount.CurrentAccount.CurAccountData.GetEntity(jianglinum.toString(), entity.icon);
  3065. var sprite = role.getChildAt(0);
  3066. sprite.skin = "shop/" + roleicon + ".png";
  3067. }
  3068. else if (jianglinum >= 8001 && jianglinum <= 8006) {
  3069. cb.visible = true;
  3070. var cbicon = PlayerAccount.CurrentAccount.CurAccountData.GetEntity(jianglinum.toString(), entity.icon);
  3071. var sprite = cb.getChildAt(0);
  3072. sprite.skin = "shop/" + cbicon + ".png";
  3073. }
  3074. var cansign = shuju.mold;
  3075. if (cansign == SignItemState.complete) {
  3076. var complete = qindao.getChildByName("complete");
  3077. complete.visible = true;
  3078. bg.skin = "sign/qiandao_1_4_2.png";
  3079. }
  3080. else if (cansign == SignItemState.ready) {
  3081. var btn = qindao.getChildByName("button");
  3082. btn.clickHandler = Laya.Handler.create(this, this.OnSign, null, false);
  3083. bg.skin = "sign/qiandao_1_4.png";
  3084. }
  3085. }
  3086. }
  3087. OnSign() {
  3088. var curgold = Number(PlayerAccount.CurrentAccount.CurAccountData.GetUser(AccountUser.money));
  3089. let param = [{ "video": "0" }];
  3090. NetworkManager.Instance.HttpPostRequest(PROTOCOLS.Sign, param, Laya.Handler.create(this, function (e) {
  3091. console.log("OnSign---111111111");
  3092. var reward = e["rewards"];
  3093. SignWindow.Mode.qiandaoshujus = SignWindow.Mode.GetQinDaoShuJu();
  3094. SignWindow.Mode.ShuangBei.visible = false;
  3095. SignWindow.Mode.ShuaXinLieBiao();
  3096. if (reward["1000"]) {
  3097. console.log("OnSign---222222");
  3098. var gg = Number(PlayerAccount.CurrentAccount.CurAccountData.GetUser(AccountUser.money)) - curgold;
  3099. GameUtils.GetMoney(gg, null, Laya.Handler.create(this, () => {
  3100. console.log("OnSign---3333333");
  3101. WindowManager.Instance.ShowWindow(WindowType.HomeWindow);
  3102. }));
  3103. }
  3104. else {
  3105. GameUtils.TweenText(new TextData("皮肤 + 1", new Laya.Vector2(Laya.stage.width / 2, Laya.stage.height * 0.35), new Laya.Vector2(250, 80), 30), 150, Laya.Handler.create(this, () => {
  3106. WindowManager.Instance.ShowWindow(WindowType.HomeWindow);
  3107. }));
  3108. }
  3109. }), Laya.Handler.create(this, this.OnSignError), true);
  3110. }
  3111. OnDoubleSign() {
  3112. console.log("双倍领取doublesign");
  3113. ADPlayer.showVideoAd((flag) => {
  3114. if (flag) {
  3115. var curgold = Number(PlayerAccount.CurrentAccount.CurAccountData.GetUser(AccountUser.money));
  3116. let param = [{ "video": "1" }];
  3117. NetworkManager.Instance.HttpPostRequest(PROTOCOLS.Sign, param, Laya.Handler.create(this, function (e) {
  3118. var reward = e["rewards"];
  3119. SignWindow.Mode.qiandaoshujus = SignWindow.Mode.GetQinDaoShuJu();
  3120. SignWindow.Mode.ShuangBei.visible = false;
  3121. SignWindow.Mode.ShuaXinLieBiao();
  3122. if (reward["1000"]) {
  3123. var gg = Number(PlayerAccount.CurrentAccount.CurAccountData.GetUser(AccountUser.money)) - curgold;
  3124. GameUtils.GetMoney(gg, null, Laya.Handler.create(this, () => {
  3125. WindowManager.Instance.ShowWindow(WindowType.HomeWindow);
  3126. }));
  3127. }
  3128. else {
  3129. GameUtils.TweenText(new TextData("皮肤 + 1", new Laya.Vector2(Laya.stage.width / 2, Laya.stage.height * 0.35), new Laya.Vector2(250, 80), 30), 150, Laya.Handler.create(this, () => {
  3130. WindowManager.Instance.ShowWindow(WindowType.HomeWindow);
  3131. }));
  3132. }
  3133. }), Laya.Handler.create(this, this.OnSignError), true);
  3134. }
  3135. });
  3136. }
  3137. OnSignError(e) {
  3138. console.log(e);
  3139. }
  3140. OnHide() {
  3141. }
  3142. static get keyiqiandao() {
  3143. let fassafsafs = new Date(PlayerAccount.CurrentAccount.ServerTime * 1000);
  3144. fassafsafs.setHours(0, 0, 0, 0);
  3145. var faafsafs = fassafsafs.valueOf();
  3146. var dadadas = Number(PlayerAccount.CurrentAccount.CurAccountData.GetSign(signdata.sign_time));
  3147. var asagsag = dadadas * 1000;
  3148. var faafs = asagsag < faafsafs ? true : false;
  3149. return faafs;
  3150. }
  3151. }
  3152. class SettlementWindow extends ui.Window.SettlementWindowUI {
  3153. constructor() {
  3154. super();
  3155. SettlementWindow.instance = this;
  3156. }
  3157. static get Instance() {
  3158. return SettlementWindow.instance;
  3159. }
  3160. OnOpen(win = false) {
  3161. WxApi.Instance.recordAldEvent("进入结算界面 " + "win:" + win + " stage:" + LevelManager.Instance.curLevel.levelid, "1");
  3162. if (win) {
  3163. this.winshow.visible = true;
  3164. }
  3165. else {
  3166. this.loseshow.visible = true;
  3167. }
  3168. this.getmoney.value = GameManager.Instance.gamegold.toString();
  3169. this.scoreTex.value = Player.Instance.m_runner.die ? "6" : Queue.Instance.GetPlayerScore.toString();
  3170. var iswin = win ? "1" : "0";
  3171. var rank = Queue.Instance.GetPlayerScore;
  3172. var equiphero = PlayerAccount.CurrentAccount.CurAccountData.GetUser(AccountUser.equip_hero);
  3173. var qeuiphat = PlayerAccount.CurrentAccount.CurAccountData.GetUser(AccountUser.equip_hat);
  3174. var qeuipdance = PlayerAccount.CurrentAccount.CurAccountData.GetUser(AccountUser.equip_dance);
  3175. var agrs = [{ "t": PlayerAccount.CurrentAccount.ServerTime.toString() }, { "win": iswin }, { "rank": rank.toString() }, { "money": GameManager.Instance.gamegold.toString() }, { "hat": qeuiphat }, { "hero": equiphero }, { "dance": qeuipdance }];
  3176. NetworkManager.Instance.HttpPostRequest(PROTOCOLS.end, agrs, Laya.Handler.create(this, this.OnSettlementEnd, [win]), Laya.Handler.create(this, this.OnError));
  3177. WindowManager.Instance.OpenPopView(WindowType.RecommendWindow);
  3178. RecommendWindow.Instance.ShowRecommendWindow(false, false, false, true, false);
  3179. ADPlayer.MoveButton(this.BtnPan);
  3180. this.awardBtn.clickHandler = Laya.Handler.create(this, this.OnVdAward);
  3181. this.height = Laya.stage.height;
  3182. }
  3183. OnVdAward() {
  3184. WxApi.Instance.recordAldEvent("点击3倍奖励", "");
  3185. ADPlayer.showVideoAd((flag) => {
  3186. if (flag) {
  3187. var awardmoney = GameManager.Instance.gamegold * 3;
  3188. var agrs = [{ "reward_item": "1000" }, { "reward_num": awardmoney.toString() }, { "t": PlayerAccount.CurrentAccount.ServerTime.toString() }];
  3189. NetworkManager.Instance.HttpPostRequest(PROTOCOLS.vd, agrs, Laya.Handler.create(this, () => {
  3190. GameUtils.GetMoney(awardmoney);
  3191. }), null);
  3192. }
  3193. });
  3194. }
  3195. OnPlayAgain(_win) {
  3196. if (_win) {
  3197. GameManager.Instance.EnterNextLevel();
  3198. }
  3199. else {
  3200. GameManager.Instance.RessetGame();
  3201. }
  3202. if (SignWindow.keyiqiandao) {
  3203. WindowManager.Instance.ShowWindow(WindowType.SignWindow);
  3204. }
  3205. else {
  3206. ADPlayer.ClearBanner();
  3207. RecommendWindow.Instance.chouti.visible = true;
  3208. RecommendWindow.Instance.choutiBtn.visible = false;
  3209. RecommendWindow.Instance.OpenChouTiView(true);
  3210. RecommendWindow.Instance.closeCt.clickHandler = Laya.Handler.create(this, () => {
  3211. WindowManager.Instance.ShowWindow(WindowType.HomeWindow);
  3212. });
  3213. }
  3214. }
  3215. OnSettlementEnd(_win, _data) {
  3216. var level = LevelManager.Instance.curLevel;
  3217. if (_win) {
  3218. WxApi.Instance.levelSuccess(level.levelid.toString(), level.levelid.toString(), PlayerAccount.CurrentAccount.CurAccountData.UseId);
  3219. }
  3220. else {
  3221. WxApi.Instance.levelFail(level.levelid.toString(), level.levelid.toString(), PlayerAccount.CurrentAccount.CurAccountData.UseId, Player.Instance.CurLevelPrecent.toString(), Player.Instance.m_runner.m_sprite.name);
  3222. }
  3223. var stage = Number(PlayerAccount.CurrentAccount.CurAccountData.GetUser(AccountUser.stage));
  3224. if (_win)
  3225. WxApi.writeStage(stage);
  3226. this.backhome.clickHandler = Laya.Handler.create(this, this.OnPlayAgain, [_win]);
  3227. }
  3228. OnError(e) {
  3229. console.log(e);
  3230. }
  3231. OnHide() {
  3232. }
  3233. }
  3234. class ReviveWindow extends ui.Window.ReviveWindowUI {
  3235. constructor() {
  3236. super();
  3237. ReviveWindow.instance = this;
  3238. }
  3239. static get Instance() {
  3240. return ReviveWindow.instance;
  3241. }
  3242. OnOpen(_data = null) {
  3243. WxApi.Instance.recordAldEvent("进入复活界面", "1");
  3244. this.passBtn.clickHandler = Laya.Handler.create(this, this.OnPassRevive);
  3245. this.reviveBtn.clickHandler = Laya.Handler.create(this, this.OnRevive, null, false);
  3246. this.stagepre.value = Player.Instance.CurLevelPrecent;
  3247. this.stagetex.value = LevelManager.Instance.curLevel.levelid.toString();
  3248. this.stageClip.value = Math.floor(Player.Instance.CurLevelPrecent * 100).toString();
  3249. this.getmoney.value = GameManager.Instance.gamegold.toString();
  3250. WindowManager.Instance.OpenPopView(WindowType.RecommendWindow);
  3251. RecommendWindow.Instance.ShowRecommendWindow(false, false, false, true, false);
  3252. ADPlayer.MoveButton(this.BtnPan);
  3253. this.height = Laya.stage.height;
  3254. }
  3255. OnPassRevive() {
  3256. WxApi.Instance.recordAldEvent("点击跳过复活", "1");
  3257. GameManager.Instance.ChangeState(GameState.End, false);
  3258. }
  3259. ReadyShow() {
  3260. this.showcarCamera = new Laya.Camera();
  3261. this.showScence.addChild(this.showcarCamera);
  3262. this.showlight = new Laya.DirectionLight();
  3263. this.showScence.addChild(this.showlight);
  3264. this.curstage = new Laya.Sprite3D();
  3265. this.showScence.addChild(this.curstage);
  3266. this.showcarCamera.viewport = new Laya.Viewport(this.showpan.x, this.showpan.y, this.showpan.width, this.showpan.height);
  3267. this.showcarCamera.clearFlag = 2;
  3268. this.showcarCamera.fieldOfView = 30;
  3269. this.showcarCamera.transform.position = new Laya.Vector3(0, 0.5, 1.1);
  3270. ResourcesManager.Instance.LoadPlayer(1, Laya.Handler.create(this, this.OnPlayerLoad, [1]));
  3271. }
  3272. OnPlayerLoad(_id, _model) {
  3273. var cursprite = _model.getChildAt(0);
  3274. this.cursprite = PoolManager.Instance.CreatMeshSprite3D(cursprite, "");
  3275. this.curanimator = this.cursprite.getChildAt(0).getComponent(Laya.Animator);
  3276. this.curstage.addChild(this.cursprite);
  3277. this.cursprite.transform.localPosition = new Laya.Vector3(0, 0, 0);
  3278. this.cursprite.transform.rotationEuler = new Laya.Vector3(-10, 0, 0);
  3279. var lookpos = new Laya.Vector3(this.cursprite.transform.position.x, this.cursprite.transform.position.y + 0.3, this.cursprite.transform.position.z + 0.01);
  3280. this.showcarCamera.transform.lookAt(lookpos, new Laya.Vector3(0, 1, 0));
  3281. Laya.timer.once(500, this, () => {
  3282. this.curanimator.play("lose");
  3283. });
  3284. }
  3285. OnRevive() {
  3286. if (!Main.OnWx) {
  3287. GameManager.Instance.ReviveGame();
  3288. return;
  3289. }
  3290. WxApi.Instance.recordAldEvent("点击复活", "1");
  3291. ADPlayer.showVideoAd((flag) => {
  3292. if (flag) {
  3293. WxApi.Instance.recordAldEvent("复活成功", "1");
  3294. GameManager.Instance.ReviveGame();
  3295. }
  3296. else {
  3297. WxApi.Instance.recordAldEvent("复活失败", "1");
  3298. }
  3299. });
  3300. }
  3301. OnHide() {
  3302. }
  3303. }
  3304. var Vector2$1 = Laya.Vector2;
  3305. var ShopState;
  3306. (function (ShopState) {
  3307. ShopState[ShopState["role"] = 0] = "role";
  3308. ShopState[ShopState["hat"] = 1] = "hat";
  3309. ShopState[ShopState["cb"] = 2] = "cb";
  3310. })(ShopState || (ShopState = {}));
  3311. class ShopWindow extends ui.Window.ShopWindowUI {
  3312. constructor() {
  3313. super();
  3314. this.roleicon = new Vector2$1(69, 172);
  3315. this.cbicon = new Vector2$1(166, 83);
  3316. this.haticon = new Vector2$1(102, 95);
  3317. this.showhatdic = {};
  3318. this.showcbdic = {};
  3319. this.herodatas = [];
  3320. this.hatDatas = [];
  3321. this.cbDatas = [];
  3322. this.curstate = ShopState.role;
  3323. ShopWindow.instance = this;
  3324. }
  3325. InitData() {
  3326. this.herodatas = [];
  3327. this.hatDatas = [];
  3328. this.cbDatas = [];
  3329. var gethero = [];
  3330. var nogethero = [];
  3331. var gethat = [];
  3332. var nogethat = [];
  3333. var getcb = [];
  3334. var nogetcb = [];
  3335. for (var key in PlayerAccount.CurrentAccount.CurAccountData.m_heroDic) {
  3336. var data = PlayerAccount.CurrentAccount.CurAccountData.m_heroDic[key];
  3337. if (PlayerAccount.CurrentAccount.CurAccountData.HasHero(data.id)) {
  3338. gethero.push(data);
  3339. }
  3340. else {
  3341. nogethero.push(data);
  3342. }
  3343. }
  3344. this.herodatas = gethero.concat(nogethero);
  3345. for (var key in PlayerAccount.CurrentAccount.CurAccountData.m_hatDic) {
  3346. var data1 = PlayerAccount.CurrentAccount.CurAccountData.m_hatDic[key];
  3347. if (PlayerAccount.CurrentAccount.CurAccountData.HasHat(data1.id)) {
  3348. gethat.push(data1);
  3349. }
  3350. else {
  3351. nogethat.push(data1);
  3352. }
  3353. }
  3354. this.hatDatas = gethat.concat(nogethat);
  3355. for (var key in PlayerAccount.CurrentAccount.CurAccountData.m_cbDic) {
  3356. var data1 = PlayerAccount.CurrentAccount.CurAccountData.m_cbDic[key];
  3357. if (PlayerAccount.CurrentAccount.CurAccountData.HasDane(data1.id)) {
  3358. getcb.push(data1);
  3359. }
  3360. else {
  3361. nogetcb.push(data1);
  3362. }
  3363. }
  3364. this.cbDatas = getcb.concat(nogetcb);
  3365. }
  3366. static get Instance() {
  3367. return ShopWindow.instance;
  3368. }
  3369. OnOpen(_data = null) {
  3370. this.InitData();
  3371. this.showScence = new Laya.Scene3D();
  3372. this.addChild(this.showScence);
  3373. this.ReadyShow();
  3374. this.closeBtn.clickHandler = Laya.Handler.create(this, this.CloseW);
  3375. this.renderList.vScrollBarSkin = "";
  3376. this.roleBtn.clickHandler = Laya.Handler.create(this, this.ChangeState, [ShopState.role], false);
  3377. this.hatBtn.clickHandler = Laya.Handler.create(this, this.ChangeState, [ShopState.hat], false);
  3378. this.cbBtn.clickHandler = Laya.Handler.create(this, this.ChangeState, [ShopState.cb], false);
  3379. this.vdawardBtn.clickHandler = Laya.Handler.create(this, this.OnVdAward, null, false);
  3380. this.height = Laya.stage.height;
  3381. }
  3382. ChangeState(_state) {
  3383. this.curstate = _state;
  3384. switch (_state) {
  3385. case ShopState.role:
  3386. this.OnShowRoleList();
  3387. break;
  3388. case ShopState.hat:
  3389. this.OnShowHatList();
  3390. break;
  3391. case ShopState.cb:
  3392. this.OnShowcbList();
  3393. break;
  3394. }
  3395. }
  3396. OnVdAward() {
  3397. if (GameManager.Instance.videogetmoney <= 0)
  3398. return;
  3399. ADPlayer.showVideoAd((flag) => {
  3400. if (flag) {
  3401. var awardmoney = 200;
  3402. var agrs = [{ "reward_item": "1000" }, { "reward_num": awardmoney.toString() }, { "t": PlayerAccount.CurrentAccount.ServerTime.toString() }];
  3403. NetworkManager.Instance.HttpPostRequest(PROTOCOLS.vd, agrs, Laya.Handler.create(this, () => {
  3404. GameManager.Instance.videogetmoney -= 1;
  3405. GameUtils.GetMoney(awardmoney);
  3406. }), null);
  3407. }
  3408. });
  3409. WxApi.Message("暂未开放");
  3410. }
  3411. CloseW() {
  3412. WindowManager.Instance.ShowWindow(WindowType.HomeWindow);
  3413. }
  3414. OnShowRoleList() {
  3415. this.hatbg.visible = true;
  3416. this.cgbg.visible = true;
  3417. this.rolebg.visible = false;
  3418. this.renderList.array = this.herodatas;
  3419. this.renderList.renderHandler = Laya.Handler.create(this, this.OnRenderRoleList, null, false);
  3420. }
  3421. OnShowHatList() {
  3422. this.hatbg.visible = false;
  3423. this.cgbg.visible = true;
  3424. this.rolebg.visible = true;
  3425. this.renderList.array = this.hatDatas;
  3426. this.renderList.renderHandler = Laya.Handler.create(this, this.OnRenderHatList, null, false);
  3427. }
  3428. OnShowcbList() {
  3429. this.hatbg.visible = true;
  3430. this.cgbg.visible = false;
  3431. this.rolebg.visible = true;
  3432. this.renderList.array = this.cbDatas;
  3433. this.renderList.renderHandler = Laya.Handler.create(this, this.OnRenderCbList, null, false);
  3434. }
  3435. ReadyShow() {
  3436. this.showcarCamera = new Laya.Camera();
  3437. this.showScence.addChild(this.showcarCamera);
  3438. this.showlight = new Laya.DirectionLight();
  3439. this.showScence.addChild(this.showlight);
  3440. this.curstage = new Laya.Sprite3D();
  3441. this.showScence.addChild(this.curstage);
  3442. this.showcarCamera.viewport = new Laya.Viewport(this.carShowPan.x, this.carShowPan.y, this.carShowPan.width, this.carShowPan.height);
  3443. this.showcarCamera.clearFlag = 2;
  3444. this.showcarCamera.fieldOfView = 30;
  3445. this.showcarCamera.transform.position = new Laya.Vector3(0, 2, 3);
  3446. var playerid = Number(PlayerAccount.CurrentAccount.CurAccountData.GetUser(AccountUser.equip_hero));
  3447. this.TryToShowCar(playerid);
  3448. var hatid = Number(PlayerAccount.CurrentAccount.CurAccountData.GetUser(AccountUser.equip_hat));
  3449. if (hatid > 0)
  3450. this.TryToShowHat(hatid);
  3451. var cbid = Number(PlayerAccount.CurrentAccount.CurAccountData.GetUser(AccountUser.equip_dance));
  3452. if (cbid > 0)
  3453. this.TryToShowCb(cbid);
  3454. Laya.timer.frameLoop(1, this, this.ShowRot);
  3455. this.ChangeState(ShopState.role);
  3456. }
  3457. OnRenderRoleList(_cell, _index) {
  3458. var data = _cell.dataSource;
  3459. var btn = _cell.getChildByName("btn");
  3460. var tryBtn = _cell.getChildByName("tryBtn");
  3461. var roleicon = _cell.getChildByName("roleicon");
  3462. roleicon.visible = true;
  3463. var haticon = _cell.getChildByName("haticon");
  3464. haticon.visible = false;
  3465. var cbicon = _cell.getChildByName("cbicon");
  3466. cbicon.visible = false;
  3467. var bg = _cell.getChildByName("bg");
  3468. var type = data.require_type;
  3469. var num = data.require_num;
  3470. bg.skin = data.id == Number(PlayerAccount.CurrentAccount.CurAccountData.GetUser(AccountUser.equip_hero)) ? "shop/shangcheng_1_4_2.png" : "shop/shangcheng_1_4_1.png";
  3471. tryBtn.clickHandler = Laya.Handler.create(this, this.TryToShowCar, [data.id], false);
  3472. roleicon.skin = "shop/" + data.curicon + ".png";
  3473. btn.visible = true;
  3474. btn.clickHandler = null;
  3475. var box = btn.getChildAt(0);
  3476. box.visible = false;
  3477. var box2 = btn.getChildAt(1);
  3478. box2.visible = false;
  3479. var box3 = btn.getChildAt(2);
  3480. box3.visible = false;
  3481. var box4 = btn.getChildAt(3);
  3482. box4.visible = false;
  3483. if (PlayerAccount.CurrentAccount.CurAccountData.HasHero(data.id)) {
  3484. btn.visible = false;
  3485. return;
  3486. }
  3487. if (type == 2) {
  3488. box.visible = true;
  3489. var clip = box.getChildByName("clip");
  3490. clip.value = "x" + num;
  3491. btn.clickHandler = Laya.Handler.create(this, this.TryBuyHero, [data], false);
  3492. }
  3493. else if (type == 3) {
  3494. box2.visible = true;
  3495. var clip = box2.getChildByName("clip");
  3496. clip.value = PlayerAccount.CurrentAccount.CurAccountData.GetHeroProgress(data.id) + "/" + num;
  3497. btn.clickHandler = Laya.Handler.create(this, this.videoGetHero, [data.id], false);
  3498. }
  3499. else if (type == 4) {
  3500. box3.visible = true;
  3501. var clip = box3.getChildByName("clip");
  3502. clip.value = PlayerAccount.CurrentAccount.CurAccountData.GetHeroProgress(data.id) + "/" + num;
  3503. btn.clickHandler = Laya.Handler.create(this, this.ShareGetHero, [data.id], false);
  3504. }
  3505. else if (type == 6) {
  3506. box4.visible = true;
  3507. }
  3508. else {
  3509. btn.visible = false;
  3510. }
  3511. }
  3512. OnRenderHatList(_cell, _index) {
  3513. var data = _cell.dataSource;
  3514. var btn = _cell.getChildByName("btn");
  3515. var tryBtn = _cell.getChildByName("tryBtn");
  3516. var roleicon = _cell.getChildByName("roleicon");
  3517. roleicon.visible = false;
  3518. var haticon = _cell.getChildByName("haticon");
  3519. haticon.visible = true;
  3520. var cbicon = _cell.getChildByName("cbicon");
  3521. cbicon.visible = false;
  3522. var bg = _cell.getChildByName("bg");
  3523. var type = data.require_type;
  3524. var num = data.require_num;
  3525. bg.skin = data.id == Number(PlayerAccount.CurrentAccount.CurAccountData.GetUser(AccountUser.equip_hat)) ? "shop/shangcheng_1_4_2.png" : "shop/shangcheng_1_4_1.png";
  3526. tryBtn.clickHandler = Laya.Handler.create(this, this.TryToShowHat, [data.id], false);
  3527. haticon.skin = "shop/" + data.icon + ".png";
  3528. btn.visible = true;
  3529. btn.clickHandler = null;
  3530. var box = btn.getChildAt(0);
  3531. box.visible = false;
  3532. var box2 = btn.getChildAt(1);
  3533. box2.visible = false;
  3534. var box3 = btn.getChildAt(2);
  3535. box3.visible = false;
  3536. var box4 = btn.getChildAt(3);
  3537. box4.visible = false;
  3538. if (PlayerAccount.CurrentAccount.CurAccountData.HasHat(data.id)) {
  3539. btn.visible = false;
  3540. return;
  3541. }
  3542. if (type == 2) {
  3543. box.visible = true;
  3544. var clip = box.getChildByName("clip");
  3545. clip.value = "x" + num;
  3546. btn.clickHandler = Laya.Handler.create(this, this.TryBuyHat, [data], false);
  3547. }
  3548. else if (type == 3) {
  3549. box2.visible = true;
  3550. var clip = box2.getChildByName("clip");
  3551. clip.value = PlayerAccount.CurrentAccount.CurAccountData.GetHatProgress(data.id) + "/" + num;
  3552. btn.clickHandler = Laya.Handler.create(this, this.VideoGetHat, [data.id], false);
  3553. }
  3554. else if (type == 4) {
  3555. box3.visible = true;
  3556. var clip = box3.getChildByName("clip");
  3557. clip.value = PlayerAccount.CurrentAccount.CurAccountData.GetHatProgress(data.id) + "/" + num;
  3558. btn.clickHandler = Laya.Handler.create(this, this.ShareGetHat, [data.id], false);
  3559. }
  3560. else if (type == 6) {
  3561. box4.visible = true;
  3562. }
  3563. else {
  3564. btn.visible = false;
  3565. }
  3566. }
  3567. OnRenderCbList(_cell, _index) {
  3568. var data = _cell.dataSource;
  3569. var btn = _cell.getChildByName("btn");
  3570. var tryBtn = _cell.getChildByName("tryBtn");
  3571. var roleicon = _cell.getChildByName("roleicon");
  3572. roleicon.visible = false;
  3573. var haticon = _cell.getChildByName("haticon");
  3574. haticon.visible = false;
  3575. var cbicon = _cell.getChildByName("cbicon");
  3576. cbicon.visible = true;
  3577. var bg = _cell.getChildByName("bg");
  3578. var type = data.require_type;
  3579. var num = data.require_num;
  3580. bg.skin = data.id == Number(PlayerAccount.CurrentAccount.CurAccountData.GetUser(AccountUser.equip_dance)) ? "shop/shangcheng_1_4_2.png" : "shop/shangcheng_1_4_1.png";
  3581. tryBtn.clickHandler = Laya.Handler.create(this, this.TryToShowCb, [data.id], false);
  3582. cbicon.skin = "shop/" + data.icon + ".png";
  3583. btn.visible = true;
  3584. btn.clickHandler = null;
  3585. var box = btn.getChildAt(0);
  3586. box.visible = false;
  3587. var box2 = btn.getChildAt(1);
  3588. box2.visible = false;
  3589. var box3 = btn.getChildAt(2);
  3590. box3.visible = false;
  3591. var box4 = btn.getChildAt(3);
  3592. box4.visible = false;
  3593. if (PlayerAccount.CurrentAccount.CurAccountData.HasDane(data.id)) {
  3594. btn.visible = false;
  3595. return;
  3596. }
  3597. if (type == 2) {
  3598. box.visible = true;
  3599. var clip = box.getChildByName("clip");
  3600. clip.value = "x" + num;
  3601. btn.clickHandler = Laya.Handler.create(this, this.TryBuyCB, [data], false);
  3602. }
  3603. else if (type == 3) {
  3604. box2.visible = true;
  3605. var clip = box2.getChildByName("clip");
  3606. clip.value = PlayerAccount.CurrentAccount.CurAccountData.GetCbProgress(data.id) + "/" + num;
  3607. btn.clickHandler = Laya.Handler.create(this, this.videoGetCB, [data.id], false);
  3608. }
  3609. else if (type == 4) {
  3610. box3.visible = true;
  3611. var clip = box3.getChildByName("clip");
  3612. clip.value = PlayerAccount.CurrentAccount.CurAccountData.GetCbProgress(data.id) + "/" + num;
  3613. btn.clickHandler = Laya.Handler.create(this, this.ShareGetHat, [data.id], false);
  3614. }
  3615. else if (type == 6) {
  3616. box4.visible = true;
  3617. }
  3618. else {
  3619. btn.visible = false;
  3620. }
  3621. }
  3622. TryToShowCar(_carid) {
  3623. var asset = ResourcesManager.Instance.roleassets[_carid].getChildAt(0);
  3624. this.OnPlayerLoad(_carid, asset);
  3625. this.TryToShowHat(Number(PlayerAccount.CurrentAccount.CurAccountData.GetUser(AccountUser.equip_hat)));
  3626. this.TryToShowCb(Number(PlayerAccount.CurrentAccount.CurAccountData.GetUser(AccountUser.equip_hat)));
  3627. if (PlayerAccount.CurrentAccount.CurAccountData.HasHero(_carid)) {
  3628. this.TryEquipHero(_carid);
  3629. }
  3630. }
  3631. TryToShowHat(_id) {
  3632. if (_id == 0)
  3633. return;
  3634. var asset = ResourcesManager.Instance.hatasset[_id];
  3635. this.OnHatLoad(_id, asset);
  3636. if (PlayerAccount.CurrentAccount.CurAccountData.HasHat(_id)) {
  3637. this.TryEquipHat(_id);
  3638. }
  3639. }
  3640. TryToShowCb(_id) {
  3641. if (_id == 0)
  3642. return;
  3643. var asset = ResourcesManager.Instance.cbasset[_id];
  3644. this.onCbLoad(_id, asset);
  3645. if (PlayerAccount.CurrentAccount.CurAccountData.HasDane(_id)) {
  3646. this.TryEquipCB(_id);
  3647. }
  3648. }
  3649. TryEquipHero(_id) {
  3650. var agrs = [{ "id": _id.toString() }];
  3651. NetworkManager.Instance.HttpPostRequest(PROTOCOLS.EquipHero, agrs, Laya.Handler.create(this, () => {
  3652. Player.Instance.RessetPlayer();
  3653. this.InitData();
  3654. this.renderList.array = this.herodatas;
  3655. }), null);
  3656. }
  3657. TryEquipHat(_id) {
  3658. var agrs = [{ "id": _id.toString() }];
  3659. NetworkManager.Instance.HttpPostRequest(PROTOCOLS.EquipHat, agrs, Laya.Handler.create(this, () => {
  3660. Player.Instance.RessetPlayer();
  3661. this.InitData();
  3662. this.renderList.array = this.hatDatas;
  3663. }), null);
  3664. }
  3665. TryEquipCB(_id) {
  3666. var agrs = [{ "id": _id.toString() }];
  3667. NetworkManager.Instance.HttpPostRequest(PROTOCOLS.EquipDance, agrs, Laya.Handler.create(this, () => {
  3668. Player.Instance.RessetPlayer();
  3669. this.InitData();
  3670. this.renderList.array = this.hatDatas;
  3671. }), null);
  3672. }
  3673. TryBuyHero(_data) {
  3674. WxApi.Instance.recordAldEvent("商城界面:点击购买角色->" + _data.name, "1");
  3675. var money = Number(PlayerAccount.CurrentAccount.CurAccountData.GetUser(AccountUser.money));
  3676. if (money < _data.require_num) {
  3677. WxApi.Message("金币不足!");
  3678. return;
  3679. }
  3680. var agrs = [{ "id": _data.id.toString() }];
  3681. NetworkManager.Instance.HttpPostRequest(PROTOCOLS.BuyHero, agrs, Laya.Handler.create(this, () => {
  3682. WxApi.Instance.recordAldEvent("商城界面:成功购买角色->" + _data.name, "1");
  3683. this.TryToShowCar(_data.id);
  3684. }), null);
  3685. }
  3686. ShareGetHat(_id) {
  3687. WxApi.Instance.recordAldEvent("商城界面:点击分享获得帽子皮肤->" + _id, "1");
  3688. WxApi.shareImage("分享获得帽子", (flag) => {
  3689. if (flag) {
  3690. var agrs = [{ "id": _id.toString() }, { "channel": "share" }, { "t": PlayerAccount.CurrentAccount.ServerTime.toString() }];
  3691. NetworkManager.Instance.HttpPostRequest(PROTOCOLS.fissionhat, agrs, Laya.Handler.create(this, () => {
  3692. this.InitData();
  3693. this.renderList.array = this.hatDatas;
  3694. }), Laya.Handler.create(this, () => { }));
  3695. }
  3696. }, "1");
  3697. }
  3698. ShareGetCB(_id) {
  3699. WxApi.Instance.recordAldEvent("商城界面:点击分享获得翅膀皮肤->" + _id, "1");
  3700. WxApi.shareImage("分享获得翅膀", (flag) => {
  3701. if (flag) {
  3702. var agrs = [{ "id": _id.toString() }, { "channel": "share" }, { "t": PlayerAccount.CurrentAccount.ServerTime.toString() }];
  3703. NetworkManager.Instance.HttpPostRequest(PROTOCOLS.fissiondance, agrs, Laya.Handler.create(this, () => {
  3704. this.InitData();
  3705. this.renderList.array = this.hatDatas;
  3706. }), Laya.Handler.create(this, () => { }));
  3707. }
  3708. }, "1");
  3709. }
  3710. ShareGetHero(_id) {
  3711. WxApi.Instance.recordAldEvent("商城界面:点击分享获得角色皮肤->" + _id, "1");
  3712. WxApi.shareImage("分享获得英雄", (flag) => {
  3713. if (flag) {
  3714. var agrs = [{ "id": _id.toString() }, { "channel": "share" }, { "t": PlayerAccount.CurrentAccount.ServerTime.toString() }];
  3715. NetworkManager.Instance.HttpPostRequest(PROTOCOLS.fissionhero, agrs, Laya.Handler.create(this, () => {
  3716. this.InitData();
  3717. this.renderList.array = this.herodatas;
  3718. }), Laya.Handler.create(this, () => { }));
  3719. }
  3720. }, "1");
  3721. }
  3722. VideoGetHat(_id) {
  3723. WxApi.Instance.recordAldEvent("商城界面:点击看视频获得帽子皮肤", "1");
  3724. ADPlayer.showVideoAd((flag) => {
  3725. if (flag) {
  3726. var agrs = [{ "id": _id.toString() }, { "channel": "video" }, { "t": PlayerAccount.CurrentAccount.ServerTime.toString() }];
  3727. NetworkManager.Instance.HttpPostRequest(PROTOCOLS.fissionhat, agrs, Laya.Handler.create(this, () => {
  3728. this.InitData();
  3729. this.renderList.array = this.herodatas;
  3730. }), Laya.Handler.create(this, () => { }));
  3731. }
  3732. });
  3733. }
  3734. videoGetHero(_id) {
  3735. WxApi.Instance.recordAldEvent("商城界面:点击看视频获得角色皮肤", "1");
  3736. ADPlayer.showVideoAd((flag) => {
  3737. if (flag) {
  3738. var agrs = [{ "id": _id.toString() }, { "channel": "video" }, { "t": PlayerAccount.CurrentAccount.ServerTime.toString() }];
  3739. NetworkManager.Instance.HttpPostRequest(PROTOCOLS.fissionhero, agrs, Laya.Handler.create(this, () => {
  3740. this.InitData();
  3741. this.renderList.array = this.herodatas;
  3742. }), Laya.Handler.create(this, () => { }));
  3743. }
  3744. });
  3745. }
  3746. videoGetCB(_id) {
  3747. WxApi.Instance.recordAldEvent("商城界面:点击看视频获得翅膀皮肤", "1");
  3748. ADPlayer.showVideoAd((flag) => {
  3749. if (flag) {
  3750. var agrs = [{ "id": _id.toString() }, { "channel": "video" }, { "t": PlayerAccount.CurrentAccount.ServerTime.toString() }];
  3751. NetworkManager.Instance.HttpPostRequest(PROTOCOLS.fissiondance, agrs, Laya.Handler.create(this, () => {
  3752. this.InitData();
  3753. this.renderList.array = this.herodatas;
  3754. }), Laya.Handler.create(this, () => { }));
  3755. }
  3756. });
  3757. }
  3758. TryBuyHat(_data) {
  3759. WxApi.Instance.recordAldEvent("商城界面:点击购买帽子->" + _data.name, "1");
  3760. var money = Number(PlayerAccount.CurrentAccount.CurAccountData.GetUser(AccountUser.money));
  3761. if (money < _data.require_num) {
  3762. WxApi.Message("金币不足!");
  3763. return;
  3764. }
  3765. var agrs = [{ "id": _data.id.toString() }];
  3766. NetworkManager.Instance.HttpPostRequest(PROTOCOLS.BuyHat, agrs, Laya.Handler.create(this, () => {
  3767. this.TryToShowHat(_data.id);
  3768. }), null);
  3769. }
  3770. TryBuyCB(_data) {
  3771. WxApi.Instance.recordAldEvent("商城界面:点击购买翅膀->" + _data.name, "1");
  3772. var money = Number(PlayerAccount.CurrentAccount.CurAccountData.GetUser(AccountUser.money));
  3773. if (money < _data.require_num) {
  3774. WxApi.Message("金币不足!");
  3775. return;
  3776. }
  3777. var agrs = [{ "id": _data.id.toString() }];
  3778. NetworkManager.Instance.HttpPostRequest(PROTOCOLS.BuyDance, agrs, Laya.Handler.create(this, () => {
  3779. this.TryToShowCb(_data.id);
  3780. }), null);
  3781. }
  3782. OnPlayerLoad(_id, _model) {
  3783. if (this.curshowPlayer != null) {
  3784. if (this.curshowhat) {
  3785. this.curshowhat.active = false;
  3786. this.curshowhat.removeSelf();
  3787. }
  3788. if (this.curshowcb) {
  3789. this.curshowcb.active = false;
  3790. this.curshowcb.removeSelf();
  3791. }
  3792. PoolManager.Instance.RecoverMeshSprite3D(this.curshowPlayer);
  3793. }
  3794. var player = PoolManager.Instance.CreatMeshSprite3D(_model, "");
  3795. this.curshowPlayer = player;
  3796. this.curstage.addChild(player);
  3797. player.transform.localPosition = new Laya.Vector3(0, 0, 0);
  3798. var lookpos = new Laya.Vector3(player.transform.position.x, player.transform.position.y + 0.03, player.transform.position.z + 0.01);
  3799. this.showcarCamera.transform.lookAt(lookpos, new Laya.Vector3(0, 1, 0));
  3800. }
  3801. OnHatLoad(_id, _model) {
  3802. if (this.curshowhat != null) {
  3803. this.curshowhat.active = false;
  3804. }
  3805. var sprite;
  3806. if (this.showhatdic[_id]) {
  3807. sprite = this.showhatdic[_id];
  3808. sprite.active = true;
  3809. }
  3810. else {
  3811. sprite = PoolManager.Instance.CreatMeshSprite3D(_model, "");
  3812. this.showhatdic[_id] = sprite;
  3813. }
  3814. this.curshowhat = sprite;
  3815. this.AddHatToBody(sprite);
  3816. sprite.transform.localPosition = new Laya.Vector3(0.06, 0, 0);
  3817. sprite.transform.localRotationEuler = new Laya.Vector3(0, 90, 0);
  3818. }
  3819. onCbLoad(_id, _model) {
  3820. if (this.curshowcb != null) {
  3821. this.curshowcb.active = false;
  3822. }
  3823. var sprite;
  3824. if (this.showcbdic[_id]) {
  3825. sprite = this.showcbdic[_id];
  3826. sprite.active = true;
  3827. }
  3828. else {
  3829. sprite = PoolManager.Instance.CreatMeshSprite3D(_model, "");
  3830. this.showcbdic[_id] = sprite;
  3831. }
  3832. this.curshowcb = sprite;
  3833. this.AddCbToBody(sprite);
  3834. sprite.transform.localPosition = new Laya.Vector3(-0.06, -0.06, 0);
  3835. sprite.transform.localRotationEuler = new Laya.Vector3(-25, 90, 180);
  3836. }
  3837. AddHatToBody(sprite) {
  3838. var head = this.curshowPlayer.getChildAt(0).getChildAt(0);
  3839. head.addChild(sprite);
  3840. }
  3841. AddCbToBody(sprite) {
  3842. var back = this.curshowPlayer.getChildAt(0).getChildAt(1);
  3843. back.addChild(sprite);
  3844. }
  3845. ShowRot() {
  3846. this.curstage.transform.rotate(new Laya.Vector3(0, -0.01, 0));
  3847. }
  3848. OnHide() {
  3849. Laya.timer.clearAll(this);
  3850. for (var key in this.showhatdic) {
  3851. var hat = this.showhatdic[key];
  3852. hat.active = true;
  3853. PoolManager.Instance.RecoverMeshSprite3D(hat);
  3854. }
  3855. for (var key in this.showcbdic) {
  3856. var cb = this.showcbdic[key];
  3857. cb.active = true;
  3858. PoolManager.Instance.RecoverMeshSprite3D(cb);
  3859. }
  3860. PoolManager.Instance.RecoverMeshSprite3D(this.curshowPlayer);
  3861. this.showcarCamera.destroy();
  3862. this.showScence.destroy();
  3863. }
  3864. }
  3865. class QueueWindow extends ui.Window.QueueWindowUI {
  3866. constructor() {
  3867. super();
  3868. this.queueAtlas = [
  3869. "res/atlas/local.atlas",
  3870. "res/atlas/local.png",
  3871. "res/atlas/load.atlas",
  3872. "res/atlas/load.png",
  3873. ];
  3874. this.indess = [];
  3875. QueueWindow.instance = this;
  3876. }
  3877. static get Instance() {
  3878. return QueueWindow.instance;
  3879. }
  3880. OnOpen(_data = null) {
  3881. WxApi.Instance.recordAldEvent("进入排队界面", "1");
  3882. var agrs = [{ "t": PlayerAccount.CurrentAccount.ServerTime.toString() }, { "n": "5" }];
  3883. NetworkManager.Instance.HttpPostRequest(PROTOCOLS.game, agrs, Laya.Handler.create(this, this.OnStarcomplete), null);
  3884. this.height = Laya.stage.height;
  3885. }
  3886. OnResLoad() {
  3887. Laya.timer.once(1000, this, this.OnQueueEnd);
  3888. for (var i = 1; i < 30; i++) {
  3889. this.indess.push(i);
  3890. }
  3891. for (var i = 0; i < this.quelist.numChildren; i++) {
  3892. var cursprite = this.quelist.getChildAt(i);
  3893. this.ShowIcon(cursprite);
  3894. }
  3895. }
  3896. OnStarcomplete(e) {
  3897. this.OnResLoad();
  3898. }
  3899. ShowIcon(_sprite) {
  3900. var time = GameUtils.getRandomInt(0, 900);
  3901. Laya.timer.once(time, this, () => {
  3902. var index = GameUtils.getRandomInt(0, this.indess.length);
  3903. var num = this.indess[index];
  3904. this.indess.splice(index, 1);
  3905. _sprite.skin = "icon/" + num + ".png";
  3906. }, null, false);
  3907. }
  3908. OnQueueEnd() {
  3909. WxApi.Instance.recordAldEvent("排队结束开始游戏", "1");
  3910. var stage = LevelManager.Instance.curLevel;
  3911. WxApi.Instance.levelStart(stage.levelid.toString(), stage.levelid.toString(), PlayerAccount.CurrentAccount.CurAccountData.UseId);
  3912. GameManager.Instance.ChangeState(GameState.Playing);
  3913. }
  3914. OnHide() {
  3915. }
  3916. }
  3917. var SwitchButtonState;
  3918. (function (SwitchButtonState) {
  3919. SwitchButtonState[SwitchButtonState["Close"] = 0] = "Close";
  3920. SwitchButtonState[SwitchButtonState["Open"] = 1] = "Open";
  3921. })(SwitchButtonState || (SwitchButtonState = {}));
  3922. class SwitchButton extends Laya.Script {
  3923. constructor() {
  3924. super();
  3925. this.ButtonState = SwitchButtonState.Close;
  3926. }
  3927. onAwake() {
  3928. this.openSprite = this.owner.getChildByName("openSprite");
  3929. this.closeSprite = this.owner.getChildByName("closeSprite");
  3930. this.button = this.owner.getChildByName("button");
  3931. this.button.clickHandler = Laya.Handler.create(this, () => {
  3932. this.ChangeState(this.ButtonState);
  3933. this.ButtonState++;
  3934. if (this.ButtonState > 1) {
  3935. this.ButtonState = 0;
  3936. }
  3937. }, null, false);
  3938. }
  3939. Init(open = true, _openHandle = null, _closeHnadle = null) {
  3940. this.ButtonState = open ? SwitchButtonState.Open : SwitchButtonState.Close;
  3941. this.openHandle = _openHandle;
  3942. this.closeHandle = _closeHnadle;
  3943. this.ChangeState(this.ButtonState);
  3944. this.ButtonState++;
  3945. if (this.ButtonState > 1) {
  3946. this.ButtonState = 0;
  3947. }
  3948. }
  3949. get CurState() {
  3950. return this.ButtonState;
  3951. }
  3952. ChangeState(_state) {
  3953. switch (this.ButtonState) {
  3954. case SwitchButtonState.Close:
  3955. this.openSprite.visible = false;
  3956. this.closeSprite.visible = true;
  3957. this.closeHandle.run();
  3958. break;
  3959. case SwitchButtonState.Open:
  3960. this.openSprite.visible = true;
  3961. this.closeSprite.visible = false;
  3962. this.openHandle.run();
  3963. break;
  3964. }
  3965. }
  3966. }
  3967. class SettingWindow extends ui.Window.SettingWindowUI {
  3968. constructor() {
  3969. super();
  3970. SettingWindow.instance = this;
  3971. }
  3972. static get Instance() {
  3973. return SettingWindow.instance;
  3974. }
  3975. OnOpen(_data = null) {
  3976. this.userid.text = "用户ID:" + PlayerAccount.CurrentAccount.CurAccountData.GetUser(AccountUser.user_id);
  3977. this.closeBtn.clickHandler = Laya.Handler.create(this, this.OnCLickClose);
  3978. this.soundswitctbutton = this.soundPan.addComponent(SwitchButton);
  3979. this.shakeswitchbutton = this.shakePan.addComponent(SwitchButton);
  3980. this.soundswitctbutton.Init(PlaySoundManager.CanPlaySound, Laya.Handler.create(this, this.OnOpenSound, [true], false), Laya.Handler.create(this, this.OnOpenSound, [false], false));
  3981. this.shakeswitchbutton.Init(WxApi.CanShake, Laya.Handler.create(this, this.OnOpenShake, [true], false), Laya.Handler.create(this, this.OnOpenShake, [false], false));
  3982. ADPlayer.showBannerAd();
  3983. this.height = Laya.stage.height;
  3984. }
  3985. OnOpenSound(_open) {
  3986. PlaySoundManager.CanPlaySound = _open;
  3987. }
  3988. OnOpenShake(_open) {
  3989. WxApi.CanShake = _open;
  3990. }
  3991. OnCLickClose() {
  3992. WindowManager.Instance.ShowWindow(WindowType.HomeWindow);
  3993. }
  3994. OnHide() {
  3995. }
  3996. }
  3997. class ShareCanvas {
  3998. constructor() {
  3999. this.width = 0;
  4000. this.height = 0;
  4001. this.shareCanvas = Laya.Browser.window.sharedCanvas;
  4002. this.sprite = new Laya.Sprite();
  4003. this.sprite.zOrder = 1008;
  4004. this.sprite.pos(0, 0);
  4005. this.sprite.cacheAs = "normal";
  4006. Laya.stage.addChild(this.sprite);
  4007. this.t2d = new Laya.Texture2D();
  4008. this.tex = new Laya.Texture(this.t2d);
  4009. }
  4010. InitData(w = 720, h = 1559) {
  4011. this.width = Laya.stage.width;
  4012. this.height = Laya.stage.height;
  4013. this.shareCanvas.width = w;
  4014. this.shareCanvas.height = h;
  4015. }
  4016. show() {
  4017. Laya.timer.frameLoop(10, this, this.update);
  4018. this.sprite.visible = true;
  4019. }
  4020. hide() {
  4021. Laya.timer.clear(this, this.update);
  4022. this.sprite.visible = false;
  4023. }
  4024. update() {
  4025. this.drawWebgl();
  4026. }
  4027. drawWebgl() {
  4028. this.t2d.loadImageSource(this.shareCanvas);
  4029. this.tex.setTo(this.t2d);
  4030. this.sprite.graphics.clear();
  4031. this.sprite.graphics.drawTexture(this.tex, 0, 0, this.tex.width, this.tex.height);
  4032. }
  4033. draw2d() {
  4034. this.ctx.drawImage(this.shareCanvas, 0, 0, this.shareCanvas.width, this.shareCanvas.height);
  4035. }
  4036. }
  4037. class JionTool {
  4038. constructor() {
  4039. }
  4040. static Init() {
  4041. if (!Main.OnWx)
  4042. return;
  4043. this._wx = Laya.Browser.window.wx;
  4044. this.setWH();
  4045. this.shareCanvas = new ShareCanvas();
  4046. this.shareCanvas.InitData();
  4047. }
  4048. static showFriendRank(keyName = "score") {
  4049. if (Main.OnWx)
  4050. this.postMessage(keyName, "show_friend_rank");
  4051. }
  4052. static showWorldRank(keyName, data) {
  4053. if (Main.OnWx)
  4054. this.postMessage(keyName, "show_world_rank", data);
  4055. }
  4056. static upPage() {
  4057. if (Main.OnWx)
  4058. this.postMessage("", "show_up_page");
  4059. }
  4060. static nextPage() {
  4061. if (Main.OnWx)
  4062. this.postMessage("", "show_next_page");
  4063. }
  4064. static settlement(value, callBack = null, keyName = "score") {
  4065. if (Main.OnWx)
  4066. this.setUserCloudStorage(keyName, value.toString(), callBack);
  4067. }
  4068. static showShareCanvas() {
  4069. if (Main.OnWx)
  4070. this.shareCanvas.show();
  4071. }
  4072. static hideShareCanvas() {
  4073. if (Main.OnWx)
  4074. this.shareCanvas.hide();
  4075. }
  4076. static sendMoveDelta(delta) {
  4077. if (Main.OnWx)
  4078. this.postMessage("", "move_rank", delta);
  4079. }
  4080. static updateCtx() {
  4081. if (Main.OnWx)
  4082. this.postMessage("", "update_ctx");
  4083. }
  4084. static setWH() {
  4085. if (!Main.OnWx)
  4086. return;
  4087. let width = Laya.stage.width;
  4088. let height = Laya.stage.height;
  4089. let data = { width: width, height: height };
  4090. console.error(width, height);
  4091. this.postMessage("", "canvase_width_height", data);
  4092. }
  4093. static postMessage(keyName, action, data) {
  4094. this._wx.postMessage({
  4095. keyName: keyName,
  4096. action: action,
  4097. data: data
  4098. });
  4099. }
  4100. static setUserCloudStorage(keyName, value, callBack = null) {
  4101. let obj = [{
  4102. key: keyName,
  4103. value: value
  4104. }];
  4105. this._wx.setUserCloudStorage({
  4106. KVDataList: obj,
  4107. success: function (res) {
  4108. console.log("数据上传成功" + res);
  4109. if (callBack) {
  4110. callBack();
  4111. }
  4112. },
  4113. fail: function (res) {
  4114. console.log("数据上传失败" + res);
  4115. if (callBack) {
  4116. callBack();
  4117. }
  4118. }
  4119. });
  4120. }
  4121. }
  4122. class RankWindow extends ui.Window.RankWindowUI {
  4123. constructor() {
  4124. super();
  4125. RankWindow.instance = this;
  4126. }
  4127. static get Instance() {
  4128. return RankWindow.instance;
  4129. }
  4130. OnOpen(_data = null) {
  4131. console.log("排行榜界面打开了----");
  4132. JionTool.showShareCanvas();
  4133. JionTool.showFriendRank("stage");
  4134. this.closeBtn.clickHandler = Laya.Handler.create(this, this.OnCloseRank);
  4135. this.uppageBtn.clickHandler = Laya.Handler.create(this, this.OnUpPage, null, false);
  4136. this.nextpageBtn.clickHandler = Laya.Handler.create(this, this.OnNextPage, null, false);
  4137. this.height = Laya.stage.height;
  4138. }
  4139. OnUpPage() {
  4140. JionTool.upPage();
  4141. }
  4142. OnNextPage() {
  4143. JionTool.nextPage();
  4144. }
  4145. OnCloseRank() {
  4146. JionTool.hideShareCanvas();
  4147. WindowManager.Instance.ShowWindow(WindowType.HomeWindow);
  4148. }
  4149. OnHide() {
  4150. }
  4151. }
  4152. class FriendPlyaingWindow extends ui.Window.FriendPlayingWindowUI {
  4153. constructor() {
  4154. super();
  4155. this.return = 0;
  4156. FriendPlyaingWindow.instance = this;
  4157. }
  4158. OnOpen() {
  4159. this.CloseBtn.clickHandler = Laya.Handler.create(this, this.OnClickClose);
  4160. this.GameList.vScrollBarSkin = "";
  4161. this.GameList.array = PlayerAccount.CurrentAccount.CurAccountData.redata;
  4162. this.GameList.renderHandler = Laya.Handler.create(this, this.RenderList, null, false);
  4163. this.height = Laya.stage.height;
  4164. }
  4165. ;
  4166. RenderList(_box, index) {
  4167. if (index > 5) {
  4168. var ne = _box.getChildAt(0).getChildByName("new");
  4169. ne.visible = false;
  4170. }
  4171. var data = _box.dataSource;
  4172. var icon = _box.getChildAt(0).getChildByName("icon");
  4173. icon.skin = data.icon;
  4174. var name = _box.getChildAt(0).getChildByName("name");
  4175. name.text = data.title;
  4176. var btn = _box.getChildAt(0).getChildByName("btn");
  4177. var num = _box.getChildAt(0).getChildByName("num");
  4178. if (num)
  4179. num.text = GameUtils.getRandomInt(24841, 654878).toString() + "人玩";
  4180. btn.clickHandler = Laya.Handler.create(this, this.ClickBNavigate, [data], false);
  4181. }
  4182. ClickBNavigate(data) {
  4183. var appid = data.appid;
  4184. var path = data.path;
  4185. let param = { "appId": appid.toString(), "path": path.toString() };
  4186. if (Main.OnWx) {
  4187. WxApi.Instance.recordAldEvent("导出-总点击数", "1");
  4188. if (data.jump) {
  4189. Laya.Browser.window.wx.navigateToMiniProgram({
  4190. appId: appid.toString(),
  4191. path: path.toString(),
  4192. extraData: {
  4193. next_appid: data.next_appid,
  4194. next_path: data.next_path
  4195. },
  4196. envVersion: 'develop',
  4197. success: res => {
  4198. WxApi.Instance.recordAldEvent("导出成功-总用户数", "1");
  4199. WxApi.Instance.recordAldEvent("导出成功-" + data.title, "1");
  4200. console.log("跳转成功...");
  4201. },
  4202. fail: res => {
  4203. WindowManager.Instance.OpenPopView(WindowType.RecommendWindow);
  4204. RecommendWindow.Instance.OpenChouTiView(true);
  4205. RecommendWindow.Instance.closeCt.clickHandler = Laya.Handler.create(this, () => {
  4206. WindowManager.Instance.ShowWindow(WindowType.HomeWindow);
  4207. });
  4208. console.log("跳转失败...");
  4209. }
  4210. });
  4211. }
  4212. else {
  4213. var marray = [data.image];
  4214. Laya.Browser.window.wx.previewImage({
  4215. current: data.image,
  4216. urls: marray,
  4217. success: res => {
  4218. WxApi.Instance.recordAldEvent("显示游戏二维码成功", "1");
  4219. },
  4220. fail: res => {
  4221. }
  4222. });
  4223. }
  4224. }
  4225. }
  4226. OnClickClose() {
  4227. WindowManager.Instance.ShowWindow(WindowType.HomeWindow);
  4228. }
  4229. OnHide() {
  4230. }
  4231. ;
  4232. }
  4233. class MoreFunWindow extends ui.Window.MoreFunWindowUI {
  4234. constructor() { super(); MoreFunWindow.instance = this; }
  4235. OnOpen() {
  4236. this.CloseBtn.clickHandler = Laya.Handler.create(this, this.OnCloseClick);
  4237. this.GameList.array = PlayerAccount.CurrentAccount.CurAccountData.redata;
  4238. this.GameList.renderHandler = Laya.Handler.create(this, this.RenderList, null, false);
  4239. this.height = Laya.stage.height;
  4240. }
  4241. ;
  4242. OnCloseClick() {
  4243. WindowManager.Instance.ShowWindow(WindowType.HomeWindow);
  4244. }
  4245. RenderList(_box, index) {
  4246. var data = _box.dataSource;
  4247. var icon = _box.getChildAt(0).getChildByName("icon");
  4248. icon.skin = data.icon;
  4249. var name = _box.getChildAt(0).getChildByName("name");
  4250. name.text = data.title;
  4251. var btn = _box.getChildAt(0).getChildByName("btn");
  4252. var num = _box.getChildAt(0).getChildByName("num");
  4253. if (num)
  4254. num.text = GameUtils.getRandomInt(100000, 1000000).toString() + "人玩";
  4255. btn.clickHandler = Laya.Handler.create(this, this.ClickBNavigate, [data], false);
  4256. }
  4257. ClickBNavigate(data) {
  4258. var appid = data.appid;
  4259. var path = data.path;
  4260. let param = { "appId": appid.toString(), "path": path.toString() };
  4261. if (Main.OnWx) {
  4262. WxApi.Instance.recordAldEvent("导出-总点击数", "1");
  4263. if (data.jump) {
  4264. Laya.Browser.window.wx.navigateToMiniProgram({
  4265. appId: appid.toString(),
  4266. path: path.toString(),
  4267. extraData: {
  4268. next_appid: data.next_appid,
  4269. next_path: data.next_path
  4270. },
  4271. envVersion: 'develop',
  4272. success: res => {
  4273. WxApi.Instance.recordAldEvent("导出成功-总用户数", "1");
  4274. WxApi.Instance.recordAldEvent("导出成功-" + data.title, "1");
  4275. console.log("跳转成功...");
  4276. },
  4277. fail: res => {
  4278. WindowManager.Instance.OpenPopView(WindowType.RecommendWindow);
  4279. RecommendWindow.Instance.OpenChouTiView(true);
  4280. RecommendWindow.Instance.closeCt.clickHandler = Laya.Handler.create(this, () => {
  4281. WindowManager.Instance.ShowWindow(WindowType.HomeWindow);
  4282. });
  4283. console.log("跳转失败...");
  4284. }
  4285. });
  4286. }
  4287. else {
  4288. var marray = [data.image];
  4289. Laya.Browser.window.wx.previewImage({
  4290. current: data.image,
  4291. urls: marray,
  4292. success: res => {
  4293. WxApi.Instance.recordAldEvent("显示游戏二维码成功", "1");
  4294. },
  4295. fail: res => {
  4296. }
  4297. });
  4298. }
  4299. }
  4300. }
  4301. OnHide() {
  4302. }
  4303. ;
  4304. }
  4305. var WindowType;
  4306. (function (WindowType) {
  4307. WindowType[WindowType["HomeWindow"] = 0] = "HomeWindow";
  4308. WindowType[WindowType["InGameWindow"] = 1] = "InGameWindow";
  4309. WindowType[WindowType["SettlementWindow"] = 2] = "SettlementWindow";
  4310. WindowType[WindowType["ReviveWindow"] = 3] = "ReviveWindow";
  4311. WindowType[WindowType["ShopWindow"] = 4] = "ShopWindow";
  4312. WindowType[WindowType["QueueWindow"] = 5] = "QueueWindow";
  4313. WindowType[WindowType["SettingWindow"] = 6] = "SettingWindow";
  4314. WindowType[WindowType["RankWindow"] = 7] = "RankWindow";
  4315. WindowType[WindowType["SignWindow"] = 8] = "SignWindow";
  4316. WindowType[WindowType["TaskWindow"] = 9] = "TaskWindow";
  4317. WindowType[WindowType["RecommendWindow"] = 10] = "RecommendWindow";
  4318. WindowType[WindowType["TrialWindow"] = 11] = "TrialWindow";
  4319. WindowType[WindowType["FriendPlayingWindow"] = 12] = "FriendPlayingWindow";
  4320. WindowType[WindowType["MoreFunWindow"] = 13] = "MoreFunWindow";
  4321. WindowType[WindowType["OffLineWindow"] = 14] = "OffLineWindow";
  4322. })(WindowType || (WindowType = {}));
  4323. class WindowManager {
  4324. constructor() {
  4325. this.ViewDic = [];
  4326. this.popViewDic = [];
  4327. this.viewCont = new Laya.Sprite;
  4328. this.popCont = new Laya.Sprite;
  4329. WindowManager.WindowManagerInstance = this;
  4330. this.Init();
  4331. }
  4332. static get Instance() {
  4333. if (WindowManager.WindowManagerInstance) {
  4334. return WindowManager.WindowManagerInstance;
  4335. }
  4336. else {
  4337. return new WindowManager();
  4338. }
  4339. }
  4340. Init() {
  4341. this.ViewDic[WindowType.HomeWindow] = HomeWindow;
  4342. this.ViewDic[WindowType.InGameWindow] = InGameWindow;
  4343. this.ViewDic[WindowType.SettlementWindow] = SettlementWindow;
  4344. this.ViewDic[WindowType.ReviveWindow] = ReviveWindow;
  4345. this.ViewDic[WindowType.ShopWindow] = ShopWindow;
  4346. this.ViewDic[WindowType.QueueWindow] = QueueWindow;
  4347. this.ViewDic[WindowType.SettingWindow] = SettingWindow;
  4348. this.ViewDic[WindowType.RankWindow] = RankWindow;
  4349. this.ViewDic[WindowType.SignWindow] = SignWindow;
  4350. this.ViewDic[WindowType.RecommendWindow] = RecommendWindow;
  4351. this.ViewDic[WindowType.TrialWindow] = TrialWindow;
  4352. this.ViewDic[WindowType.FriendPlayingWindow] = FriendPlyaingWindow;
  4353. this.ViewDic[WindowType.MoreFunWindow] = MoreFunWindow;
  4354. this.ViewDic[WindowType.OffLineWindow] = OffLineWindow;
  4355. Laya.stage.addChild(this.viewCont);
  4356. Laya.stage.addChild(this.popCont);
  4357. }
  4358. ShowWindow(_type) {
  4359. if (this.curOpenedView != null) {
  4360. this.curOpenedView.OnHide();
  4361. this.curOpenedView.destroy();
  4362. this.curOpenedView.removeSelf();
  4363. }
  4364. ADPlayer.ClearBanner();
  4365. this.ClearPopViews();
  4366. this.curOpenedView = new this.ViewDic[_type];
  4367. this.curOpenedView.name = WindowType[_type];
  4368. this.viewCont.addChild(this.curOpenedView);
  4369. this.curOpenedView.OnOpen();
  4370. }
  4371. ShowWindowWithData(_type, _data) {
  4372. if (this.curOpenedView != null) {
  4373. this.curOpenedView.OnHide();
  4374. this.curOpenedView.destroy();
  4375. this.curOpenedView.removeSelf();
  4376. }
  4377. ADPlayer.ClearBanner();
  4378. this.ClearPopViews();
  4379. this.curOpenedView = new this.ViewDic[_type];
  4380. this.curOpenedView.name = WindowType[_type];
  4381. this.viewCont.addChild(this.curOpenedView);
  4382. this.curOpenedView.OnOpen(_data);
  4383. }
  4384. OpenPopView(viewType, data = null) {
  4385. ADPlayer.ClearBanner();
  4386. var popView;
  4387. if (this.popViewDic[viewType]) {
  4388. popView = this.popViewDic[viewType];
  4389. this.popCont.setChildIndex(popView, this.popCont.numChildren - 1);
  4390. popView.visible = true;
  4391. }
  4392. else {
  4393. popView = new this.ViewDic[viewType];
  4394. this.popCont.addChild(popView);
  4395. this.popViewDic[viewType] = popView;
  4396. }
  4397. popView.OnOpen(data);
  4398. }
  4399. ClosePopView(viewType) {
  4400. var popView = this.popViewDic[viewType];
  4401. if (popView == null) {
  4402. return;
  4403. }
  4404. ADPlayer.ClearBanner();
  4405. popView.OnHide();
  4406. popView.visible = false;
  4407. }
  4408. CloseCurrentWindow() {
  4409. this.curOpenedView.OnHide();
  4410. this.curOpenedView.destroy();
  4411. this.curOpenedView.removeSelf();
  4412. }
  4413. ClearPopViews() {
  4414. ADPlayer.ClearBanner();
  4415. this.ClosePopView(WindowType.RecommendWindow);
  4416. this.ClosePopView(WindowType.OffLineWindow);
  4417. }
  4418. }
  4419. var Vector3$5 = Laya.Vector3;
  4420. var Vector4$1 = Laya.Vector4;
  4421. class AImanager {
  4422. constructor() {
  4423. this.m_aiNum = 5;
  4424. this.m_aiList = [];
  4425. this.randombodycolor = [
  4426. new Vector4$1(0.25, 0.5, 1, 1),
  4427. new Vector4$1(0.5, 0.25, 1, 1),
  4428. new Vector4$1(1, 0.25, 1, 1),
  4429. new Vector4$1(1, 0.25, 0.5, 1),
  4430. ];
  4431. AImanager.instance = this;
  4432. }
  4433. static get Instance() {
  4434. if (AImanager.instance) {
  4435. return AImanager.instance;
  4436. }
  4437. else {
  4438. return new AImanager();
  4439. }
  4440. }
  4441. CreatAi() {
  4442. var level = LevelManager.Instance.curLevel;
  4443. for (var i = 0; i < this.m_aiNum; i++) {
  4444. var res = ResourcesManager.Instance.roleassets;
  4445. var spr = res[GameUtils.getRandomInt(1, 6)].getChildAt(0);
  4446. var model = PoolManager.Instance.CreatMeshSprite3D(spr, "");
  4447. ScenceManager.Instance.GameScence.addChild(model);
  4448. var startpoint = new Vector3$5(-1.4 + (i * 0.7), 0, 13);
  4449. model.transform.position = startpoint;
  4450. var runner = model.addComponent(Runner);
  4451. runner.Ai = true;
  4452. runner.m_speed = GameUtils.getRandoms(-0.03, 0.02) + level.npcspeed;
  4453. runner.aioffestx = GameUtils.getRandoms(-0.001, 0.001);
  4454. runner.Id = i;
  4455. runner.name = "草莓" + (runner.Id + 1) + "号";
  4456. runner.aimiss = level.NPCmiss;
  4457. this.m_aiList.push(runner);
  4458. Queue.Instance.signup(runner);
  4459. }
  4460. }
  4461. ClearAis() {
  4462. for (var i = 0; i < this.m_aiList.length; i++) {
  4463. if (this.m_aiList[i].m_sprite.active) {
  4464. this.m_aiList[i].m_flySprite.active = true;
  4465. this.m_aiList[i].m_crown.active = true;
  4466. PoolManager.Instance.RecoverMeshSprite3D(this.m_aiList[i].m_crown);
  4467. PoolManager.Instance.RecoverMeshSprite3D(this.m_aiList[i].m_flySprite);
  4468. PoolManager.Instance.RecoverMeshSprite3D(this.m_aiList[i].m_sprite);
  4469. }
  4470. }
  4471. this.m_aiList = [];
  4472. }
  4473. RessetAis() {
  4474. this.ClearAis();
  4475. this.CreatAi();
  4476. }
  4477. }
  4478. var GameState;
  4479. (function (GameState) {
  4480. GameState[GameState["Nono"] = 0] = "Nono";
  4481. GameState[GameState["Idle"] = 1] = "Idle";
  4482. GameState[GameState["Queue"] = 2] = "Queue";
  4483. GameState[GameState["Playing"] = 3] = "Playing";
  4484. GameState[GameState["Die"] = 4] = "Die";
  4485. GameState[GameState["Revive"] = 5] = "Revive";
  4486. GameState[GameState["Win"] = 6] = "Win";
  4487. GameState[GameState["Over"] = 7] = "Over";
  4488. GameState[GameState["End"] = 8] = "End";
  4489. })(GameState || (GameState = {}));
  4490. class GameManager {
  4491. constructor() {
  4492. this.GetGoin = false;
  4493. this.gamegold = 0;
  4494. this.videogetmoney = 3;
  4495. GameManager.Instance = this;
  4496. this.RegEvent();
  4497. this.ChangeState(GameState.Nono);
  4498. }
  4499. RegEvent() {
  4500. EventManager.GameStateEventOn(GameState.Nono, this, this.OnFristReadyGame);
  4501. EventManager.GameStateEventOn(GameState.Idle, this, this.OnEnterIdle);
  4502. EventManager.GameStateEventOn(GameState.Queue, this, this.OnEnterQueue);
  4503. EventManager.GameStateEventOn(GameState.Playing, this, this.OnEnterPlaying);
  4504. EventManager.GameStateEventOn(GameState.Die, this, this.OnEnterDie);
  4505. EventManager.GameStateEventOn(GameState.Revive, this, this.OnEnterRevive);
  4506. EventManager.GameStateEventOn(GameState.Win, this, this.OnEnterWin);
  4507. EventManager.GameStateEventOn(GameState.Over, this, this.OnEnterOver);
  4508. EventManager.GameStateEventOn(GameState.End, this, this.OnEnterEnd);
  4509. EventManager.EventOn(EventType.GetMoney, this, this.OnGetMoney);
  4510. }
  4511. ChangeState(_state, arges = null) {
  4512. if (this.curState != _state) {
  4513. this.curState = _state;
  4514. EventManager.GameStateEventTrigger(_state, arges);
  4515. console.log("GameState:" + GameState[_state]);
  4516. }
  4517. else {
  4518. console.log("Can not ChangeState:State is curstate...");
  4519. }
  4520. }
  4521. OnFristReadyGame() {
  4522. WxApi.Instance.recordAldEvent("初始资源", "");
  4523. ResourcesManager.Instance.InitSkinAsset();
  4524. var curstage = Number(PlayerAccount.CurrentAccount.CurAccountData.GetUser(AccountUser.stage));
  4525. LevelManager.Instance.ReadyLevel(curstage + 1, () => {
  4526. ScenceManager.Instance.GameScence.visible = true;
  4527. ScenceManager.Instance.CreatLevelScene(true);
  4528. WindowManager.Instance.ShowWindow(WindowType.HomeWindow);
  4529. WxApi.Instance.recordAldEvent("关卡展开", "");
  4530. });
  4531. }
  4532. OnEnterIdle() {
  4533. var camera = ScenceManager.Instance.GameCamera;
  4534. var pos = camera.transform.position.clone();
  4535. Player.CanInput = false;
  4536. this.gamegold = 0;
  4537. ScenceManager.Instance.GameCamera.transform.position = new Laya.Vector3(camera.transform.position.x, camera.transform.position.y, camera.transform.position.z - 4);
  4538. GameUtils.TweenMove(ScenceManager.Instance.GameCamera.transform, pos, 0.3);
  4539. }
  4540. OnEnterQueue() {
  4541. WindowManager.Instance.ShowWindow(WindowType.QueueWindow);
  4542. }
  4543. OnEnterPlaying() {
  4544. Player.CanInput = true;
  4545. WindowManager.Instance.ShowWindow(WindowType.InGameWindow);
  4546. }
  4547. OnEnterDie() {
  4548. }
  4549. OnEnterRevive() {
  4550. WindowManager.Instance.ShowWindow(WindowType.ReviveWindow);
  4551. }
  4552. OnEnterWin() {
  4553. }
  4554. OnEnterOver() {
  4555. }
  4556. OnEnterEnd(_win) {
  4557. CameraManager.Instance.StopFollow();
  4558. WindowManager.Instance.ShowWindowWithData(WindowType.SettlementWindow, _win);
  4559. }
  4560. OnGetMoney() {
  4561. this.gamegold += 1;
  4562. EventManager.EventTrigger(EventType.MoneyChange, this.gamegold);
  4563. }
  4564. ReviveGame() {
  4565. Player.Instance.RevivePlayer();
  4566. WindowManager.Instance.ShowWindow(WindowType.InGameWindow);
  4567. }
  4568. RessetGame() {
  4569. ScenceManager.Instance.GameLight.transform.rotationEuler = new Laya.Vector3(-50, -150, 0);
  4570. Player.Instance.RessetPlayer();
  4571. AImanager.Instance.RessetAis();
  4572. LevelManager.Instance.RessetLevel();
  4573. GameManager.Instance.ChangeState(GameState.Idle);
  4574. }
  4575. EnterNextLevel() {
  4576. ScenceManager.Instance.GameLight.transform.rotationEuler = new Laya.Vector3(-50, -150, 0);
  4577. Player.Instance.ClearPlayer();
  4578. AImanager.Instance.ClearAis();
  4579. LevelManager.Instance.ClearLevel();
  4580. LevelManager.Instance.NextLevel();
  4581. }
  4582. }
  4583. var EventType;
  4584. (function (EventType) {
  4585. EventType[EventType["ScoreChange"] = 0] = "ScoreChange";
  4586. EventType[EventType["MoneyChange"] = 1] = "MoneyChange";
  4587. EventType[EventType["GetMoney"] = 2] = "GetMoney";
  4588. EventType[EventType["InputState"] = 3] = "InputState";
  4589. EventType[EventType["Hover"] = 4] = "Hover";
  4590. EventType[EventType["extraspeedtime"] = 5] = "extraspeedtime";
  4591. EventType[EventType["speed"] = 6] = "speed";
  4592. EventType[EventType["flytime"] = 7] = "flytime";
  4593. EventType[EventType["OnLand"] = 8] = "OnLand";
  4594. EventType[EventType["OutLand"] = 9] = "OutLand";
  4595. EventType[EventType["ChangeStage"] = 10] = "ChangeStage";
  4596. EventType[EventType["GetRoadPoint"] = 11] = "GetRoadPoint";
  4597. EventType[EventType["EnterStage"] = 12] = "EnterStage";
  4598. EventType[EventType["CompleteStage"] = 13] = "CompleteStage";
  4599. EventType[EventType["crownchange"] = 14] = "crownchange";
  4600. EventType[EventType["PlayerRank"] = 15] = "PlayerRank";
  4601. })(EventType || (EventType = {}));
  4602. class EventManager {
  4603. static EventOn(_type, caller, _listance) {
  4604. this.mDispatcher.on(EventType[_type], caller, _listance);
  4605. }
  4606. static EventOff(_type, caller, _listance) {
  4607. this.mDispatcher.off(EventType[_type], caller, _listance);
  4608. }
  4609. static EventTrigger(_type, data = null) {
  4610. this.mDispatcher.event(EventType[_type], data);
  4611. }
  4612. static GameStateEventOn(_type, caller, _listance) {
  4613. this.mDispatcher.on(GameState[_type], caller, _listance);
  4614. }
  4615. static GameStateEventOff(_type, caller, _listance) {
  4616. this.mDispatcher.off(GameState[_type], caller, _listance);
  4617. }
  4618. static GameStateEventTrigger(_type, data = null) {
  4619. this.mDispatcher.event(GameState[_type], data);
  4620. }
  4621. }
  4622. EventManager.mDispatcher = new Laya.EventDispatcher();
  4623. var Sprite3D$1 = Laya.Sprite3D;
  4624. class MeshSprite3DData {
  4625. constructor(_sprite) {
  4626. this.ownSprite = _sprite;
  4627. this.position = _sprite.transform.position.clone();
  4628. this.rotation = _sprite.transform.rotation.clone();
  4629. this.scale = _sprite.transform.scale.clone();
  4630. }
  4631. }
  4632. class PoolManager {
  4633. constructor() {
  4634. this.PoolSize = 30;
  4635. this.ObjDic = {};
  4636. PoolManager.PoolManagerInstance = this;
  4637. EventManager.GameStateEventOn(GameState.Idle, this, this.ClearPool);
  4638. }
  4639. static get Instance() {
  4640. if (PoolManager.PoolManagerInstance) {
  4641. return PoolManager.PoolManagerInstance;
  4642. }
  4643. else {
  4644. var instance = new PoolManager();
  4645. return instance;
  4646. }
  4647. }
  4648. CreatMeshSprite3D(_obj, _group) {
  4649. var objName = _group + _obj.name;
  4650. if (this.ObjDic[objName] != null && this.ObjDic[objName] != undefined) {
  4651. if (this.ObjDic[objName].length > 0) {
  4652. var obj = this.ObjDic[objName][0];
  4653. this.ObjDic[objName].splice(0, 1);
  4654. if (obj.ownSprite.destroyed) {
  4655. obj.ownSprite = Sprite3D$1.instantiate(_obj);
  4656. }
  4657. obj.ownSprite.active = true;
  4658. obj.ownSprite.transform.position = _obj.transform.position.clone();
  4659. obj.ownSprite.transform.rotation = _obj.transform.rotation.clone();
  4660. obj.ownSprite.transform.scale = _obj.transform.scale.clone();
  4661. return obj.ownSprite;
  4662. }
  4663. else {
  4664. return Sprite3D$1.instantiate(_obj);
  4665. }
  4666. }
  4667. else {
  4668. return Sprite3D$1.instantiate(_obj);
  4669. }
  4670. }
  4671. RecoverMeshSprite3D(_obj, _group = "", _destory = false) {
  4672. if (!_obj) {
  4673. return;
  4674. }
  4675. if (_destory) {
  4676. _obj.destroy();
  4677. return;
  4678. }
  4679. if (_obj.destroyed) {
  4680. return;
  4681. }
  4682. if (_obj.active == false) {
  4683. return;
  4684. }
  4685. var objName = _group + _obj.name;
  4686. if (this.ObjDic[objName] != null && this.ObjDic[objName] != undefined) {
  4687. var array = this.ObjDic[objName];
  4688. if (array.length > this.PoolSize) {
  4689. _obj.destroy();
  4690. return;
  4691. }
  4692. else {
  4693. array.push(new MeshSprite3DData(_obj));
  4694. }
  4695. }
  4696. else {
  4697. array = [];
  4698. array.push(new MeshSprite3DData(_obj));
  4699. this.ObjDic[objName] = array;
  4700. }
  4701. var runner = _obj.getComponent(Runner);
  4702. if (runner)
  4703. runner.destroy();
  4704. var rig = _obj.getComponent(Laya.Rigidbody3D);
  4705. if (rig) {
  4706. rig.isKinematic = true;
  4707. rig.detectCollisions = false;
  4708. }
  4709. _obj.transform.position = new Laya.Vector3(0, 0, -100);
  4710. _obj.removeSelf();
  4711. _obj.active = false;
  4712. }
  4713. ClearPool() {
  4714. for (var key in this.ObjDic) {
  4715. var objs = this.ObjDic[key];
  4716. for (var i = 0; i < objs.length; i++) {
  4717. objs[i].ownSprite.destroy();
  4718. }
  4719. }
  4720. this.ObjDic = {};
  4721. }
  4722. }
  4723. var Vector3$6 = Laya.Vector3;
  4724. var Sprite3D$2 = Laya.Sprite3D;
  4725. var Vector4$2 = Laya.Vector4;
  4726. class Road {
  4727. constructor(_id, _data, _offestY, _offestZ, _parent, _textureid, _roadcolor) {
  4728. this.things = [];
  4729. this.builds = [];
  4730. this.jumpHight = 0;
  4731. this.id = _id;
  4732. this.parent = _parent;
  4733. var roadpos = new Vector3$6(3.6 - (_id * 1.8), _offestY - _data.high_change, _offestZ);
  4734. this.Long = _data.long;
  4735. this.CreatModel(_data.long * RunnerRoad.lengthrate, roadpos, _textureid, _roadcolor);
  4736. this.CreateThings(_data.things, _data.position, _data.thing_hight, roadpos);
  4737. }
  4738. CreatModel(_size, _pos, _texture, __roadcolor) {
  4739. this.startpos = _pos;
  4740. if (_size != 0) {
  4741. var sprite = PoolManager.Instance.CreatMeshSprite3D(ResourcesManager.Instance.bsroadassets[baseroaddata.ZhiRoad], "");
  4742. this.sprite = sprite;
  4743. this.sprite.transform.position = _pos;
  4744. var meshchild = sprite.getChildAt(0).getChildAt(0).getChildAt(0);
  4745. var materail = meshchild.meshRenderer.material;
  4746. var tes = ResourcesManager.Instance.planetextures;
  4747. materail.albedoTexture = tes[_texture];
  4748. var colors = ScenceManager.randomcolor;
  4749. materail.albedoColor = colors[__roadcolor - 1];
  4750. FixedRoad.ForNodeSetColliderInThis(this.sprite, ColliderLay.Plane);
  4751. this.sprite.transform.localScaleZ = _size;
  4752. this.parent.addChild(this.sprite);
  4753. }
  4754. }
  4755. CreateThings(_things, _poss, _hights, _pos) {
  4756. for (var i = 0; i < _things.length; i++) {
  4757. var curposZ = Number(_poss[i]);
  4758. var curpos = new Vector3$6(_pos.x, _pos.y, _pos.z + curposZ - 1);
  4759. var res = ResourcesManager.Instance.tsroadassets;
  4760. if (id == thingsdata.PlateTrampoline) {
  4761. var highchange = _hights.length == _poss.length ? _hights[i] : 0;
  4762. curpos = new Vector3$6(curpos.x, curpos.y - highchange, curpos.z);
  4763. if (this.jumpHight < _hights[i])
  4764. this.jumpHight = _hights[i];
  4765. }
  4766. var id = _things[i].id;
  4767. if (id == 0 || !res[id])
  4768. continue;
  4769. if ((this.id == thingsdata.Box || this.id == thingsdata.Box1 || this.id == thingsdata.Box2)) {
  4770. var things = Sprite3D$2.instantiate(ResourcesManager.Instance.tsroadassets[this.id]);
  4771. var box = things.getChildByName("Box").getComponent(Laya.PhysicsCollider);
  4772. box.collisionGroup = ColliderLay.things;
  4773. }
  4774. else {
  4775. var things = PoolManager.Instance.CreatMeshSprite3D(res[id], "");
  4776. FixedRoad.ForNodeSetColliderInThis(things, ColliderLay.things);
  4777. }
  4778. var thing = new roadthings(_things[i].id.toString());
  4779. thing.buffertime = _things[i].buffertime;
  4780. thing.effect = _things[i].effect;
  4781. thing.model = _things[i].model;
  4782. thing.pos = curpos;
  4783. thing.type = _things[i].type;
  4784. thing.sprite = things;
  4785. thing.length = curposZ;
  4786. this.things.push(thing);
  4787. things.transform.position = curpos;
  4788. ScenceManager.Instance.GameScence.addChild(things);
  4789. }
  4790. }
  4791. Resset() {
  4792. var things = this.things;
  4793. for (var k = 0; k < things.length; k++) {
  4794. var thing = things[k];
  4795. thing.Resset();
  4796. }
  4797. }
  4798. Clear() {
  4799. if (this.sprite) {
  4800. this.sprite.active = true;
  4801. PoolManager.Instance.RecoverMeshSprite3D(this.sprite);
  4802. }
  4803. var things = this.things;
  4804. for (var k = 0; k < things.length; k++) {
  4805. var thing = things[k];
  4806. thing.Clear();
  4807. }
  4808. }
  4809. SetActive(_open) {
  4810. if (this.sprite) {
  4811. this.sprite.active = _open;
  4812. }
  4813. var things = this.things;
  4814. for (var k = 0; k < things.length; k++) {
  4815. var thing = things[k];
  4816. thing.sprite.active = _open;
  4817. }
  4818. }
  4819. }
  4820. class FixedRoad {
  4821. constructor(_id, _pos = new Vector3$6(0, 0, 0), _parent = null) {
  4822. this.id = _id;
  4823. var sprite = PoolManager.Instance.CreatMeshSprite3D(ResourcesManager.Instance.fxroadassets[_id], "");
  4824. this.sprite = sprite;
  4825. this.sprite.transform.position = _pos;
  4826. if (sprite.getChildByName("endpoint"))
  4827. this.endSprite = sprite.getChildByName("endpoint");
  4828. FixedRoad.ForNodeSetColliderInThis(this.sprite, ColliderLay.Plane);
  4829. if (_parent) {
  4830. _parent.addChild(this.sprite);
  4831. }
  4832. else {
  4833. ScenceManager.Instance.GameScence.addChild(this.sprite);
  4834. }
  4835. }
  4836. static ForNodeSetColliderInThis(_node, lay) {
  4837. var childNumber = _node.numChildren;
  4838. for (var i = 0; i < childNumber; i++) {
  4839. var eChildNumber = _node.getChildAt(i).numChildren;
  4840. if (eChildNumber > 0) {
  4841. this.ForNodeSetColliderInThis(_node.getChildAt(i), lay);
  4842. }
  4843. var PhysicsCollider = _node.getChildAt(i).getComponent(Laya.PhysicsCollider);
  4844. if (PhysicsCollider) {
  4845. this.SetCollider(PhysicsCollider, lay);
  4846. }
  4847. }
  4848. }
  4849. static SetCollider(Collider, _lay) {
  4850. Collider.collisionGroup = _lay;
  4851. }
  4852. }
  4853. class ScenceManager {
  4854. constructor(_scence) {
  4855. this.LevelRoads = [];
  4856. this.starthideindex = 1;
  4857. this.buildsnum = 10;
  4858. this.hightnum = 2;
  4859. ScenceManager.Instance = this;
  4860. this.GameScence = _scence;
  4861. this.GameScence.physicsSimulation.maxSubSteps = 15;
  4862. this.GameScence.physicsSimulation.fixedTimeStep = 1 / 60;
  4863. this.GameScence.enableFog = true;
  4864. this.GameScence.fogStart = 25;
  4865. this.GameScence.fogRange = 35;
  4866. this.GameScence.fogColor = new Vector3$6(0.5803922, 0.8431373, 1);
  4867. this.Init();
  4868. }
  4869. Init() {
  4870. this.GameCamera = this.GameScence.getChildByName("Main Camera");
  4871. this.GameCamera.transform.position = new Vector3$6(0, 0.6, 8.5);
  4872. this.GameCamera.transform.rotationEuler = new Vector3$6(-5, 180, 0);
  4873. this.GameCamera.clearColor = new Vector4$2(0.5803922, 0.8431373, 1, 1);
  4874. this.GameLight = this.GameScence.getChildByName("Directional Light");
  4875. this.GameCamera.addComponent(CameraManager);
  4876. var startroad = this.GameScence.getChildByName("PlateStart");
  4877. FixedRoad.ForNodeSetColliderInThis(startroad, ColliderLay.Plane);
  4878. var FalconMesh = this.GameScence.getChildByName("FalconMesh");
  4879. ResourcesManager.Instance.FalconMesh = FalconMesh;
  4880. FalconMesh.removeSelf();
  4881. var crown = this.GameScence.getChildByName("crown");
  4882. ResourcesManager.Instance.crown = crown;
  4883. crown.removeSelf();
  4884. }
  4885. CreatLevelScene(_frist = false) {
  4886. ScenceManager.Instance.GameLight.transform.rotationEuler = new Laya.Vector3(-50, -150, 0);
  4887. var level = LevelManager.Instance.curLevel;
  4888. this.CreatLevelRoads(level);
  4889. this.CreatPlayer(level, _frist);
  4890. AImanager.Instance.CreatAi();
  4891. GameManager.Instance.ChangeState(GameState.Idle);
  4892. }
  4893. CreatLevelRoads(_level) {
  4894. var curY = -5.5;
  4895. var rd1pos = new Vector3$6(0, curY, 20);
  4896. _level.ramproad = new FixedRoad(fixedroaddata.Ramps, rd1pos);
  4897. var startpos = _level.ramproad.endSprite.transform.position;
  4898. var offesthight = startpos.y - 6;
  4899. for (var i = 0; i < _level.stages.length; i++) {
  4900. var stagedata = _level.stages[i];
  4901. offesthight -= stagedata.StageHight;
  4902. if ((i - 1) > -1) {
  4903. var sss = _level.stages[i - 1].stagejumphight;
  4904. offesthight -= sss;
  4905. }
  4906. var offestz = 0;
  4907. var maxlength = 0;
  4908. var maxhight = 0;
  4909. stagedata.sprite = new Sprite3D$2();
  4910. stagedata.sprite.name = "stagesprite" + i;
  4911. ScenceManager.Instance.GameScence.addChild(stagedata.sprite);
  4912. var longs = 0;
  4913. for (var j = 0; j < stagedata.roadsdata.length; j++) {
  4914. var start = stagedata.roadsdata[j].start;
  4915. offestz = startpos.z + start;
  4916. var road = new Road(j, stagedata.roadsdata[j], offesthight, offestz, stagedata.sprite, _level.pic, _level.colour);
  4917. stagedata.roads.push(road);
  4918. if (road.jumpHight > stagedata.stagejumphight)
  4919. stagedata.stagejumphight = road.jumpHight;
  4920. if (i > 1) {
  4921. road.SetActive(false);
  4922. }
  4923. var thingsLength = road.things.length > 0 ? road.things[road.things.length - 1].length : 0;
  4924. longs = stagedata.roadsdata[j].long == 0 ? thingsLength : stagedata.roadsdata[j].long;
  4925. if (offestz + longs > maxlength)
  4926. maxlength = offestz + longs;
  4927. if (offesthight - (stagedata.roadsdata[j].high_change + road.jumpHight) < maxhight)
  4928. maxhight = offesthight - (stagedata.roadsdata[j].high_change + road.jumpHight);
  4929. }
  4930. stagedata.startz = offestz;
  4931. stagedata.endz = maxlength;
  4932. stagedata.starty = offesthight;
  4933. stagedata.endy = maxhight;
  4934. startpos = new Vector3$6(0, maxhight, maxlength);
  4935. this.CreatBuilds(stagedata);
  4936. }
  4937. _level.getRoadPoint();
  4938. var endpos = new Vector3$6(0, startpos.y - 5.5, startpos.z + 2);
  4939. var endroad = new FixedRoad(fixedroaddata.PlateFinish, endpos);
  4940. _level.endroadsprite = endroad.sprite;
  4941. var wincollider = endroad.sprite.getChildByName("Win").getComponent(Laya.PhysicsCollider);
  4942. wincollider.collisionGroup = ColliderLay.things;
  4943. _level.endroadsprite.active = false;
  4944. }
  4945. SortRoad(a, b) {
  4946. if (a.Long > b.Long) {
  4947. return -1;
  4948. }
  4949. else {
  4950. return 1;
  4951. }
  4952. }
  4953. CreatPlayer(_level, _frist) {
  4954. var playerid = Number(PlayerAccount.CurrentAccount.CurAccountData.GetUser(AccountUser.equip_hero));
  4955. var player = ResourcesManager.Instance.roleassets[playerid].getChildAt(0);
  4956. var playermodel = PoolManager.Instance.CreatMeshSprite3D(player, "");
  4957. var startpoint = new Vector3$6(0, 0, 10);
  4958. playermodel.transform.position = startpoint;
  4959. var hatid = Number(PlayerAccount.CurrentAccount.CurAccountData.GetUser(AccountUser.equip_hat));
  4960. if (hatid > 0) {
  4961. var hat = ResourcesManager.Instance.hatasset[hatid];
  4962. var hatmodel = PoolManager.Instance.CreatMeshSprite3D(hat, "");
  4963. var head = playermodel.getChildAt(0).getChildAt(0);
  4964. head.addChild(hatmodel);
  4965. hatmodel.transform.localPosition = new Laya.Vector3(0.1, 0, 0);
  4966. hatmodel.transform.localRotationEuler = new Laya.Vector3(0, 90, 0);
  4967. }
  4968. var cbid = Number(PlayerAccount.CurrentAccount.CurAccountData.GetUser(AccountUser.equip_hat));
  4969. if (cbid > 0) {
  4970. var cb = ResourcesManager.Instance.cbasset[cbid];
  4971. var cbmodel = PoolManager.Instance.CreatMeshSprite3D(cb, "");
  4972. var back = playermodel.getChildAt(0).getChildAt(1);
  4973. back.addChild(cbmodel);
  4974. cbmodel.transform.localPosition = new Laya.Vector3(-0.06, -0.06, 0);
  4975. cbmodel.transform.localRotationEuler = new Laya.Vector3(-25, 90, 180);
  4976. }
  4977. this.GameScence.addChild(playermodel);
  4978. if (_frist) {
  4979. new Player(playermodel);
  4980. }
  4981. else {
  4982. Player.Instance.Reset(playermodel);
  4983. }
  4984. }
  4985. CreatBuilds(_stage) {
  4986. var offestz = 0;
  4987. var offestY = 0;
  4988. var offesthight = _stage.endy - 30;
  4989. var length = _stage.endz - _stage.startz;
  4990. var hight = 0;
  4991. this.buildsnum = 1;
  4992. var level = LevelManager.Instance.curLevel;
  4993. for (var i = 0; i < this.buildsnum; i++) {
  4994. offestz += (length / this.buildsnum);
  4995. offestY = hight;
  4996. var build = PoolManager.Instance.CreatMeshSprite3D(ResourcesManager.Instance.buildsassets[level.buildid], "");
  4997. var pos = new Vector3$6(12, offesthight - offestY, _stage.startz + offestz);
  4998. build.transform.position = pos;
  4999. ScenceManager.Instance.GameScence.addChild(build);
  5000. _stage.builds.push(build);
  5001. var build2 = PoolManager.Instance.CreatMeshSprite3D(ResourcesManager.Instance.buildsassets[level.buildid], "");
  5002. var pos = new Vector3$6(-12, offesthight - offestY, _stage.startz + offestz);
  5003. build2.transform.position = pos;
  5004. ScenceManager.Instance.GameScence.addChild(build2);
  5005. _stage.builds.push(build2);
  5006. if (i > 0) {
  5007. build.active = false;
  5008. build2.active = false;
  5009. }
  5010. }
  5011. }
  5012. }
  5013. ScenceManager.randomcolor = [
  5014. new Vector4$2(145 * 1.0 / 255, 1, 101 * 1.0 / 255, 1),
  5015. new Vector4$2(162 * 1.0 / 255, 56 * 1.0 / 255, 1, 1),
  5016. new Vector4$2(1, 150 * 1.0 / 255, 38 * 1.0 / 255, 1),
  5017. ];
  5018. class LevelManager {
  5019. constructor() {
  5020. LevelManager.test = false;
  5021. LevelManager.instance = this;
  5022. LevelManager.thingsdic = LevelManager.GetThingsConfigs;
  5023. LevelManager.roaddic = LevelManager.GetRoadConfigs;
  5024. LevelManager.testleveldic = LevelManager.GetLevelConfigs;
  5025. }
  5026. static get Instance() {
  5027. if (LevelManager.instance) {
  5028. return LevelManager.instance;
  5029. }
  5030. else {
  5031. return new LevelManager();
  5032. }
  5033. }
  5034. ReadyLevel(_id, _complete) {
  5035. this.curLevel = LevelManager.testleveldic[_id] ? LevelManager.testleveldic[_id] : LevelManager.testleveldic[1];
  5036. _complete();
  5037. }
  5038. NextLevel() {
  5039. var id = this.curLevel.levelid + 1;
  5040. this.ReadyLevel(id, () => {
  5041. ScenceManager.Instance.CreatLevelScene(false);
  5042. });
  5043. }
  5044. static get GetLevelConfigs() {
  5045. var leveldatas = {};
  5046. var levels = LevelManager.test ? ConfigTest.mission : PlayerAccount.CurrentAccount.CurAccountData.GetConfig(AccountConfig.mission);
  5047. for (var key in levels) {
  5048. var config = levels[key];
  5049. var level = new Level(config.id, config.roads);
  5050. level.pic = Number(config.pic);
  5051. level.colour = Number(config.pic);
  5052. level.NPCmiss = Number(config.NPCmiss) / 100;
  5053. level.npcspeed = config.NpcSpeed ? Number(config.NpcSpeed) : 1;
  5054. level.playerspeed = config.PlayerSpeed ? Number(config.PlayerSpeed) : 1;
  5055. leveldatas[config.id] = level;
  5056. }
  5057. return leveldatas;
  5058. }
  5059. static get GetRoadConfigs() {
  5060. var roaddatas = {};
  5061. var roads = LevelManager.test ? ConfigTest.road : PlayerAccount.CurrentAccount.CurAccountData.GetConfig(AccountConfig.road);
  5062. for (var key in roads) {
  5063. var roadss = [];
  5064. if (roaddatas[roads[key].road_id])
  5065. continue;
  5066. for (var key1 in roads) {
  5067. if (roads[key].road_id == roads[key1].road_id) {
  5068. var config = roads[key1];
  5069. var road = new RunnerRoad(config.road_id);
  5070. road.high = (Number(config.high) < 0) ? 0 : Number(config.high);
  5071. road.high = road.high == 0 ? 0.5 : road.high;
  5072. road.start = Number(config.start);
  5073. road.street = Number(config.street);
  5074. road.high_change = Number(config.high_change);
  5075. road.long = (Number(config.long) < 0) ? 0 : Number(config.long);
  5076. road.things = road.GetThings(config.things);
  5077. road.position = road.GetPos(config.position);
  5078. road.thing_hight = road.GetTings_Hight(config.things_high);
  5079. roadss.push(road);
  5080. }
  5081. }
  5082. roaddatas[config.road_id] = roadss;
  5083. }
  5084. return roaddatas;
  5085. }
  5086. static get GetThingsConfigs() {
  5087. var thingsdatas = {};
  5088. var thingss = LevelManager.test ? ConfigTest.things : PlayerAccount.CurrentAccount.CurAccountData.GetConfig(AccountConfig.things);
  5089. for (var key in thingss) {
  5090. var config = thingss[key];
  5091. var thing = new roadthings(config.id);
  5092. thing.type = Number(config.type);
  5093. thing.model = config.model;
  5094. thing.effect = Number(config.effect);
  5095. thing.buffertime = Number(config.bufftime);
  5096. thingsdatas[config.id] = thing;
  5097. }
  5098. return thingsdatas;
  5099. }
  5100. RessetLevel() {
  5101. this.curLevel.endroadsprite.active = false;
  5102. var levelstages = this.curLevel.stages;
  5103. for (var i = 0; i < levelstages.length; i++) {
  5104. var roads = levelstages[i].roads;
  5105. for (var j = 0; j < roads.length; j++) {
  5106. roads[j].Resset();
  5107. }
  5108. levelstages[i].enter = false;
  5109. levelstages[i].complete = false;
  5110. if (i < 2) {
  5111. var roads22 = levelstages[i].roads;
  5112. for (var k = 0; k < roads22.length; k++) {
  5113. var rr = roads22[k];
  5114. rr.SetActive(true);
  5115. }
  5116. var builds22 = levelstages[i].builds;
  5117. for (var k = 0; k < builds22.length; k++) {
  5118. var bb = builds22[k];
  5119. bb.active = true;
  5120. }
  5121. }
  5122. else {
  5123. var roads22 = levelstages[i].roads;
  5124. for (var k = 0; k < roads22.length; k++) {
  5125. var rr = roads22[k];
  5126. rr.SetActive(false);
  5127. }
  5128. var builds22 = levelstages[i].builds;
  5129. for (var k = 0; k < builds22.length; k++) {
  5130. var bb = builds22[k];
  5131. bb.active = false;
  5132. }
  5133. }
  5134. }
  5135. var wincollider = this.curLevel.endroadsprite.getChildByName("Win").getComponent(Laya.PhysicsCollider);
  5136. wincollider.collisionGroup = ColliderLay.things;
  5137. }
  5138. ClearLevel() {
  5139. PoolManager.Instance.RecoverMeshSprite3D(this.curLevel.ramproad.sprite, "");
  5140. PoolManager.Instance.RecoverMeshSprite3D(this.curLevel.endroadsprite, "");
  5141. var levelstages = this.curLevel.stages;
  5142. for (var i = 0; i < levelstages.length; i++) {
  5143. var roads = levelstages[i].roads;
  5144. for (var j = 0; j < roads.length; j++) {
  5145. roads[j].Clear();
  5146. }
  5147. var builds22 = levelstages[i].builds;
  5148. for (var k = 0; k < builds22.length; k++) {
  5149. var bb = builds22[k];
  5150. bb.active = true;
  5151. PoolManager.Instance.RecoverMeshSprite3D(bb);
  5152. }
  5153. levelstages[i].sprite.destroy();
  5154. }
  5155. }
  5156. }
  5157. LevelManager.test = false;
  5158. LevelManager.testleveldic = {};
  5159. LevelManager.roaddic = {};
  5160. LevelManager.thingsdic = {};
  5161. var Sprite3D$3 = Laya.Sprite3D;
  5162. class HeroData {
  5163. constructor(_id) {
  5164. this.id = _id;
  5165. }
  5166. }
  5167. class HatData {
  5168. constructor(_id) {
  5169. this.id = _id;
  5170. }
  5171. }
  5172. class roadthings {
  5173. constructor(_id) {
  5174. this.pos = new Laya.Vector3();
  5175. this.id = Number(_id);
  5176. }
  5177. Resset() {
  5178. var oldsp = this.sprite;
  5179. if (!oldsp)
  5180. return;
  5181. if (this.id == thingsdata.Box || this.id == thingsdata.Box1 || this.id == thingsdata.Box2) {
  5182. var ns = Sprite3D$3.instantiate(ResourcesManager.Instance.tsroadassets[this.id]);
  5183. ns.transform.position = this.pos;
  5184. this.sprite = ns;
  5185. var box = ns.getChildByName("Box").getComponent(Laya.PhysicsCollider);
  5186. box.collisionGroup = ColliderLay.things;
  5187. ScenceManager.Instance.GameScence.addChild(ns);
  5188. if (!oldsp.destroyed)
  5189. oldsp.destroy();
  5190. }
  5191. else if (this.id == thingsdata.Coin) {
  5192. this.sprite.active = true;
  5193. }
  5194. }
  5195. Clear() {
  5196. if ((this.id == thingsdata.Box || this.id == thingsdata.Box1 || this.id == thingsdata.Box2) && !this.sprite.destroyed) {
  5197. this.sprite.destroy();
  5198. return;
  5199. }
  5200. if (this.sprite) {
  5201. this.sprite.active = true;
  5202. PoolManager.Instance.RecoverMeshSprite3D(this.sprite);
  5203. }
  5204. }
  5205. static ForNodeSetColliderenbel(_node) {
  5206. if (_node == null) {
  5207. return;
  5208. }
  5209. _node.active = true;
  5210. var childNumber = _node.numChildren;
  5211. for (var i = 0; i < childNumber; i++) {
  5212. var eChildNumber = _node.getChildAt(i).numChildren;
  5213. if (eChildNumber > 0) {
  5214. this.ForNodeSetColliderenbel(_node.getChildAt(i));
  5215. }
  5216. var PhysicsCollider = _node.getChildAt(i).getComponent(Laya.PhysicsCollider);
  5217. if (PhysicsCollider && PhysicsCollider.collisionGroup == ColliderLay.things) {
  5218. PhysicsCollider.enabled = true;
  5219. }
  5220. }
  5221. }
  5222. }
  5223. class Stage {
  5224. constructor(_id, _roads) {
  5225. this.roadsdata = [];
  5226. this.roads = [];
  5227. this.roadpointxs = [];
  5228. this.complete = false;
  5229. this.enter = false;
  5230. this.builds = [];
  5231. this.stagejumphight = 0;
  5232. this.id = Number(_id);
  5233. this.roadsdata = _roads;
  5234. }
  5235. get StageHight() {
  5236. var max = 0;
  5237. for (var i = 0; i < this.roadsdata.length; i++) {
  5238. if (this.roadsdata[i].high > max) {
  5239. max = this.roadsdata[i].high;
  5240. }
  5241. }
  5242. return max;
  5243. }
  5244. }
  5245. class RunnerRoad {
  5246. constructor(_id) {
  5247. this.things = [];
  5248. this.position = [];
  5249. this.thing_hight = [];
  5250. this.id = Number(_id);
  5251. }
  5252. GetThings(_str) {
  5253. var thingss = [];
  5254. var datas = _str.split(";");
  5255. for (var i = 0; i < datas.length; i++) {
  5256. if (datas[i] != "-1" && LevelManager.thingsdic[datas[i]]) {
  5257. var things = LevelManager.thingsdic[datas[i]];
  5258. }
  5259. else {
  5260. var things = new roadthings("-1");
  5261. }
  5262. thingss.push(things);
  5263. }
  5264. return thingss;
  5265. }
  5266. GetPos(_str) {
  5267. var poss = [];
  5268. var datas = _str.split(";");
  5269. for (var i = 0; i < datas.length; i++) {
  5270. poss.push(datas[i]);
  5271. }
  5272. return poss;
  5273. }
  5274. GetTings_Hight(_str) {
  5275. var hight = [];
  5276. var datas = _str.split(";");
  5277. for (var i = 0; i < datas.length; i++) {
  5278. hight.push(Number(datas[i]));
  5279. }
  5280. return hight;
  5281. }
  5282. }
  5283. RunnerRoad.lengthrate = 1.6;
  5284. class Level {
  5285. constructor(_id, _roads) {
  5286. this.stages = [];
  5287. this.npcspeed = 1;
  5288. this.playerspeed = 1;
  5289. this.levelid = Number(_id);
  5290. this.stages = this.getStages(_roads);
  5291. this.buildid = GameUtils.getRandomInt(0, 2);
  5292. }
  5293. getStages(_st) {
  5294. var stages = [];
  5295. var datas = _st.split(";");
  5296. for (var i = 0; i < datas.length; i++) {
  5297. var road = LevelManager.roaddic[datas[i]];
  5298. var stage = new Stage(datas[i], road);
  5299. stages.push(stage);
  5300. }
  5301. return stages;
  5302. }
  5303. getRoadPoint() {
  5304. for (var i = 0; i < this.stages.length; i++) {
  5305. var point = [];
  5306. var stage = this.stages[i];
  5307. for (var j = 0; j < stage.roads.length; j++) {
  5308. if (stage.roads[j].sprite) {
  5309. point.push(stage.roads[j].sprite.transform.position.x);
  5310. }
  5311. if (!stage.roads[j].sprite && stage.roads[j].things.length > 0) {
  5312. point.push(stage.roads[j].things[0].sprite.transform.position.x);
  5313. }
  5314. }
  5315. if (point.length != 0) {
  5316. stage.roadpointxs = point;
  5317. }
  5318. else {
  5319. stage.roadpointxs = [0];
  5320. }
  5321. }
  5322. for (var i = 0; i < this.stages.length; i++) {
  5323. var ps = [];
  5324. var stage = this.stages[i];
  5325. var points = stage.roadpointxs;
  5326. if (i + 1 > this.stages.length - 1) {
  5327. for (var j = 0; j < points.length; j++) {
  5328. ps.push(points[j]);
  5329. }
  5330. stage.roadpointxs = ps;
  5331. return;
  5332. }
  5333. var nextpoints = this.stages[i + 1].roadpointxs;
  5334. for (var k = 0; k < nextpoints.length; k++) {
  5335. var has = false;
  5336. for (var j = 0; j < points.length; j++) {
  5337. if (points[j] == nextpoints[k]) {
  5338. ps.push(points[j]);
  5339. has = true;
  5340. }
  5341. }
  5342. if (nextpoints.length == 1 && !has && ps.length == 0) {
  5343. ps.push(nextpoints[k]);
  5344. }
  5345. }
  5346. stage.roadpointxs = ps;
  5347. }
  5348. }
  5349. }
  5350. var HttpRequest$1 = Laya.HttpRequest;
  5351. class ReData {
  5352. constructor(_obj) {
  5353. this.appid = _obj["appid"];
  5354. this.banner = _obj["banner"];
  5355. this.icon = _obj["icon"];
  5356. this.image = _obj["image"];
  5357. this.jump = _obj["jump"];
  5358. this.next_appid = _obj["next_appid"];
  5359. this.next_icon = _obj["next_icon"];
  5360. this.next_path = _obj["next_path"];
  5361. this.next_title = _obj["next_title"];
  5362. this.path = _obj["path"];
  5363. this.pos = _obj["pos"];
  5364. this.sort = _obj["sort"];
  5365. this.title = _obj["title"];
  5366. }
  5367. }
  5368. class ThingsEffect {
  5369. constructor(_data) {
  5370. for (var key in _data) {
  5371. var ccc = _data[key];
  5372. if (ccc.type == "1") {
  5373. ThingsEffect.rockettime = ccc.bufftime;
  5374. ThingsEffect.rocketeffect = ccc.effect;
  5375. }
  5376. else if (ccc.type == "2") {
  5377. ThingsEffect.Jstime = ccc.bufftime;
  5378. ThingsEffect.JSEffect = ccc.effect;
  5379. }
  5380. else if (ccc.type == "7") {
  5381. ThingsEffect.jumptime = ccc.bufftime == 0 ? 1 : ccc.bufftime;
  5382. ThingsEffect.jumpeffect = ccc.effect;
  5383. }
  5384. else if (ccc.type == "3") {
  5385. ThingsEffect.flytime = ccc.bufftime;
  5386. ThingsEffect.flyeffect = ccc.effect;
  5387. }
  5388. else if (ccc.type == "4") {
  5389. ThingsEffect.goldeffect = ccc.effect;
  5390. }
  5391. }
  5392. }
  5393. }
  5394. ThingsEffect.Jstime = 0;
  5395. ThingsEffect.JSEffect = 0;
  5396. ThingsEffect.rockettime = 1;
  5397. ThingsEffect.rocketeffect = 1.5;
  5398. ThingsEffect.jumptime = 0.1;
  5399. ThingsEffect.jumpeffect = 0.3;
  5400. ThingsEffect.flytime = 4.5;
  5401. ThingsEffect.flyeffect = 2;
  5402. ThingsEffect.goldeffect = 1;
  5403. var requiretype;
  5404. (function (requiretype) {
  5405. requiretype[requiretype["\u7CFB\u7EDF\u8D60\u9001"] = 1] = "\u7CFB\u7EDF\u8D60\u9001";
  5406. requiretype[requiretype["\u91D1\u5E01\u8D2D\u4E70"] = 2] = "\u91D1\u5E01\u8D2D\u4E70";
  5407. requiretype[requiretype["\u89C2\u770B\u89C6\u9891"] = 3] = "\u89C2\u770B\u89C6\u9891";
  5408. requiretype[requiretype["\u5206\u4EAB"] = 4] = "\u5206\u4EAB";
  5409. requiretype[requiretype["\u7B7E\u5230"] = 5] = "\u7B7E\u5230";
  5410. requiretype[requiretype["\u6D3B\u52A8"] = 6] = "\u6D3B\u52A8";
  5411. requiretype[requiretype["\u901A\u8FC7\u5173\u5361"] = 7] = "\u901A\u8FC7\u5173\u5361";
  5412. requiretype[requiretype["\u7D2F\u8BA1\u767B\u9646"] = 8] = "\u7D2F\u8BA1\u767B\u9646";
  5413. requiretype[requiretype["\u9080\u8BF7\u4EBA\u6570\u8FBE\u5230"] = 9] = "\u9080\u8BF7\u4EBA\u6570\u8FBE\u5230";
  5414. requiretype[requiretype["\u7816\u77F3\u8D2D\u4E70"] = 10] = "\u7816\u77F3\u8D2D\u4E70";
  5415. })(requiretype || (requiretype = {}));
  5416. var AccountConfig;
  5417. (function (AccountConfig) {
  5418. AccountConfig[AccountConfig["hero"] = 0] = "hero";
  5419. AccountConfig[AccountConfig["hat"] = 1] = "hat";
  5420. AccountConfig[AccountConfig["wing"] = 2] = "wing";
  5421. AccountConfig[AccountConfig["things"] = 3] = "things";
  5422. AccountConfig[AccountConfig["road"] = 4] = "road";
  5423. AccountConfig[AccountConfig["global"] = 5] = "global";
  5424. AccountConfig[AccountConfig["entity"] = 6] = "entity";
  5425. AccountConfig[AccountConfig["sign"] = 7] = "sign";
  5426. AccountConfig[AccountConfig["rewards"] = 8] = "rewards";
  5427. AccountConfig[AccountConfig["achievement"] = 9] = "achievement";
  5428. AccountConfig[AccountConfig["invite"] = 10] = "invite";
  5429. AccountConfig[AccountConfig["mission"] = 11] = "mission";
  5430. AccountConfig[AccountConfig["treasure_click"] = 12] = "treasure_click";
  5431. })(AccountConfig || (AccountConfig = {}));
  5432. var AccountUser;
  5433. (function (AccountUser) {
  5434. AccountUser[AccountUser["money"] = 0] = "money";
  5435. AccountUser[AccountUser["diamond"] = 1] = "diamond";
  5436. AccountUser[AccountUser["user_id"] = 2] = "user_id";
  5437. AccountUser[AccountUser["game_times"] = 3] = "game_times";
  5438. AccountUser[AccountUser["get_hats"] = 4] = "get_hats";
  5439. AccountUser[AccountUser["get_heroes"] = 5] = "get_heroes";
  5440. AccountUser[AccountUser["get_dances"] = 6] = "get_dances";
  5441. AccountUser[AccountUser["video_times"] = 7] = "video_times";
  5442. AccountUser[AccountUser["equip_hat"] = 8] = "equip_hat";
  5443. AccountUser[AccountUser["equip_dance"] = 9] = "equip_dance";
  5444. AccountUser[AccountUser["equip_hero"] = 10] = "equip_hero";
  5445. AccountUser[AccountUser["last_action_time"] = 11] = "last_action_time";
  5446. AccountUser[AccountUser["last_favorite_time"] = 12] = "last_favorite_time";
  5447. AccountUser[AccountUser["progress_dances"] = 13] = "progress_dances";
  5448. AccountUser[AccountUser["progress_hats"] = 14] = "progress_hats";
  5449. AccountUser[AccountUser["progress_heroes"] = 15] = "progress_heroes";
  5450. AccountUser[AccountUser["revival"] = 16] = "revival";
  5451. AccountUser[AccountUser["stage"] = 17] = "stage";
  5452. })(AccountUser || (AccountUser = {}));
  5453. var heroAttr;
  5454. (function (heroAttr) {
  5455. heroAttr[heroAttr["id"] = 0] = "id";
  5456. heroAttr[heroAttr["name"] = 1] = "name";
  5457. heroAttr[heroAttr["quality"] = 2] = "quality";
  5458. heroAttr[heroAttr["icon"] = 3] = "icon";
  5459. heroAttr[heroAttr["prefab"] = 4] = "prefab";
  5460. heroAttr[heroAttr["require_num"] = 5] = "require_num";
  5461. heroAttr[heroAttr["require_type"] = 6] = "require_type";
  5462. })(heroAttr || (heroAttr = {}));
  5463. var signdata;
  5464. (function (signdata) {
  5465. signdata[signdata["sign_days"] = 0] = "sign_days";
  5466. signdata[signdata["sign_time"] = 1] = "sign_time";
  5467. })(signdata || (signdata = {}));
  5468. var entity;
  5469. (function (entity) {
  5470. entity[entity["id"] = 0] = "id";
  5471. entity[entity["name"] = 1] = "name";
  5472. entity[entity["entity_id"] = 2] = "entity_id";
  5473. entity[entity["icon"] = 3] = "icon";
  5474. })(entity || (entity = {}));
  5475. class AccountData {
  5476. constructor(_token, _config, _appSetting, _user, _userbase, _useInvite = null, _user_stage = null, _user_sign, _user_achievement) {
  5477. this.openid = "";
  5478. this.userId = "";
  5479. this.roadconfig = {};
  5480. this.m_RewardDic = {};
  5481. this.m_EntityDic = {};
  5482. this.m_AchievementDic = {};
  5483. this.m_heroDic = {};
  5484. this.m_hatDic = {};
  5485. this.m_cbDic = {};
  5486. this.bannerdata = [];
  5487. this.redata = [];
  5488. this.m_token = _token;
  5489. this.m_app_setting = _appSetting;
  5490. this.m_user = _user;
  5491. this.m_user_base = _userbase;
  5492. this.m_sign = _user_sign;
  5493. this.m_task = _user_achievement;
  5494. this.userId = this.m_user["user_id"];
  5495. this.openid = this.m_user_base["openid"];
  5496. console.log("user_id:" + this.userId);
  5497. }
  5498. get share() {
  5499. return this.m_app_setting["share"] == "1";
  5500. }
  5501. get sharecontent() {
  5502. return this.m_app_setting["sharecontent"];
  5503. }
  5504. get cheattime() {
  5505. return Number(this.m_app_setting["cheattime"]);
  5506. }
  5507. get banner() {
  5508. return this.m_app_setting["banner"] == "1";
  5509. }
  5510. get video() {
  5511. return this.m_app_setting["video"] == "1";
  5512. }
  5513. get cheat() {
  5514. return this.m_app_setting["cheat"] == "1";
  5515. }
  5516. get checkscence() {
  5517. return this.m_app_setting["checkscence"] == 1;
  5518. }
  5519. get trial() {
  5520. return this.m_app_setting["trial"] == "1";
  5521. }
  5522. get UseId() {
  5523. return this.userId;
  5524. }
  5525. GetConfig(_type) {
  5526. var type = AccountConfig[_type];
  5527. return this.m_configs[type];
  5528. }
  5529. GetUser(_type) {
  5530. var type = AccountUser[_type];
  5531. return this.m_user[type];
  5532. }
  5533. HasHero(_id) {
  5534. var data = this.GetUser(AccountUser.get_heroes);
  5535. for (var i = 0; i < data.length; i++) {
  5536. var hd = data[i];
  5537. if (_id == hd) {
  5538. return true;
  5539. }
  5540. }
  5541. return false;
  5542. }
  5543. HasHat(_id) {
  5544. var data = this.GetUser(AccountUser.get_hats);
  5545. for (var i = 0; i < data.length; i++) {
  5546. var hd = data[i];
  5547. if (_id.toString == hd) {
  5548. return true;
  5549. }
  5550. }
  5551. return false;
  5552. }
  5553. HasDane(_id) {
  5554. var data = this.GetUser(AccountUser.get_dances);
  5555. for (var i = 0; i < data.length; i++) {
  5556. var hd = data[i];
  5557. if (_id.toString == hd) {
  5558. return true;
  5559. }
  5560. }
  5561. return false;
  5562. }
  5563. GetSign(_datatype) {
  5564. var type = signdata[_datatype];
  5565. return this.m_sign[type];
  5566. }
  5567. GetRewardConfig(_rewardid) {
  5568. var reward = this.m_RewardDic[_rewardid];
  5569. return reward;
  5570. }
  5571. GetEntity(_id, attr) {
  5572. return this.m_EntityDic[_id][entity[attr]];
  5573. }
  5574. GetRewardDic() {
  5575. var config = this.GetConfig(AccountConfig.rewards);
  5576. for (var key in config) {
  5577. this.m_RewardDic[config[key].id] = config[key];
  5578. }
  5579. }
  5580. GetEntityDic() {
  5581. var config = this.GetConfig(AccountConfig.entity);
  5582. for (var key in config) {
  5583. this.m_EntityDic[config[key].entity_id] = config[key];
  5584. }
  5585. }
  5586. GetAchievementData() {
  5587. var data = this.GetConfig(AccountConfig.achievement);
  5588. var dic = {};
  5589. for (var key1 in data) {
  5590. var type1 = data[key1].type;
  5591. if (dic[type1]) {
  5592. continue;
  5593. }
  5594. var array = [];
  5595. for (var key2 in data) {
  5596. var type2 = data[key2].type;
  5597. if (type1 == type2) {
  5598. array.push(data[key2]);
  5599. }
  5600. }
  5601. dic[type1] = array;
  5602. }
  5603. this.m_AchievementDic = dic;
  5604. }
  5605. GetRoadConfig() {
  5606. var configs = this.GetConfig(AccountConfig.road);
  5607. for (var i = 0; i < configs.length; i++) {
  5608. var config = configs[i];
  5609. this.roadconfig[config.roadid] = config;
  5610. }
  5611. }
  5612. GetHeroProgress(_id) {
  5613. var config = this.m_user["progress_heroes"];
  5614. var progress = config[_id] ? config[_id] : 0;
  5615. return progress;
  5616. }
  5617. GetHatProgress(_id) {
  5618. var config = this.m_user["progress_hats"];
  5619. var progress = config[_id] ? config[_id] : 0;
  5620. return progress;
  5621. }
  5622. GetCbProgress(_id) {
  5623. var config = this.m_user["progress_dances"];
  5624. var progress = config[_id] ? config[_id] : 0;
  5625. return progress;
  5626. }
  5627. GetHeroDic() {
  5628. var config = this.GetConfig(AccountConfig.hero);
  5629. for (var i = 0; i < config.length; i++) {
  5630. var data = config[i];
  5631. var hero = new HeroData(Number(data.id));
  5632. hero.curicon = data.icon;
  5633. hero.name = data.name;
  5634. hero.prefab = data.prefab;
  5635. hero.quality = Number(data.quality);
  5636. hero.require_num = Number(data.require_num);
  5637. hero.require_type = Number(data.require_type);
  5638. this.m_heroDic[data.id] = hero;
  5639. }
  5640. return this.m_heroDic;
  5641. }
  5642. GetHatDic() {
  5643. var config = this.GetConfig(AccountConfig.hat);
  5644. for (var i = 0; i < config.length; i++) {
  5645. var data = config[i];
  5646. var hat = new HatData(Number(data.id));
  5647. hat.icon = data.icon;
  5648. hat.name = data.name;
  5649. hat.prefab = data.prefab;
  5650. hat.quality = Number(data.quality);
  5651. hat.require_num = Number(data.require_num);
  5652. hat.require_type = Number(data.require_type);
  5653. this.m_hatDic[data.id] = hat;
  5654. }
  5655. return this.m_hatDic;
  5656. }
  5657. GetCbDic() {
  5658. var config = this.GetConfig(AccountConfig.wing);
  5659. for (var i = 0; i < config.length; i++) {
  5660. var data = config[i];
  5661. var hat = new HatData(Number(data.id));
  5662. hat.icon = data.icon;
  5663. hat.name = data.name;
  5664. hat.prefab = data.prefab;
  5665. hat.quality = Number(data.quality);
  5666. hat.require_num = Number(data.require_num);
  5667. hat.require_type = Number(data.require_type);
  5668. this.m_cbDic[data.id] = hat;
  5669. }
  5670. return this.m_cbDic;
  5671. }
  5672. GetSeverConfig() {
  5673. NetworkManager.Instance.HttpPostRequest(PROTOCOLS.Config, null, Laya.Handler.create(this, (data) => {
  5674. this.m_configs = data["configs"];
  5675. new ThingsEffect(this.m_configs["things"]);
  5676. this.GetHeroDic();
  5677. this.GetHatDic();
  5678. this.GetCbDic();
  5679. this.GetRewardDic();
  5680. this.GetEntityDic();
  5681. this.GetAchievementData();
  5682. this.InitData();
  5683. }), null);
  5684. }
  5685. InitData() {
  5686. var url = "https://jiujiu.99huyu.cn/m/run/config.json";
  5687. var args = null;
  5688. let httpRequest = new HttpRequest$1();
  5689. httpRequest.once(Laya.Event.COMPLETE, this, this.onHttpRequestComplete);
  5690. httpRequest.once(Laya.Event.ERROR, this, this.onHttpRequestError);
  5691. httpRequest.send(url, args, "get", "json");
  5692. }
  5693. onHttpRequestComplete(_data) {
  5694. var data = _data.data.mores;
  5695. for (var key in data.banner) {
  5696. var kk = data.banner[key];
  5697. var nd = new ReData(kk);
  5698. this.bannerdata.push(nd);
  5699. this.bannerdata.sort(RecommendWindow.ListSort);
  5700. }
  5701. for (var key in data.remen_game) {
  5702. var kk = data.remen_game[key];
  5703. var nd = new ReData(kk);
  5704. this.redata.push(nd);
  5705. this.redata.sort(RecommendWindow.ListSort);
  5706. }
  5707. }
  5708. onHttpRequestError(errorcb, httpRequest) {
  5709. console.log("Error! Http request error..." + httpRequest.data);
  5710. }
  5711. }
  5712. class PlayerAccount {
  5713. constructor(_code, _nickname, _avatar, _gender, _country, _province, _city, _device, _shareid, _scence, _ver) {
  5714. this.IsTest = false;
  5715. this.localTime = Laya.timer.currTimer;
  5716. this.Code = _code;
  5717. this.NickName = _nickname;
  5718. this.Avatar = _avatar;
  5719. this.Gender = _gender;
  5720. this.Country = _country;
  5721. this.Province = _province;
  5722. this.City = _city;
  5723. this.Device = _device;
  5724. this.ShareId = _shareid;
  5725. this.Scene = _scence;
  5726. this.ver = _ver;
  5727. this.IsTest = false;
  5728. PlayerAccount.instance = this;
  5729. }
  5730. static get CurrentAccount() {
  5731. if (PlayerAccount.instance == null) {
  5732. console.log("生成本地测试账号...");
  5733. }
  5734. return PlayerAccount.instance;
  5735. }
  5736. static get TestAccount() {
  5737. var curaccount = new PlayerAccount("123456", "我是谁,我在那?", "123", 1, "中国", "上海", "上海", "iphone6s", "123", "123", "123");
  5738. curaccount.IsTest = true;
  5739. return curaccount;
  5740. }
  5741. SetAccountData(data) {
  5742. var token = data["token"];
  5743. var configs = data["configs"];
  5744. var app_setting = data["app_setting"];
  5745. var user = data["user"];
  5746. var user_base = data["user_base"];
  5747. var user_sign = data["user_sign"];
  5748. var user_achievement = data["user_achievement"];
  5749. if (this.CurAccountData == null) {
  5750. this.CurAccountData = new AccountData(token, configs, app_setting, user, user_base, null, null, user_sign, user_achievement);
  5751. this.CurAccountData.GetSeverConfig();
  5752. }
  5753. else {
  5754. if (configs) {
  5755. this.CurAccountData.m_configs = configs;
  5756. }
  5757. if (app_setting) {
  5758. this.CurAccountData.m_app_setting = app_setting;
  5759. }
  5760. if (user) {
  5761. this.CurAccountData.m_user = user;
  5762. }
  5763. if (user_base) {
  5764. this.CurAccountData.m_user_base = user_base;
  5765. }
  5766. if (user_sign) {
  5767. this.CurAccountData.m_sign = user_sign;
  5768. }
  5769. if (user_achievement) {
  5770. this.CurAccountData.m_task = user_achievement;
  5771. }
  5772. }
  5773. }
  5774. get ServerTime() {
  5775. let time = Laya.timer.currTimer;
  5776. let stime = PlayerAccount.ServerTime + Math.ceil((time - this.localTime) / 1000);
  5777. return stime;
  5778. }
  5779. }
  5780. var WxParkInforType;
  5781. (function (WxParkInforType) {
  5782. WxParkInforType[WxParkInforType["stage"] = 0] = "stage";
  5783. })(WxParkInforType || (WxParkInforType = {}));
  5784. class WxApi {
  5785. constructor() {
  5786. this.avator = "";
  5787. this.openId = 0;
  5788. this.codeValue = "";
  5789. this.shareOpenId = "";
  5790. this.shareScene = "";
  5791. WxApi.WxApiInstance = this;
  5792. }
  5793. static get Instance() {
  5794. if (WxApi.WxApiInstance) {
  5795. return WxApi.WxApiInstance;
  5796. }
  5797. else {
  5798. return new WxApi();
  5799. }
  5800. }
  5801. WxInit(callback) {
  5802. Laya.Browser.window.wx.showShareMenu({
  5803. withShareTicket: true
  5804. });
  5805. Laya.Browser.window.wx.onShareAppMessage(function () {
  5806. return {
  5807. title: "有人@你,能追上我,让你当王者又如何",
  5808. imageUrl: "https://res.xcx.snsfun.com/melee/share/fallrace1.png",
  5809. query: "userId=" + this.shareUserId,
  5810. };
  5811. });
  5812. Laya.Browser.window.wx.onShow((option) => {
  5813. var adsdasdsa = option.shareTicket;
  5814. var afsafsfsa = option.query.userId;
  5815. var dadads = option.query.shareTitle;
  5816. console.log("scene:", option.scene);
  5817. Main.sceneValue = option.scene;
  5818. WxApi.querychannel = option.query.channel;
  5819. if (WxApi.querychannel != null) {
  5820. console.log("onShow channel is:", WxApi.querychannel);
  5821. }
  5822. if (option.referrerInfo) {
  5823. WxApi.referrerInfoappid = option.referrerInfo.appId;
  5824. console.log("onShow appId is:", option.referrerInfo.appId);
  5825. }
  5826. WxApi.queryuserId = afsafsfsa;
  5827. callback(adsdasdsa, afsafsfsa, WxApi.querychannel, option.scene, dadads);
  5828. });
  5829. }
  5830. SetShareScence(sceneS) {
  5831. if (sceneS != "" && sceneS != null) {
  5832. this.shareScene = sceneS;
  5833. }
  5834. }
  5835. ShareScene() {
  5836. return this.shareScene;
  5837. }
  5838. gagasgasgsa() {
  5839. if (typeof (Laya.Browser.window.wx) != "undefined") {
  5840. return Laya.Browser.window.wx.getSystemInfoSync();
  5841. }
  5842. }
  5843. OpenId(id) {
  5844. this.openId = id;
  5845. }
  5846. ShareId() {
  5847. return this.shareOpenId;
  5848. }
  5849. WXLogin(cb) {
  5850. var that = this;
  5851. Laya.Browser.window.wx.login({
  5852. success: function (res) {
  5853. if (res.code) {
  5854. that.codeValue = res.code;
  5855. that.avator = res.avator;
  5856. console.log(res.avator);
  5857. cb(res);
  5858. }
  5859. else {
  5860. console.log('获取用户登录态失败!' + res.errMsg);
  5861. }
  5862. },
  5863. fail: function (res) { console.log("wx.login: failed, res=" + res); }
  5864. });
  5865. }
  5866. SetShareId(tid) {
  5867. if (tid != "" && tid != null) {
  5868. this.shareOpenId = tid;
  5869. }
  5870. }
  5871. static shake() {
  5872. Laya.Browser.window.wx.vibrateShort({});
  5873. }
  5874. static shakeLong() {
  5875. Laya.Browser.window.wx.vibrateLong({});
  5876. }
  5877. static Shake(_short = true) {
  5878. if (Main.OnWx && WxApi.CanShake) {
  5879. if (_short) {
  5880. this.shake();
  5881. }
  5882. else {
  5883. this.shakeLong();
  5884. }
  5885. }
  5886. }
  5887. static Message(text) {
  5888. if (Laya.Browser.window.wx) {
  5889. Laya.Browser.window.wx.showToast({ title: text });
  5890. }
  5891. else {
  5892. console.log(text);
  5893. }
  5894. }
  5895. static ShowToast(text) {
  5896. if (Laya.Browser.window.wx) {
  5897. Laya.Browser.window.wx.showToast({ title: text });
  5898. }
  5899. else {
  5900. console.log(text);
  5901. }
  5902. }
  5903. static ShowLoading(title = "加载中...") {
  5904. (Laya.Browser.onMiniGame) && Laya.Browser.window.wx.showLoading({ title: title, mask: true });
  5905. }
  5906. static HideLoading() {
  5907. (Laya.Browser.onMiniGame) && Laya.Browser.window.wx.hideLoading();
  5908. }
  5909. static shareImage(channel, callback = null, shareType) {
  5910. if (Laya.Browser.window.wx == null) {
  5911. return;
  5912. }
  5913. if (!PlayerAccount.CurrentAccount.CurAccountData.share) {
  5914. WxApi.Message("暂未开放");
  5915. return;
  5916. }
  5917. var sharecontent = PlayerAccount.CurrentAccount.CurAccountData.sharecontent;
  5918. var content = JSON.parse(sharecontent);
  5919. var con = content[GameUtils.getRandomInt(0, content.length - 1)];
  5920. var _title = con.title;
  5921. var _url = con.url;
  5922. var t = PlayerAccount.CurrentAccount.ServerTime;
  5923. Laya.Browser.window.wx.aldShareAppMessage({
  5924. title: _title,
  5925. imageUrl: _url,
  5926. query: "userId=" + PlayerAccount.CurrentAccount.CurAccountData.UseId + "_" + shareType + "_" + t + "_" + Math.floor(9999 * Math.random()).toString() + "&shareTitle=" + _title,
  5927. });
  5928. if (callback) {
  5929. ShareUtil.Instance.beginShare(callback);
  5930. }
  5931. }
  5932. recordAldEvent(key, value) {
  5933. if (Laya.Browser.window && Laya.Browser.window.wx) {
  5934. Laya.Browser.window.wx.aldSendEvent(key, { key: value });
  5935. }
  5936. }
  5937. levelStart(stageId, stageName, userId) {
  5938. console.log("开始记录关卡:" + stageId);
  5939. if (Laya.Browser.window && Laya.Browser.window.wx) {
  5940. Laya.Browser.window.wx.aldStage.onStart({
  5941. stageId: stageId,
  5942. stageName: stageName,
  5943. userId: userId
  5944. });
  5945. }
  5946. }
  5947. levelSuccess(stageId, stageName, userId) {
  5948. console.log("记录关卡:完成" + stageId);
  5949. if (Laya.Browser.window && Laya.Browser.window.wx) {
  5950. Laya.Browser.window.wx.aldStage.onEnd({
  5951. stageId: stageId,
  5952. stageName: stageName,
  5953. userId: userId,
  5954. event: "complete",
  5955. params: {
  5956. desc: "关卡完成"
  5957. }
  5958. });
  5959. }
  5960. }
  5961. levelFail(stageId, stageName, userId, score, carname) {
  5962. console.log("记录关卡:失败" + stageId);
  5963. if (Laya.Browser.window && Laya.Browser.window.wx) {
  5964. Laya.Browser.window.wx.aldStage.onEnd({
  5965. stageId: stageId,
  5966. stageName: stageName,
  5967. userId: userId,
  5968. event: "fail",
  5969. params: {
  5970. desc: "失败",
  5971. score: score,
  5972. car: carname
  5973. }
  5974. });
  5975. }
  5976. }
  5977. static writeStage(stage) {
  5978. var kvDataList = new Array();
  5979. let date = new Date().getTime();
  5980. var myValue = JSON.stringify({
  5981. "wxgame": {
  5982. "stage": stage,
  5983. "update_time": date.toString(),
  5984. }
  5985. });
  5986. kvDataList.push({ key: "stage", value: myValue });
  5987. if (Laya.Browser.window.wx) {
  5988. Laya.Browser.window.wx.setUserCloudStorage({
  5989. KVDataList: kvDataList,
  5990. success: r => {
  5991. console.log("上传分数成功");
  5992. }
  5993. });
  5994. }
  5995. }
  5996. }
  5997. WxApi.referrerInfoappid = "";
  5998. WxApi.querychannel = "";
  5999. WxApi.queryuserId = "123";
  6000. WxApi.CanShake = true;
  6001. class CheckMain {
  6002. }
  6003. CheckMain.create = false;
  6004. class Main {
  6005. constructor() {
  6006. this.localAtlas = [
  6007. "res/atlas/local.atlas",
  6008. "res/atlas/local.png",
  6009. "res/atlas/load.atlas",
  6010. "res/atlas/load.png",
  6011. ];
  6012. if (CheckMain.create)
  6013. return;
  6014. CheckMain.create = true;
  6015. if (window["Laya3D"])
  6016. Laya3D.init(GameConfig.width, GameConfig.height);
  6017. else
  6018. Laya.init(GameConfig.width, GameConfig.height, Laya["WebGL"]);
  6019. Laya["Physics"] && Laya["Physics"].enable();
  6020. Laya["DebugPanel"] && Laya["DebugPanel"].enable();
  6021. Laya.stage.scaleMode = GameConfig.scaleMode;
  6022. Laya.stage.screenMode = GameConfig.screenMode;
  6023. Laya.URL.exportSceneToJson = GameConfig.exportSceneToJson;
  6024. if (GameConfig.debug || Laya.Utils.getQueryString("debug") == "true")
  6025. Laya.enableDebugPanel();
  6026. if (GameConfig.physicsDebug && Laya["PhysicsDebugDraw"])
  6027. Laya["PhysicsDebugDraw"].enable();
  6028. if (GameConfig.stat)
  6029. Laya.Stat.show();
  6030. Laya.alertGlobalError = true;
  6031. Main.OnWx = Laya.Browser.onWeiXin;
  6032. if (Main.OnWx)
  6033. WxApi.Instance.WxInit(() => { });
  6034. Laya.ResourceVersion.enable("version.json", Laya.Handler.create(this, this.onVersionLoaded), Laya.ResourceVersion.FILENAME_VERSION);
  6035. }
  6036. onVersionLoaded() {
  6037. Laya.AtlasInfoManager.enable("fileconfig.json", Laya.Handler.create(this, this.onConfigLoaded));
  6038. }
  6039. onConfigLoaded() {
  6040. Laya.loader.create(this.localAtlas, Laya.Handler.create(this, () => {
  6041. new LoadWindow();
  6042. }));
  6043. }
  6044. }
  6045. Main.Ver = "1.0.85";
  6046. Main.sceneValue = "000000";
  6047. new Main();
  6048. var Tween = Laya.Tween;
  6049. class LoadWindow extends ui.Window.LoadWindowUI {
  6050. constructor() {
  6051. super();
  6052. this.loadcomplete = false;
  6053. LoadWindow.Instance = this;
  6054. Laya.stage.addChild(this);
  6055. this.OnShow();
  6056. }
  6057. OnShow() {
  6058. this.ShowProgress();
  6059. WxApi.Instance.recordAldEvent("进入加载界面", "1");
  6060. this.height = Laya.stage.height;
  6061. Laya.stage.on(Laya.Event.RESIZE, this, () => {
  6062. this.height = Laya.stage.height;
  6063. });
  6064. }
  6065. ShowProgress() {
  6066. this.TweenProgress(0, 0.65, 1.5, () => {
  6067. if (!this.loadcomplete)
  6068. this.TweenProgress(0.65, 0.99, 100);
  6069. this.AccountLogin();
  6070. });
  6071. }
  6072. AccountLogin() {
  6073. if (Main.OnWx) {
  6074. WxApi.Instance.recordAldEvent("开始登录账号...", "1");
  6075. WxApi.Instance.WXLogin((res) => {
  6076. this.OnLogin(res);
  6077. });
  6078. }
  6079. else {
  6080. NetworkManager.Instance.login(null, Laya.Handler.create(this, this.OnLocalSeverLoginComplete), Laya.Handler.create(this, this.OnLoginError));
  6081. }
  6082. }
  6083. OnLogin(_res) {
  6084. if (_res == "error") {
  6085. WxApi.Instance.WXLogin((res) => {
  6086. this.OnLogin(res);
  6087. });
  6088. console.log("微信登录失败");
  6089. }
  6090. else {
  6091. WxApi.Instance.recordAldEvent("微信登录成功...", "1");
  6092. ShareUtil.Instance.onRegister();
  6093. console.log("微信登录成功");
  6094. new PlayerAccount(_res.code, "", "", 0, "", "", "", "", WxApi.Instance.shareOpenId, WxApi.Instance.shareOpenId, Main.Ver);
  6095. NetworkManager.Instance.login(null, Laya.Handler.create(this, this.OnLocalSeverLoginComplete), Laya.Handler.create(this, this.OnLoginError));
  6096. }
  6097. }
  6098. OnLocalSeverLoginComplete() {
  6099. WxApi.Instance.recordAldEvent("本地服务器登录完成...", "1");
  6100. console.log("本地服务器登录完成...");
  6101. var stage = Number(PlayerAccount.CurrentAccount.CurAccountData.GetUser(AccountUser.stage));
  6102. WxApi.writeStage(stage);
  6103. JionTool.Init();
  6104. this.LoadSubPackage();
  6105. }
  6106. OnLoginError(e) {
  6107. console.log(e);
  6108. }
  6109. TweenProgress(_start, _end, _duration, _complete = null) {
  6110. if (this.ProgressTween)
  6111. this.ProgressTween.clear();
  6112. this.progress.value = _start;
  6113. this.preTex.text = Math.floor(this.progress.value * 100).toString() + "%";
  6114. this.ProgressTween = Tween.to(this.progress, { value: _end, update: Laya.Handler.create(this, () => {
  6115. this.preTex.text = Math.floor(this.progress.value * 100).toString() + "%";
  6116. }, null, false) }, _duration * 1000, null, Laya.Handler.create(this, _complete), null, true, true);
  6117. }
  6118. LoadSubPackage() {
  6119. if (Main.OnWx) {
  6120. WxApi.Instance.recordAldEvent("开始加载分包资源...", "1");
  6121. Laya.Browser.window.wx.loadSubpackage({
  6122. name: 'subpackage',
  6123. success: (res) => {
  6124. console.log("分包加载成功");
  6125. WxApi.Instance.recordAldEvent("分包加载成功...", "1");
  6126. this.LoadScene();
  6127. },
  6128. fail: function (res) {
  6129. this.LoadSubPackage();
  6130. }
  6131. });
  6132. }
  6133. else {
  6134. this.LoadScene();
  6135. }
  6136. }
  6137. LoadScene() {
  6138. WxApi.Instance.recordAldEvent("开始加载场景...", "1");
  6139. Laya.Scene3D.load(AssetPaths.scencepath, Laya.Handler.create(this, (_scence) => {
  6140. ResourcesManager.Instance.scenceasset = _scence;
  6141. ResourcesManager.Instance.scenceasset.visible = false;
  6142. Laya.stage.addChild(ResourcesManager.Instance.scenceasset);
  6143. new ScenceManager(_scence);
  6144. WxApi.Instance.recordAldEvent("加载场景完成...", "1");
  6145. console.log("场景加载完成...");
  6146. this.LoadPlayerRes();
  6147. }));
  6148. }
  6149. LoadPlayerRes() {
  6150. WxApi.Instance.recordAldEvent("开始加载角色资源...", "1");
  6151. var playerpath = [];
  6152. for (var key in AssetPaths.playerpath) {
  6153. playerpath.push(AssetPaths.playerpath[key]);
  6154. }
  6155. playerpath.push(AssetPaths.decoratepath);
  6156. Laya.loader.create(playerpath, Laya.Handler.create(this, () => {
  6157. for (var key in AssetPaths.playerpath) {
  6158. var path = AssetPaths.playerpath[key];
  6159. var asset = Laya.loader.getRes(path);
  6160. ResourcesManager.Instance.playerassets[key] = asset;
  6161. Laya.loader.clearRes(path);
  6162. }
  6163. var decorate = Laya.loader.getRes(AssetPaths.decoratepath);
  6164. for (var i = 0; i < decorate.numChildren; i++) {
  6165. ResourcesManager.Instance.decorateasset[i] = decorate.getChildAt(i);
  6166. }
  6167. Laya.loader.clearRes(AssetPaths.decoratepath);
  6168. console.log("角色资源完成...");
  6169. WxApi.Instance.recordAldEvent("角色资源完成...", "1");
  6170. this.LoadRoadRes();
  6171. }));
  6172. }
  6173. LoadRoadRes() {
  6174. var roadpath = [];
  6175. for (var key in AssetPaths.roadpath) {
  6176. roadpath.push(AssetPaths.roadpath[key]);
  6177. }
  6178. for (var i = 0; i < AssetPaths.planetxture.length; i++) {
  6179. roadpath.push(AssetPaths.planetxture[i]);
  6180. }
  6181. Laya.loader.create(roadpath, Laya.Handler.create(this, () => {
  6182. var bspath = AssetPaths.roadpath[1];
  6183. var asset = Laya.loader.getRes(bspath).getChildAt(0);
  6184. for (var i = 0; i < asset.numChildren; i++) {
  6185. ResourcesManager.Instance.bsroadassets[i] = asset.getChildAt(i);
  6186. }
  6187. Laya.loader.clearRes(AssetPaths.roadpath[1]);
  6188. var fxpath = AssetPaths.roadpath[2];
  6189. var asset = Laya.loader.getRes(fxpath).getChildAt(0);
  6190. for (var i = 0; i < asset.numChildren; i++) {
  6191. ResourcesManager.Instance.fxroadassets[i] = asset.getChildAt(i);
  6192. }
  6193. Laya.loader.clearRes(AssetPaths.roadpath[2]);
  6194. var tspath = AssetPaths.roadpath[3];
  6195. var asset = Laya.loader.getRes(tspath).getChildAt(0);
  6196. for (var i = 0; i < asset.numChildren; i++) {
  6197. ResourcesManager.Instance.tsroadassets[i + 1] = asset.getChildAt(i);
  6198. }
  6199. Laya.loader.clearRes(AssetPaths.roadpath[3]);
  6200. for (var i = 0; i < AssetPaths.planetxture.length; i++) {
  6201. var asset = Laya.loader.getRes(AssetPaths.planetxture[i]);
  6202. ResourcesManager.Instance.planetextures[i + 1] = asset;
  6203. Laya.loader.clearRes(AssetPaths.planetxture[i]);
  6204. }
  6205. console.log("道路资源完成...");
  6206. WxApi.Instance.recordAldEvent("道路资源完成...", "1");
  6207. this.LoadBuildsRes();
  6208. }));
  6209. }
  6210. DelayHide(_sprite) {
  6211. _sprite.removeSelf();
  6212. }
  6213. LoadBuildsRes() {
  6214. var path = AssetPaths.buildpath;
  6215. Laya.loader.create(path, Laya.Handler.create(this, () => {
  6216. var asset = Laya.loader.getRes(AssetPaths.buildpath);
  6217. for (var i = 0; i < asset.numChildren; i++) {
  6218. var build = asset.getChildAt(i);
  6219. ResourcesManager.Instance.buildsassets[i] = build;
  6220. }
  6221. Laya.loader.clearRes(AssetPaths.buildpath);
  6222. WxApi.Instance.recordAldEvent("建筑资源加载完成...", "1");
  6223. console.log("建筑资源加载完成...");
  6224. this.TweenProgress(this.progress.value, 100, 0.3, () => {
  6225. WxApi.Instance.recordAldEvent("all资源加载完成...", "1");
  6226. this.loadcomplete = true;
  6227. this.destroy();
  6228. ADPlayer.initAd();
  6229. new GameManager();
  6230. });
  6231. }));
  6232. }
  6233. }
  6234. class Main$1 {
  6235. constructor() {
  6236. this.localAtlas = [
  6237. "res/atlas/local.atlas",
  6238. "res/atlas/local.png",
  6239. "res/atlas/load.atlas",
  6240. "res/atlas/load.png",
  6241. ];
  6242. if (CheckMain.create)
  6243. return;
  6244. CheckMain.create = true;
  6245. if (window["Laya3D"])
  6246. Laya3D.init(GameConfig.width, GameConfig.height);
  6247. else
  6248. Laya.init(GameConfig.width, GameConfig.height, Laya["WebGL"]);
  6249. Laya["Physics"] && Laya["Physics"].enable();
  6250. Laya["DebugPanel"] && Laya["DebugPanel"].enable();
  6251. Laya.stage.scaleMode = GameConfig.scaleMode;
  6252. Laya.stage.screenMode = GameConfig.screenMode;
  6253. Laya.URL.exportSceneToJson = GameConfig.exportSceneToJson;
  6254. if (GameConfig.debug || Laya.Utils.getQueryString("debug") == "true")
  6255. Laya.enableDebugPanel();
  6256. if (GameConfig.physicsDebug && Laya["PhysicsDebugDraw"])
  6257. Laya["PhysicsDebugDraw"].enable();
  6258. if (GameConfig.stat)
  6259. Laya.Stat.show();
  6260. Laya.alertGlobalError = true;
  6261. Main$1.OnWx = Laya.Browser.onWeiXin;
  6262. if (Main$1.OnWx)
  6263. WxApi.Instance.WxInit(() => { });
  6264. Laya.ResourceVersion.enable("version.json", Laya.Handler.create(this, this.onVersionLoaded), Laya.ResourceVersion.FILENAME_VERSION);
  6265. }
  6266. onVersionLoaded() {
  6267. Laya.AtlasInfoManager.enable("fileconfig.json", Laya.Handler.create(this, this.onConfigLoaded));
  6268. }
  6269. onConfigLoaded() {
  6270. Laya.loader.create(this.localAtlas, Laya.Handler.create(this, () => {
  6271. new LoadWindow();
  6272. }));
  6273. }
  6274. }
  6275. Main$1.Ver = "1.0.85";
  6276. Main$1.sceneValue = "000000";
  6277. new Main$1();
  6278. exports.Main = Main$1;
  6279. return exports;
  6280. }({}));
  6281. //# sourceMappingURL=bundle.js.map