123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996997998999100010011002100310041005100610071008100910101011101210131014101510161017101810191020102110221023102410251026102710281029103010311032103310341035103610371038103910401041104210431044104510461047104810491050105110521053105410551056105710581059106010611062106310641065106610671068106910701071107210731074107510761077107810791080108110821083108410851086108710881089109010911092109310941095109610971098109911001101110211031104110511061107110811091110111111121113111411151116111711181119112011211122112311241125112611271128112911301131113211331134113511361137113811391140114111421143114411451146114711481149115011511152115311541155115611571158115911601161116211631164116511661167116811691170117111721173117411751176117711781179118011811182118311841185118611871188118911901191119211931194119511961197119811991200120112021203120412051206120712081209121012111212121312141215121612171218121912201221122212231224122512261227122812291230123112321233123412351236123712381239124012411242124312441245124612471248124912501251125212531254125512561257125812591260126112621263126412651266126712681269127012711272127312741275127612771278127912801281128212831284128512861287128812891290129112921293129412951296129712981299130013011302130313041305130613071308130913101311131213131314131513161317131813191320132113221323132413251326132713281329133013311332133313341335133613371338133913401341134213431344134513461347134813491350135113521353135413551356135713581359136013611362136313641365136613671368136913701371137213731374137513761377137813791380138113821383138413851386138713881389139013911392139313941395139613971398139914001401140214031404140514061407140814091410141114121413141414151416141714181419142014211422142314241425142614271428142914301431143214331434143514361437143814391440144114421443144414451446144714481449145014511452145314541455145614571458145914601461146214631464146514661467146814691470147114721473147414751476147714781479148014811482148314841485148614871488148914901491149214931494149514961497149814991500150115021503150415051506150715081509151015111512151315141515151615171518151915201521152215231524152515261527152815291530153115321533153415351536153715381539154015411542154315441545154615471548154915501551155215531554155515561557155815591560156115621563156415651566156715681569157015711572157315741575157615771578157915801581158215831584158515861587158815891590159115921593159415951596159715981599160016011602160316041605160616071608160916101611161216131614161516161617161816191620162116221623162416251626162716281629163016311632163316341635163616371638163916401641164216431644164516461647164816491650165116521653165416551656165716581659166016611662166316641665166616671668166916701671167216731674167516761677167816791680168116821683168416851686168716881689169016911692169316941695169616971698169917001701170217031704170517061707170817091710171117121713171417151716171717181719172017211722172317241725172617271728172917301731173217331734173517361737173817391740174117421743174417451746174717481749175017511752175317541755175617571758175917601761176217631764176517661767176817691770177117721773177417751776177717781779178017811782178317841785178617871788178917901791179217931794179517961797179817991800180118021803180418051806180718081809181018111812181318141815181618171818181918201821182218231824182518261827182818291830183118321833183418351836183718381839184018411842184318441845184618471848184918501851185218531854185518561857185818591860186118621863186418651866186718681869187018711872187318741875187618771878187918801881188218831884188518861887188818891890189118921893189418951896189718981899190019011902190319041905190619071908190919101911191219131914191519161917191819191920192119221923192419251926192719281929193019311932193319341935193619371938193919401941194219431944194519461947194819491950195119521953195419551956195719581959196019611962196319641965196619671968196919701971197219731974197519761977197819791980198119821983198419851986198719881989199019911992199319941995199619971998199920002001200220032004200520062007200820092010201120122013201420152016201720182019202020212022202320242025202620272028202920302031203220332034203520362037203820392040204120422043204420452046204720482049205020512052205320542055205620572058205920602061206220632064206520662067206820692070207120722073207420752076207720782079208020812082208320842085208620872088208920902091209220932094209520962097209820992100210121022103210421052106210721082109211021112112211321142115211621172118211921202121212221232124212521262127212821292130213121322133213421352136213721382139214021412142214321442145214621472148214921502151215221532154215521562157215821592160216121622163216421652166216721682169217021712172217321742175217621772178217921802181218221832184218521862187218821892190219121922193219421952196219721982199220022012202220322042205220622072208220922102211221222132214221522162217221822192220222122222223222422252226222722282229223022312232223322342235223622372238223922402241224222432244224522462247224822492250225122522253225422552256225722582259226022612262226322642265226622672268226922702271227222732274227522762277227822792280228122822283228422852286228722882289229022912292229322942295229622972298229923002301230223032304230523062307230823092310231123122313231423152316231723182319232023212322232323242325232623272328232923302331233223332334233523362337233823392340234123422343234423452346234723482349235023512352235323542355235623572358235923602361236223632364236523662367236823692370237123722373237423752376237723782379238023812382238323842385238623872388238923902391239223932394239523962397239823992400240124022403240424052406240724082409241024112412241324142415241624172418241924202421242224232424242524262427242824292430243124322433243424352436243724382439244024412442244324442445244624472448244924502451245224532454245524562457245824592460246124622463246424652466246724682469247024712472247324742475247624772478247924802481248224832484248524862487248824892490249124922493249424952496249724982499250025012502250325042505250625072508250925102511251225132514251525162517251825192520252125222523252425252526252725282529253025312532253325342535253625372538253925402541254225432544254525462547254825492550255125522553255425552556255725582559256025612562256325642565256625672568256925702571257225732574257525762577257825792580258125822583258425852586258725882589259025912592259325942595259625972598259926002601260226032604260526062607260826092610261126122613261426152616261726182619262026212622262326242625262626272628262926302631263226332634263526362637263826392640264126422643264426452646264726482649265026512652265326542655265626572658265926602661266226632664266526662667266826692670267126722673267426752676267726782679268026812682268326842685268626872688268926902691269226932694269526962697269826992700270127022703270427052706270727082709271027112712271327142715271627172718271927202721272227232724272527262727272827292730273127322733273427352736273727382739274027412742274327442745274627472748274927502751275227532754275527562757275827592760276127622763276427652766276727682769277027712772277327742775277627772778277927802781278227832784278527862787278827892790279127922793279427952796279727982799280028012802280328042805280628072808280928102811281228132814281528162817281828192820282128222823282428252826282728282829283028312832283328342835283628372838283928402841284228432844284528462847284828492850285128522853285428552856285728582859286028612862286328642865286628672868286928702871287228732874287528762877287828792880288128822883288428852886288728882889289028912892289328942895289628972898289929002901290229032904290529062907290829092910291129122913291429152916291729182919292029212922292329242925292629272928292929302931293229332934293529362937293829392940294129422943294429452946294729482949295029512952295329542955295629572958295929602961296229632964296529662967296829692970297129722973297429752976297729782979298029812982298329842985298629872988298929902991299229932994299529962997299829993000300130023003300430053006300730083009301030113012301330143015301630173018301930203021302230233024302530263027302830293030303130323033303430353036303730383039304030413042304330443045304630473048304930503051305230533054305530563057305830593060306130623063306430653066306730683069307030713072307330743075307630773078307930803081308230833084308530863087308830893090309130923093309430953096309730983099310031013102310331043105310631073108310931103111311231133114311531163117311831193120312131223123312431253126312731283129313031313132313331343135313631373138313931403141314231433144314531463147314831493150315131523153315431553156315731583159316031613162316331643165316631673168316931703171317231733174317531763177317831793180318131823183318431853186318731883189319031913192319331943195319631973198319932003201320232033204320532063207320832093210321132123213321432153216321732183219322032213222322332243225322632273228322932303231323232333234323532363237323832393240324132423243324432453246324732483249325032513252325332543255325632573258325932603261326232633264326532663267326832693270327132723273327432753276327732783279328032813282328332843285328632873288328932903291329232933294329532963297329832993300330133023303330433053306330733083309331033113312331333143315331633173318331933203321332233233324332533263327332833293330333133323333333433353336333733383339334033413342334333443345334633473348334933503351335233533354335533563357335833593360336133623363336433653366336733683369337033713372337333743375337633773378337933803381338233833384338533863387338833893390339133923393339433953396339733983399340034013402340334043405340634073408340934103411341234133414341534163417341834193420342134223423342434253426342734283429343034313432343334343435343634373438343934403441344234433444344534463447344834493450345134523453345434553456345734583459346034613462346334643465346634673468346934703471347234733474347534763477347834793480348134823483348434853486348734883489349034913492349334943495349634973498349935003501350235033504350535063507350835093510351135123513351435153516351735183519352035213522352335243525352635273528352935303531353235333534353535363537353835393540354135423543354435453546354735483549355035513552355335543555355635573558355935603561356235633564356535663567356835693570357135723573357435753576357735783579358035813582358335843585358635873588358935903591359235933594359535963597359835993600360136023603360436053606360736083609361036113612361336143615361636173618361936203621362236233624362536263627362836293630363136323633363436353636363736383639364036413642364336443645364636473648364936503651365236533654365536563657365836593660366136623663366436653666366736683669367036713672367336743675367636773678367936803681368236833684368536863687368836893690369136923693369436953696369736983699370037013702370337043705370637073708370937103711371237133714371537163717371837193720372137223723372437253726372737283729373037313732373337343735373637373738373937403741374237433744374537463747374837493750375137523753375437553756375737583759376037613762376337643765376637673768376937703771377237733774377537763777377837793780378137823783378437853786378737883789379037913792379337943795379637973798379938003801380238033804380538063807380838093810381138123813381438153816381738183819382038213822382338243825382638273828382938303831383238333834383538363837383838393840384138423843384438453846384738483849385038513852385338543855385638573858385938603861386238633864386538663867386838693870387138723873387438753876387738783879388038813882388338843885388638873888388938903891389238933894389538963897389838993900390139023903390439053906390739083909391039113912391339143915391639173918391939203921392239233924392539263927392839293930393139323933393439353936393739383939394039413942394339443945394639473948394939503951395239533954395539563957395839593960396139623963396439653966396739683969397039713972397339743975397639773978397939803981398239833984398539863987398839893990399139923993399439953996399739983999400040014002400340044005400640074008400940104011401240134014401540164017401840194020402140224023402440254026402740284029403040314032403340344035403640374038403940404041404240434044404540464047404840494050405140524053405440554056405740584059406040614062406340644065406640674068406940704071407240734074407540764077407840794080408140824083408440854086408740884089409040914092409340944095409640974098409941004101410241034104410541064107410841094110411141124113411441154116411741184119412041214122412341244125412641274128412941304131413241334134413541364137413841394140414141424143414441454146414741484149415041514152415341544155415641574158415941604161416241634164416541664167416841694170417141724173417441754176417741784179418041814182418341844185418641874188418941904191419241934194419541964197419841994200420142024203420442054206420742084209421042114212421342144215421642174218421942204221422242234224422542264227422842294230423142324233423442354236423742384239424042414242424342444245424642474248424942504251425242534254425542564257425842594260426142624263426442654266426742684269427042714272427342744275427642774278427942804281428242834284428542864287428842894290429142924293429442954296429742984299430043014302430343044305430643074308430943104311431243134314431543164317431843194320432143224323432443254326432743284329433043314332433343344335433643374338433943404341434243434344434543464347434843494350435143524353435443554356435743584359436043614362436343644365436643674368436943704371437243734374437543764377437843794380438143824383438443854386438743884389439043914392439343944395439643974398439944004401440244034404440544064407440844094410441144124413441444154416441744184419442044214422442344244425442644274428442944304431443244334434443544364437443844394440444144424443444444454446444744484449445044514452445344544455445644574458445944604461446244634464446544664467446844694470447144724473447444754476447744784479448044814482448344844485448644874488448944904491449244934494449544964497449844994500450145024503450445054506450745084509451045114512451345144515451645174518451945204521452245234524452545264527452845294530453145324533453445354536453745384539454045414542454345444545454645474548454945504551455245534554455545564557455845594560456145624563456445654566456745684569457045714572457345744575457645774578457945804581458245834584458545864587458845894590459145924593459445954596459745984599460046014602460346044605460646074608460946104611461246134614461546164617461846194620462146224623462446254626462746284629463046314632463346344635463646374638463946404641464246434644464546464647464846494650465146524653465446554656465746584659466046614662466346644665466646674668466946704671467246734674467546764677467846794680468146824683468446854686468746884689469046914692469346944695469646974698469947004701470247034704470547064707470847094710471147124713471447154716471747184719472047214722472347244725472647274728472947304731473247334734473547364737473847394740474147424743474447454746474747484749475047514752475347544755475647574758475947604761476247634764476547664767476847694770477147724773477447754776477747784779478047814782478347844785478647874788478947904791479247934794479547964797479847994800480148024803480448054806480748084809481048114812481348144815481648174818481948204821482248234824482548264827482848294830483148324833483448354836483748384839484048414842484348444845484648474848484948504851485248534854485548564857485848594860486148624863486448654866486748684869487048714872487348744875487648774878487948804881488248834884488548864887488848894890489148924893489448954896489748984899490049014902490349044905490649074908490949104911491249134914491549164917491849194920492149224923492449254926492749284929493049314932493349344935493649374938493949404941494249434944494549464947494849494950495149524953495449554956495749584959496049614962496349644965496649674968496949704971497249734974497549764977497849794980498149824983498449854986498749884989499049914992499349944995499649974998499950005001500250035004500550065007500850095010501150125013501450155016501750185019502050215022502350245025502650275028502950305031503250335034503550365037503850395040504150425043504450455046504750485049505050515052505350545055505650575058505950605061506250635064506550665067506850695070507150725073507450755076507750785079508050815082508350845085508650875088508950905091509250935094509550965097509850995100510151025103510451055106510751085109511051115112511351145115511651175118511951205121512251235124512551265127512851295130513151325133513451355136513751385139514051415142514351445145514651475148514951505151515251535154515551565157515851595160516151625163516451655166516751685169517051715172517351745175517651775178517951805181518251835184518551865187518851895190519151925193519451955196519751985199520052015202520352045205520652075208520952105211521252135214521552165217521852195220522152225223522452255226522752285229523052315232523352345235523652375238523952405241524252435244524552465247524852495250525152525253525452555256525752585259526052615262526352645265526652675268526952705271527252735274527552765277527852795280528152825283528452855286528752885289529052915292529352945295529652975298529953005301530253035304530553065307530853095310531153125313531453155316531753185319532053215322532353245325532653275328532953305331533253335334533553365337533853395340534153425343534453455346534753485349535053515352535353545355535653575358535953605361536253635364536553665367536853695370537153725373537453755376537753785379538053815382538353845385538653875388538953905391539253935394539553965397539853995400540154025403540454055406540754085409541054115412541354145415541654175418541954205421542254235424542554265427542854295430543154325433543454355436543754385439544054415442544354445445544654475448544954505451545254535454545554565457545854595460546154625463546454655466546754685469547054715472547354745475547654775478547954805481548254835484548554865487548854895490549154925493549454955496549754985499550055015502550355045505550655075508550955105511551255135514551555165517551855195520552155225523552455255526552755285529553055315532553355345535553655375538553955405541554255435544554555465547554855495550555155525553555455555556555755585559556055615562556355645565556655675568556955705571557255735574557555765577557855795580558155825583558455855586558755885589559055915592559355945595559655975598559956005601560256035604560556065607560856095610561156125613561456155616561756185619562056215622562356245625562656275628562956305631563256335634563556365637563856395640564156425643564456455646564756485649565056515652565356545655565656575658565956605661566256635664566556665667566856695670567156725673567456755676567756785679568056815682568356845685568656875688568956905691569256935694569556965697569856995700570157025703570457055706570757085709571057115712571357145715571657175718571957205721572257235724572557265727572857295730573157325733573457355736573757385739574057415742574357445745574657475748574957505751575257535754575557565757575857595760576157625763576457655766576757685769577057715772577357745775577657775778577957805781578257835784578557865787578857895790579157925793579457955796579757985799580058015802580358045805580658075808580958105811581258135814581558165817581858195820582158225823582458255826582758285829583058315832583358345835583658375838583958405841584258435844584558465847584858495850585158525853585458555856585758585859586058615862586358645865586658675868586958705871587258735874587558765877587858795880588158825883588458855886588758885889589058915892589358945895589658975898589959005901590259035904590559065907590859095910591159125913591459155916591759185919592059215922592359245925592659275928592959305931593259335934593559365937593859395940594159425943594459455946594759485949595059515952595359545955595659575958595959605961596259635964596559665967596859695970597159725973597459755976597759785979598059815982598359845985598659875988598959905991599259935994599559965997599859996000600160026003600460056006600760086009601060116012601360146015601660176018601960206021602260236024602560266027602860296030603160326033603460356036603760386039604060416042604360446045604660476048604960506051605260536054605560566057605860596060606160626063606460656066606760686069607060716072607360746075607660776078607960806081608260836084608560866087608860896090609160926093609460956096609760986099610061016102610361046105610661076108610961106111611261136114611561166117611861196120612161226123612461256126612761286129613061316132613361346135613661376138613961406141614261436144614561466147614861496150615161526153615461556156615761586159616061616162616361646165616661676168616961706171617261736174617561766177617861796180618161826183618461856186618761886189619061916192619361946195619661976198619962006201620262036204620562066207620862096210621162126213621462156216621762186219622062216222622362246225622662276228622962306231623262336234623562366237623862396240624162426243624462456246624762486249625062516252625362546255625662576258625962606261626262636264626562666267626862696270627162726273627462756276627762786279628062816282628362846285628662876288628962906291629262936294629562966297629862996300630163026303630463056306630763086309631063116312631363146315631663176318631963206321632263236324632563266327632863296330633163326333633463356336633763386339634063416342634363446345634663476348634963506351635263536354635563566357635863596360636163626363636463656366636763686369637063716372637363746375637663776378637963806381638263836384638563866387638863896390639163926393639463956396639763986399640064016402640364046405640664076408640964106411641264136414641564166417641864196420642164226423642464256426642764286429643064316432643364346435643664376438643964406441644264436444644564466447644864496450645164526453645464556456645764586459646064616462646364646465646664676468646964706471647264736474647564766477647864796480648164826483648464856486648764886489649064916492649364946495649664976498649965006501650265036504650565066507650865096510651165126513651465156516651765186519652065216522652365246525652665276528652965306531653265336534653565366537653865396540654165426543654465456546654765486549655065516552655365546555655665576558655965606561656265636564656565666567656865696570657165726573657465756576657765786579658065816582658365846585658665876588658965906591659265936594659565966597659865996600660166026603660466056606660766086609661066116612661366146615661666176618661966206621662266236624662566266627662866296630663166326633663466356636663766386639664066416642664366446645664666476648664966506651665266536654665566566657665866596660666166626663666466656666666766686669667066716672667366746675667666776678667966806681668266836684668566866687668866896690669166926693669466956696669766986699670067016702670367046705670667076708670967106711671267136714671567166717671867196720672167226723672467256726672767286729673067316732673367346735673667376738673967406741674267436744674567466747674867496750675167526753675467556756675767586759676067616762676367646765676667676768676967706771677267736774677567766777677867796780678167826783678467856786678767886789679067916792679367946795679667976798679968006801680268036804680568066807680868096810681168126813681468156816681768186819682068216822682368246825682668276828682968306831683268336834683568366837683868396840684168426843684468456846684768486849685068516852685368546855685668576858685968606861686268636864686568666867686868696870687168726873687468756876687768786879688068816882688368846885688668876888688968906891689268936894689568966897689868996900690169026903690469056906690769086909691069116912691369146915691669176918691969206921692269236924692569266927692869296930693169326933693469356936693769386939694069416942694369446945694669476948694969506951695269536954695569566957695869596960696169626963696469656966696769686969697069716972697369746975697669776978697969806981698269836984698569866987698869896990699169926993699469956996699769986999700070017002700370047005700670077008700970107011701270137014701570167017701870197020702170227023702470257026702770287029703070317032703370347035703670377038703970407041704270437044704570467047704870497050705170527053705470557056705770587059706070617062706370647065706670677068706970707071707270737074707570767077707870797080708170827083708470857086708770887089709070917092709370947095709670977098709971007101710271037104710571067107710871097110711171127113711471157116711771187119712071217122712371247125712671277128712971307131713271337134713571367137713871397140714171427143714471457146714771487149715071517152715371547155715671577158715971607161716271637164716571667167716871697170717171727173717471757176717771787179718071817182718371847185718671877188718971907191719271937194719571967197719871997200720172027203720472057206720772087209721072117212721372147215721672177218721972207221722272237224722572267227722872297230723172327233723472357236723772387239724072417242724372447245724672477248724972507251725272537254725572567257725872597260726172627263726472657266726772687269727072717272727372747275727672777278727972807281728272837284728572867287728872897290729172927293729472957296729772987299730073017302730373047305730673077308730973107311731273137314731573167317731873197320732173227323732473257326732773287329733073317332733373347335733673377338733973407341734273437344734573467347734873497350735173527353735473557356735773587359736073617362736373647365736673677368736973707371737273737374737573767377737873797380738173827383738473857386738773887389739073917392739373947395739673977398739974007401740274037404740574067407740874097410741174127413741474157416741774187419742074217422742374247425742674277428742974307431743274337434743574367437743874397440744174427443744474457446744774487449745074517452745374547455745674577458745974607461746274637464746574667467746874697470747174727473747474757476747774787479748074817482748374847485748674877488748974907491749274937494749574967497749874997500750175027503750475057506750775087509751075117512751375147515751675177518751975207521752275237524752575267527752875297530753175327533753475357536753775387539754075417542754375447545754675477548754975507551755275537554755575567557755875597560756175627563756475657566756775687569757075717572757375747575757675777578757975807581758275837584758575867587758875897590759175927593759475957596759775987599760076017602760376047605760676077608760976107611761276137614761576167617761876197620762176227623762476257626762776287629763076317632763376347635763676377638763976407641764276437644764576467647764876497650765176527653765476557656765776587659766076617662766376647665766676677668766976707671767276737674767576767677767876797680768176827683768476857686768776887689769076917692769376947695769676977698769977007701770277037704770577067707770877097710771177127713771477157716771777187719772077217722772377247725772677277728772977307731773277337734773577367737773877397740774177427743774477457746774777487749775077517752775377547755775677577758775977607761776277637764776577667767776877697770777177727773777477757776777777787779778077817782778377847785778677877788778977907791779277937794779577967797779877997800780178027803780478057806780778087809781078117812781378147815781678177818781978207821782278237824782578267827782878297830783178327833783478357836783778387839784078417842784378447845784678477848784978507851785278537854785578567857785878597860786178627863786478657866786778687869787078717872787378747875787678777878787978807881788278837884788578867887788878897890789178927893789478957896789778987899790079017902790379047905790679077908790979107911791279137914791579167917791879197920792179227923792479257926792779287929793079317932793379347935793679377938793979407941794279437944794579467947794879497950795179527953795479557956795779587959796079617962796379647965796679677968796979707971797279737974797579767977797879797980798179827983798479857986798779887989799079917992799379947995799679977998799980008001 |
- (function () {
- 'use strict';
- class GameConfig {
- constructor() { }
- static init() {
- var reg = Laya.ClassUtils.regClass;
- }
- }
- GameConfig.width = 720;
- GameConfig.height = 1280;
- GameConfig.scaleMode = "fixedwidth";
- GameConfig.screenMode = "none";
- GameConfig.alignV = "top";
- GameConfig.alignH = "left";
- GameConfig.startScene = "Window/TaskContentView.scene";
- GameConfig.sceneRoot = "";
- GameConfig.debug = false;
- GameConfig.stat = false;
- GameConfig.physicsDebug = false;
- GameConfig.exportSceneToJson = true;
- GameConfig.init();
- class rewarddata {
- constructor(_rewarditem) {
- this.rewarditem = _rewarditem;
- }
- }
- var systemtype;
- (function (systemtype) {
- systemtype[systemtype["ios"] = 0] = "ios";
- systemtype[systemtype["android"] = 1] = "android";
- systemtype[systemtype["other"] = 2] = "other";
- })(systemtype || (systemtype = {}));
- var ColliderLay;
- (function (ColliderLay) {
- ColliderLay[ColliderLay["plane"] = Laya.Physics3DUtils.COLLISIONFILTERGROUP_CUSTOMFILTER1] = "plane";
- ColliderLay[ColliderLay["obstacle"] = Laya.Physics3DUtils.COLLISIONFILTERGROUP_CUSTOMFILTER2] = "obstacle";
- ColliderLay[ColliderLay["monster"] = Laya.Physics3DUtils.COLLISIONFILTERGROUP_CUSTOMFILTER3] = "monster";
- ColliderLay[ColliderLay["bullet"] = Laya.Physics3DUtils.COLLISIONFILTERGROUP_CUSTOMFILTER4] = "bullet";
- ColliderLay[ColliderLay["end"] = Laya.Physics3DUtils.COLLISIONFILTERGROUP_CUSTOMFILTER5] = "end";
- ColliderLay[ColliderLay["grass"] = Laya.Physics3DUtils.COLLISIONFILTERGROUP_CUSTOMFILTER6] = "grass";
- ColliderLay[ColliderLay["player"] = Laya.Physics3DUtils.COLLISIONFILTERGROUP_CUSTOMFILTER7] = "player";
- })(ColliderLay || (ColliderLay = {}));
- var TouchState;
- (function (TouchState) {
- TouchState[TouchState["none"] = 0] = "none";
- TouchState[TouchState["down"] = 1] = "down";
- TouchState[TouchState["up"] = 2] = "up";
- TouchState[TouchState["slider"] = 3] = "slider";
- TouchState[TouchState["slidermove"] = 4] = "slidermove";
- })(TouchState || (TouchState = {}));
- var GameState;
- (function (GameState) {
- GameState[GameState["None"] = 0] = "None";
- GameState[GameState["Ready"] = 1] = "Ready";
- GameState[GameState["Idle"] = 2] = "Idle";
- GameState[GameState["Start"] = 3] = "Start";
- GameState[GameState["Playing"] = 4] = "Playing";
- GameState[GameState["Pause"] = 5] = "Pause";
- GameState[GameState["Resurrection"] = 6] = "Resurrection";
- GameState[GameState["Die"] = 7] = "Die";
- GameState[GameState["Lose"] = 8] = "Lose";
- GameState[GameState["Win"] = 9] = "Win";
- GameState[GameState["Over"] = 10] = "Over";
- })(GameState || (GameState = {}));
- var skintype;
- (function (skintype) {
- skintype[skintype["role"] = 1] = "role";
- skintype[skintype["weapon"] = 2] = "weapon";
- skintype[skintype["tw"] = 3] = "tw";
- })(skintype || (skintype = {}));
- var skinstate;
- (function (skinstate) {
- skinstate[skinstate["useing"] = 0] = "useing";
- skinstate[skinstate["lock"] = 1] = "lock";
- skinstate[skinstate["getnoues"] = 2] = "getnoues";
- })(skinstate || (skinstate = {}));
- var requiretype;
- (function (requiretype) {
- requiretype[requiretype["\u7CFB\u7EDF\u8D60\u9001"] = 1] = "\u7CFB\u7EDF\u8D60\u9001";
- requiretype[requiretype["\u91D1\u5E01\u8D2D\u4E70"] = 2] = "\u91D1\u5E01\u8D2D\u4E70";
- requiretype[requiretype["\u89C2\u770B\u89C6\u9891"] = 3] = "\u89C2\u770B\u89C6\u9891";
- requiretype[requiretype["\u5206\u4EAB"] = 4] = "\u5206\u4EAB";
- requiretype[requiretype["\u7B7E\u5230"] = 5] = "\u7B7E\u5230";
- requiretype[requiretype["\u6D3B\u52A8"] = 6] = "\u6D3B\u52A8";
- requiretype[requiretype["\u901A\u8FC7\u5173\u5361"] = 7] = "\u901A\u8FC7\u5173\u5361";
- requiretype[requiretype["\u7D2F\u8BA1\u767B\u9646"] = 8] = "\u7D2F\u8BA1\u767B\u9646";
- requiretype[requiretype["\u9080\u8BF7\u4EBA\u6570\u8FBE\u5230"] = 9] = "\u9080\u8BF7\u4EBA\u6570\u8FBE\u5230";
- requiretype[requiretype["\u7816\u77F3\u8D2D\u4E70"] = 10] = "\u7816\u77F3\u8D2D\u4E70";
- })(requiretype || (requiretype = {}));
- var AccountConfig;
- (function (AccountConfig) {
- AccountConfig[AccountConfig["crop"] = 0] = "crop";
- AccountConfig[AccountConfig["things"] = 1] = "things";
- AccountConfig[AccountConfig["land"] = 2] = "land";
- AccountConfig[AccountConfig["global"] = 3] = "global";
- AccountConfig[AccountConfig["enemy"] = 4] = "enemy";
- AccountConfig[AccountConfig["config"] = 5] = "config";
- AccountConfig[AccountConfig["entity"] = 6] = "entity";
- AccountConfig[AccountConfig["sign"] = 7] = "sign";
- AccountConfig[AccountConfig["rewards"] = 8] = "rewards";
- AccountConfig[AccountConfig["achievement"] = 9] = "achievement";
- AccountConfig[AccountConfig["invite"] = 10] = "invite";
- AccountConfig[AccountConfig["mission"] = 11] = "mission";
- AccountConfig[AccountConfig["roads"] = 12] = "roads";
- AccountConfig[AccountConfig["treasure_click"] = 13] = "treasure_click";
- AccountConfig[AccountConfig["theme"] = 14] = "theme";
- AccountConfig[AccountConfig["lottery"] = 15] = "lottery";
- AccountConfig[AccountConfig["exchange"] = 16] = "exchange";
- })(AccountConfig || (AccountConfig = {}));
- var AccountUser;
- (function (AccountUser) {
- AccountUser[AccountUser["money"] = 0] = "money";
- AccountUser[AccountUser["diamond"] = 1] = "diamond";
- AccountUser[AccountUser["user_id"] = 2] = "user_id";
- AccountUser[AccountUser["game_times"] = 3] = "game_times";
- AccountUser[AccountUser["get_themes"] = 4] = "get_themes";
- AccountUser[AccountUser["video_times"] = 5] = "video_times";
- AccountUser[AccountUser["equip_themes"] = 6] = "equip_themes";
- AccountUser[AccountUser["last_action_time"] = 7] = "last_action_time";
- AccountUser[AccountUser["last_favorite_time"] = 8] = "last_favorite_time";
- AccountUser[AccountUser["progress_themes"] = 9] = "progress_themes";
- AccountUser[AccountUser["revival"] = 10] = "revival";
- AccountUser[AccountUser["stage"] = 11] = "stage";
- })(AccountUser || (AccountUser = {}));
- var heroAttr;
- (function (heroAttr) {
- heroAttr[heroAttr["id"] = 0] = "id";
- heroAttr[heroAttr["name"] = 1] = "name";
- heroAttr[heroAttr["quality"] = 2] = "quality";
- heroAttr[heroAttr["icon"] = 3] = "icon";
- heroAttr[heroAttr["prefab"] = 4] = "prefab";
- heroAttr[heroAttr["require_num"] = 5] = "require_num";
- heroAttr[heroAttr["require_type"] = 6] = "require_type";
- })(heroAttr || (heroAttr = {}));
- var signdata;
- (function (signdata) {
- signdata[signdata["sign_days"] = 0] = "sign_days";
- signdata[signdata["sign_time"] = 1] = "sign_time";
- })(signdata || (signdata = {}));
- var entity;
- (function (entity) {
- entity[entity["id"] = 0] = "id";
- entity[entity["name"] = 1] = "name";
- entity[entity["entity_id"] = 2] = "entity_id";
- entity[entity["icon"] = 3] = "icon";
- })(entity || (entity = {}));
- var skinattr;
- (function (skinattr) {
- skinattr[skinattr["effectValue_1"] = 0] = "effectValue_1";
- skinattr[skinattr["effectValue_2"] = 1] = "effectValue_2";
- skinattr[skinattr["effectValue_3"] = 2] = "effectValue_3";
- skinattr[skinattr["effectValue_4"] = 3] = "effectValue_4";
- })(skinattr || (skinattr = {}));
- class TtSdk {
- constructor() {
- TtSdk.instance = this;
- console.log("new record");
- }
- static get Instance() {
- if (TtSdk.instance) {
- return TtSdk.instance;
- }
- else {
- var curmanager = new TtSdk();
- curmanager.OnNew();
- return curmanager;
- }
- }
- static InitVideo() {
- if (!Laya.Browser.window.conch)
- return;
- TtSdk.Conch = Laya.Browser.window.conch;
- TtSdk.PlatformClass = Laya.Browser.window["PlatformClass"];
- TtSdk.IsAndroid = TtSdk.Conch.config.getOS() == "Conch-android";
- if (TtSdk.IsAndroid) {
- TtSdk.JavaClassAdHelper = TtSdk.PlatformClass.createClass("com.meta.android.mpg.cm.MetaAd");
- console.log(11111111111111111);
- console.log(TtSdk.JavaClassAdHelper);
- TtSdk.MainActivity = TtSdk.PlatformClass.createClass("demo.MainActivity");
- console.log(2222222222222222);
- console.log(TtSdk.MainActivity);
- TtSdk.MainActivity.callWithBack((isback) => {
- TtSdk.Application = isback;
- console.log(333333333333333333);
- console.log(isback);
- }, "getApp");
- TtSdk.JavaClassAdHelper.callWithBack((isback) => {
- if (isback) {
- console.log("SDK初始化成功");
- }
- }, "init", TtSdk.Application, "1135231362");
- TtSdk.IsReady = true;
- }
- }
- static ShowVideo(_cb) {
- if (TtSdk.IsAndroid) {
- TtSdk.JavaClassAdHelper.callWithBack((isOk) => {
- _cb && _cb(isOk);
- console.log("SDK看视频成功");
- }, "showVideoAd", TtSdk.MainActivity);
- }
- }
- static Showbanner() {
- }
- static RecordEvent(_desc) {
- }
- static Clear() {
- }
- RecordStart() {
- if (!Laya.Browser.onMobile)
- return;
- }
- RecordStop() {
- }
- ShareVideo(cb = null) {
- }
- static Share(cb = null) {
- }
- OnNew() {
- }
- static CreateMoreGameBtn(_pos) {
- }
- static ShowLoading(title = "加载中...") {
- if (this.isShowing)
- return;
- this.isShowing = true;
- }
- static HideLoading() {
- this.isShowing = false;
- }
- static CheckWXUpdate() {
- }
- static shake() {
- }
- static shakeLong() {
- }
- static Shake(_short = true) {
- }
- static showToast(text) {
- }
- static get SystemFrom() {
- if (!Laya.Browser.onWeiXin)
- return systemtype.other;
- return systemtype.other;
- }
- static get IsLongScreenSystem() {
- if (!Laya.Browser.onWeiXin)
- return false;
- return false;
- }
- static SingletonList_expand() {
- console.log(Laya.SingletonList.prototype);
- Laya.SingletonList.prototype["_remove"] = function (index) {
- if (index == -1) {
- return;
- }
- this.length--;
- if (index !== this.length) {
- var end = this.elements[this.length];
- if (end) {
- this.elements[index] = end;
- end._setIndexInList(index);
- }
- }
- };
- var old_func = Laya.SimpleSingletonList.prototype["add"];
- Laya.SimpleSingletonList.prototype["add"] = function (element) {
- var index = element._getIndexInList();
- if (index !== -1) {
- return;
- }
- old_func.call(this, element);
- };
- }
- }
- TtSdk.videlAdUnitId = "5c4e6g4617991fkgl6";
- TtSdk.bannerAdUnitId = "3ss56gpelt55a7e456";
- TtSdk.firstVideo = true;
- TtSdk.IsReady = false;
- TtSdk.canshow = true;
- TtSdk.isShowing = false;
- TtSdk.CanShake = true;
- var Event = Laya.Event;
- var HttpRequest = Laya.HttpRequest;
- const PROTOCOL_URL = "https://samuraitoutiaoapi.xwxgame.com/";
- class PROTOCOLS {
- }
- PROTOCOLS.Login = "user/login";
- PROTOCOLS.game = "game/start";
- PROTOCOLS.end = "game/play";
- PROTOCOLS.Sign = "sign/sign";
- PROTOCOLS.SignAhead = "sign/ahead";
- PROTOCOLS.entertreasure = "treasure/enter";
- PROTOCOLS.opentreasure = "treasure/open";
- PROTOCOLS.Buy = "theme/buy";
- PROTOCOLS.Equip = "theme/equip";
- PROTOCOLS.share = "fission/share";
- PROTOCOLS.vd = "fission/vd";
- PROTOCOLS.revival = "game/revival";
- PROTOCOLS.fission = "theme/fission";
- PROTOCOLS.themefission = "theme/fission";
- PROTOCOLS.treasure = "treasure/click";
- PROTOCOLS.Config = "config/table";
- PROTOCOLS.Lottery = "lottery/lottery";
- PROTOCOLS.GetAchieve = "achievement/getRewards";
- class NetworkManager {
- static get Instance() {
- if (NetworkManager.instance) {
- return NetworkManager.instance;
- }
- else {
- return new NetworkManager();
- }
- }
- constructor() {
- NetworkManager.instance = this;
- }
- login(progresscb, completecb, errorcb) {
- var userInfor = PlayerAccount.CurrentAccount;
- 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=${userInfor.ver}`;
- let httpRequest = new HttpRequest();
- httpRequest.once(Event.PROGRESS, this, this.onHttpRequestProgress, [progresscb, httpRequest]);
- httpRequest.once(Event.COMPLETE, this, this.onLoginRequestComplete, [completecb, httpRequest]);
- httpRequest.once(Event.ERROR, this, this.onHttpRequestError, [errorcb, httpRequest]);
- httpRequest.send(PROTOCOL_URL + PROTOCOLS.Login, args, "post", "text");
- }
- onHttpRequestProgress(progresscb, httpRequest) {
- if (progresscb) {
- console.log("HttpRequestProgress:...");
- progresscb.run();
- }
- }
- onLoginRequestComplete(completecb, httpRequest) {
- let data = JSON.parse(httpRequest.data);
- if (data["code"] != "0") {
- console.log("登录异常错误!错误信息:", httpRequest.data);
- console.log("登录异常错误!错误信息:= " + data["code"], "httpRequest.dat");
- return;
- }
- PlayerAccount.ServerTime = data["t"];
- console.log("登录正式成功");
- PlayerAccount.CurrentAccount.SetAccountData(data, completecb);
- }
- onHttpRequestError(errorcb, httpRequest) {
- if (errorcb != null) {
- errorcb.runWith(httpRequest);
- }
- console.log("Error! Http request error.. ", "httpRequest.dat");
- TtSdk.ShowLoading("连接网络失败...");
- Laya.timer.once(8000, this, () => { TtSdk.HideLoading(); });
- console.log("Error! Http request error..." + httpRequest.data);
- }
- HttpPostRequest(protocol, param, completecb, errorcb, hasToken = true) {
- let args = "";
- let url = PROTOCOL_URL + protocol;
- var accountdata = PlayerAccount.CurAccountData;
- if (hasToken == true) {
- args = `token=${accountdata.m_token}&`;
- }
- TtSdk.ShowLoading("连接网络中...");
- if (protocol == PROTOCOLS.game || protocol == PROTOCOLS.end || protocol == PROTOCOLS.fission || protocol == PROTOCOLS.vd
- || protocol == PROTOCOLS.themefission || protocol == PROTOCOLS.Lottery || protocol == PROTOCOLS.opentreasure) {
- let str = "abcdefghijkimnopqrstuvwxyz0123456789";
- let code = "{";
- let mask = "";
- for (let i = 0; i < 4; i++) {
- mask += str[Math.floor(Math.random() * 100) % str.length];
- }
- for (let i = 0; i < param.length; i++) {
- for (let key in param[i]) {
- code += `\"${key}\":\"${param[i][key]}\"`;
- }
- if (i < param.length - 1) {
- code += ",";
- }
- else {
- code += "}";
- }
- }
- args += "_r=" + mask + this.base64Encode(code);
- }
- else {
- if (param != null) {
- for (let i = 0; i < param.length; i++) {
- for (let key in param[i]) {
- let val = param[i][key];
- args += `${key}=${val}`;
- if (i < param.length - 1) {
- args += "&";
- }
- }
- }
- }
- }
- let httpRequest = new HttpRequest();
- httpRequest.once(Event.COMPLETE, this, this.onHttpRequestComplete, [completecb, errorcb, httpRequest]);
- httpRequest.once(Event.ERROR, this, this.onHttpRequestError, [errorcb, httpRequest]);
- httpRequest.send(url, args, "post", "text");
- }
- onHttpRequestComplete(succeedcb, failurecb, httpRequest) {
- TtSdk.HideLoading();
- let data = JSON.parse(httpRequest.data);
- if (data["code"] == 0) {
- PlayerAccount.CurrentAccount.SetAccountData(data, null);
- if (succeedcb != null) {
- succeedcb.runWith(data);
- }
- }
- else {
- if (failurecb != null) {
- failurecb.runWith(data);
- }
- console.log("Error! Http request complete error, code: " + data["code"] + " message: " + data["message"]);
- }
- }
- base64Encode(str) {
- var c1, c2, c3;
- var base64EncodeChars = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/";
- var i = 0, len = str.length, string = '';
- while (i < len) {
- c1 = str.charCodeAt(i++) & 0xff;
- if (i == len) {
- string += base64EncodeChars.charAt(c1 >> 2);
- string += base64EncodeChars.charAt((c1 & 0x3) << 4);
- string += "==";
- break;
- }
- c2 = str.charCodeAt(i++);
- if (i == len) {
- string += base64EncodeChars.charAt(c1 >> 2);
- string += base64EncodeChars.charAt(((c1 & 0x3) << 4) | ((c2 & 0xF0) >> 4));
- string += base64EncodeChars.charAt((c2 & 0xF) << 2);
- string += "=";
- break;
- }
- c3 = str.charCodeAt(i++);
- string += base64EncodeChars.charAt(c1 >> 2);
- string += base64EncodeChars.charAt(((c1 & 0x3) << 4) | ((c2 & 0xF0) >> 4));
- string += base64EncodeChars.charAt(((c2 & 0xF) << 2) | ((c3 & 0xC0) >> 6));
- string += base64EncodeChars.charAt(c3 & 0x3F);
- }
- return string;
- }
- }
- class Dictionary {
- constructor() {
- this.keys = new Array();
- this.values = new Array();
- }
- get count() {
- return this.keys.length;
- }
- add(key, value) {
- let index = this.keys.indexOf(key);
- if (index == -1) {
- this.keys.push(key);
- this.values.push(value);
- }
- else {
- this.values[index] = value;
- }
- }
- remove(key) {
- let index = this.keys.indexOf(key);
- if (index != -1) {
- this.keys.splice(index, 1);
- this.values.splice(index, 1);
- }
- }
- getValue(key) {
- let index = this.keys.indexOf(key);
- if (index != -1) {
- return this.values[index];
- }
- return null;
- }
- containKey(key) {
- let index = this.keys.indexOf(key);
- if (index != -1) {
- return true;
- }
- return false;
- }
- containValue(value) {
- let index = this.values.indexOf(value);
- if (index != -1) {
- return true;
- }
- return false;
- }
- clear() {
- this.keys.length = 0;
- this.values.length = 0;
- }
- }
- var EventType;
- (function (EventType) {
- EventType[EventType["EnterGame"] = 0] = "EnterGame";
- EventType[EventType["GameIdle"] = 1] = "GameIdle";
- EventType[EventType["GetAd"] = 2] = "GetAd";
- EventType[EventType["DrawEnd"] = 3] = "DrawEnd";
- EventType[EventType["LevelCreateComplete"] = 4] = "LevelCreateComplete";
- EventType[EventType["InputState"] = 5] = "InputState";
- EventType[EventType["getmoney"] = 6] = "getmoney";
- EventType[EventType["UseSkin"] = 7] = "UseSkin";
- EventType[EventType["Cut"] = 8] = "Cut";
- EventType[EventType["Chui"] = 9] = "Chui";
- EventType[EventType["Running"] = 10] = "Running";
- EventType[EventType["Hit"] = 11] = "Hit";
- EventType[EventType["TriggerGold"] = 12] = "TriggerGold";
- EventType[EventType["SortPrecent"] = 13] = "SortPrecent";
- EventType[EventType["BoosDie"] = 14] = "BoosDie";
- })(EventType || (EventType = {}));
- class EventManager {
- static On(_mode, caller, fun, args = []) {
- EventManager.curdispather.on(EventType[_mode], caller, fun, args);
- }
- static Off(_mode, caller, fun, args = []) {
- EventManager.curdispather.off(EventType[_mode], caller, fun);
- }
- static Trigger(_mode, args = []) {
- EventManager.curdispather.event(EventType[_mode], args);
- }
- static GameOn(_mode, caller, fun, args = []) {
- EventManager.curdispather.on(GameState[_mode], caller, fun, args);
- }
- static GameOff(_mode, caller, fun, args = []) {
- EventManager.curdispather.off(GameState[_mode], caller, fun);
- }
- static GameTrigger(_mode, args = []) {
- EventManager.curdispather.event(GameState[_mode], args);
- }
- static InputOn(_mode, caller, fun, args = []) {
- EventManager.curdispather.on(TouchState[_mode], caller, fun, args);
- }
- static InputOff(_mode, caller, fun, args = []) {
- EventManager.curdispather.off(TouchState[_mode], caller, fun);
- }
- static InputTrigger(_mode, args = []) {
- EventManager.curdispather.event(TouchState[_mode], args);
- }
- }
- EventManager.curdispather = new Laya.EventDispatcher();
- var Sprite3D = Laya.Sprite3D;
- class PoolManager {
- constructor() {
- PoolManager.PoolManagerInstance = this;
- EventManager.On(EventType.LevelCreateComplete, this, PoolManager.ClearPool);
- }
- static get Instance() {
- if (PoolManager.PoolManagerInstance) {
- return PoolManager.PoolManagerInstance;
- }
- else {
- var instance = new PoolManager();
- return instance;
- }
- }
- static GetSprite3D(_obj) {
- var objName = _obj.name;
- if (this.Sprite3DDic[objName] != null && this.Sprite3DDic[objName] != undefined) {
- if (this.Sprite3DDic[objName].length > 0) {
- var obj = this.Sprite3DDic[objName][0];
- if (!obj || obj.destroyed)
- obj = Sprite3D.instantiate(_obj);
- this.Sprite3DDic[objName].splice(0, 1);
- obj.transform.position = _obj.transform.position.clone();
- obj.transform.rotation = _obj.transform.rotation.clone();
- obj.transform.setWorldLossyScale(_obj.transform.getWorldLossyScale());
- obj.active = true;
- return obj;
- }
- else {
- var newobj = Sprite3D.instantiate(_obj);
- newobj.active = true;
- return newobj;
- }
- }
- else {
- var newobj = Sprite3D.instantiate(_obj);
- newobj.active = true;
- return newobj;
- }
- }
- static RecoverSprite3D(_obj, _active = false) {
- if (!_obj) {
- console.warn("PoolManager Recover Error!", null);
- return;
- }
- if (_obj.destroyed) {
- console.warn("PoolManager Recover Error!", "destroyed");
- return;
- }
- if (!_active && _obj.active == false) {
- console.warn("PoolManager Recover Error!", _obj.name);
- return;
- }
- var objName = _obj.name;
- if (this.Sprite3DDic[objName] != null && this.Sprite3DDic[objName] != undefined) {
- var array = this.Sprite3DDic[objName];
- if (array.length > this.PoolSize) {
- _obj.destroy();
- return;
- }
- else {
- array.push(_obj);
- }
- }
- else {
- array = [];
- array.push(_obj);
- this.Sprite3DDic[objName] = array;
- }
- _obj.transform.position = new Laya.Vector3(0, 0, -100);
- _obj.removeSelf();
- _obj.active = false;
- }
- static ClearPool() {
- for (var key in this.Sprite3DDic) {
- var objs = this.Sprite3DDic[key];
- for (var i = 0; i < objs.length; i++) {
- objs[i].destroy();
- }
- }
- this.Sprite3DDic = {};
- }
- }
- PoolManager.PoolSize = 80;
- PoolManager.Sprite3DDic = {};
- var Vector3 = Laya.Vector3;
- var RoleState;
- (function (RoleState) {
- RoleState[RoleState["None"] = 0] = "None";
- RoleState[RoleState["Idle"] = 1] = "Idle";
- RoleState[RoleState["Runing"] = 2] = "Runing";
- RoleState[RoleState["Awake"] = 3] = "Awake";
- RoleState[RoleState["Die"] = 4] = "Die";
- RoleState[RoleState["Attack"] = 5] = "Attack";
- RoleState[RoleState["Escape"] = 6] = "Escape";
- RoleState[RoleState["Win"] = 7] = "Win";
- RoleState[RoleState["Wait"] = 8] = "Wait";
- })(RoleState || (RoleState = {}));
- class RoleData {
- constructor(_id, _startpos) {
- this.id = _id;
- this.startpos = _startpos;
- }
- }
- class Role extends Laya.Script3D {
- constructor() {
- super(...arguments);
- this.startpos = new Vector3();
- this.end = false;
- this.clear = false;
- this.die = false;
- this.wudi = false;
- }
- static Create(_data, arge = null) {
- return null;
- }
- Init(_sprite) {
- this.cursprite = _sprite;
- this.curanimator = _sprite.getChildAt(0).getComponent(Laya.Animator);
- this.curanimator.enabled = true;
- this.ChangeState(RoleState.Idle);
- this.startpos = this.cursprite.transform.position.clone();
- this.clear = false;
- this.end = false;
- EventManager.GameOn(GameState.Win, this, this.OnGameEnd);
- EventManager.GameOn(GameState.Lose, this, this.OnGameEnd);
- EventManager.GameOn(GameState.Playing, this, this.OnGamePlaying);
- }
- OnGameEnd() {
- this.ChangeState(RoleState.Idle);
- }
- OnGamePlaying() {
- this.ChangeState(RoleState.Idle);
- this.end = false;
- this.WithPlaying();
- }
- WithPlaying() { }
- ;
- Clear() {
- if (this.clear)
- return;
- this.clear = true;
- EventManager.GameOff(GameState.Win, this, this.OnGameEnd);
- EventManager.GameOff(GameState.Lose, this, this.OnGameEnd);
- EventManager.GameOff(GameState.Playing, this, this.OnGamePlaying);
- PoolManager.RecoverSprite3D(this.cursprite, true);
- this.OnClear();
- this.destroy();
- }
- ChangeState(_state, args = null) {
- if (_state == RoleState.Die && this.wudi)
- return;
- if (this.end)
- return;
- if (this.currolestate == _state)
- return;
- if (this.currolestate == RoleState.Die && args == null)
- return;
- if (this.currolestate == RoleState.Win)
- return;
- this.currolestate = _state;
- this.onStateChange(this.currolestate, args);
- }
- OnClear() { }
- ;
- onStateChange(_state, _data) { }
- ;
- FallLand(_minhight, cb = null) {
- this.die = true;
- if (this.cursprite.transform.position.y > _minhight) {
- var mpos = this.cursprite.transform.position.clone();
- var targetpos = new Vector3(mpos.x, _minhight, mpos.z);
- GameUtils.TweenMove(this.cursprite.transform, targetpos, 1.5, Laya.Handler.create(this, () => {
- if (cb)
- cb();
- }), Laya.Ease.quadOut);
- }
- }
- BeBoom() { }
- ;
- Provocation(_complete = null) {
- if (this.provocationclip != null) {
- this.curanimator.play(this.provocationclip);
- Laya.timer.once(2000, this, () => {
- if (_complete)
- _complete();
- this.ChangeState(RoleState.Idle);
- });
- }
- }
- }
- var Vector3$1 = Laya.Vector3;
- var buildtype;
- (function (buildtype) {
- buildtype[buildtype["barrier"] = 0] = "barrier";
- buildtype[buildtype["stand"] = 1] = "stand";
- buildtype[buildtype["road"] = 2] = "road";
- })(buildtype || (buildtype = {}));
- class builddata {
- constructor(_type, _id, _pos) {
- this.type = _type;
- this.buildid = _id;
- this.startpos = new Vector3$1(_pos.x, _pos.y, _pos.z);
- this.starteroty = _pos.w;
- }
- }
- class Building {
- constructor() {
- this.die = false;
- this.clear = false;
- }
- Init(_data) {
- this.mdata = _data;
- var buildasset = AssetManager.BuildAsset(this.mdata.type, _data.buildid);
- this.cursprite = PoolManager.GetSprite3D(buildasset);
- }
- OnInit() { }
- ;
- OnClear() { }
- ;
- Clear() {
- if (this.clear)
- return;
- this.clear = true;
- this.OnClear();
- this.cursprite.destroy();
- }
- }
- class AssetPath {
- }
- AssetPath.mainscene = "subpackage/res/mainscene/Conventional/mainscene.ls";
- AssetPath.prefab = [
- "subpackage/res/prefab/Conventional/role.lh",
- "subpackage/res/prefab/Conventional/girl.lh",
- "subpackage/res/prefab/Conventional/enemy.lh",
- "subpackage/res/prefab/Conventional/obstacle.lh",
- "subpackage/res/prefab/Conventional/bullet.lh",
- "subpackage/res/prefab/Conventional/effect.lh",
- "subpackage/res/prefab/Conventional/stand.lh",
- "subpackage/res/prefab/Conventional/road.lh",
- "subpackage/res/prefab/Conventional/weapon.lh",
- "subpackage/res/prefab/Conventional/tw.lh",
- "subpackage/res/prefab/Conventional/hand.lh",
- ];
- class AssetManager {
- constructor() {
- AssetManager.instance = this;
- }
- static get Instance() {
- if (AssetManager.instance) {
- return AssetManager.instance;
- }
- else {
- return new AssetManager();
- }
- }
- static BuildAsset(_type, _id) {
- if (_type == buildtype.barrier) {
- return this.obstacle.getValue(_id);
- }
- else if (_type == buildtype.stand) {
- return this.standbuild.getValue(_id);
- }
- return null;
- }
- }
- AssetManager.role = new Dictionary();
- AssetManager.girl = new Dictionary();
- AssetManager.enemy = new Dictionary();
- AssetManager.obstacle = new Dictionary();
- AssetManager.bullet = new Dictionary();
- AssetManager.effect = new Dictionary();
- AssetManager.standbuild = new Dictionary();
- AssetManager.road = new Dictionary();
- AssetManager.weapon = new Dictionary();
- AssetManager.tw = new Dictionary();
- var Vector3$2 = Laya.Vector3;
- class BezierCurve {
- constructor(pts) {
- this.pts = new Array();
- this.add_0 = new Vector3$2();
- this.add_1 = new Vector3$2();
- this.add_2 = new Vector3$2();
- this.end = new Vector3$2();
- this.step0_0 = new Vector3$2();
- this.step0_1 = new Vector3$2();
- this.step0_2 = new Vector3$2();
- this.step0 = new Vector3$2();
- this.step1_0 = new Vector3$2();
- this.step1_1 = new Vector3$2();
- this.step1_2 = new Vector3$2();
- this.step1 = new Vector3$2();
- this.step2_0 = new Vector3$2();
- this.step2 = new Vector3$2();
- for (var i = 0; i < pts.length; i++) {
- this.pts.push(pts[i].clone());
- }
- }
- get CurrPtr() {
- return this.currPtr;
- }
- get PathLength() {
- var le = 0;
- for (var i = 0; i < this.pts.length - 1; i++) {
- var dis = Vector3$2.distance(this.pts[i], this.pts[i + 1]);
- le += dis;
- }
- return le;
- }
- Interp(t) {
- let numSections = this.pts.length - 3;
- this.currPtr = Math.min(Math.floor(t * numSections), numSections - 1);
- let u = t * numSections - this.currPtr;
- let a = this.pts[this.currPtr];
- let b = this.pts[this.currPtr + 1];
- let c = this.pts[this.currPtr + 2];
- let d = this.pts[this.currPtr + 3];
- if (a == null || b == null || c == null || d == null) {
- return;
- }
- let uu = u * u;
- let uuu = uu * u;
- let b3 = GameUtils.ScaleVector3(b, 3);
- let c3 = GameUtils.ScaleVector3(c, 3);
- let a2 = GameUtils.ScaleVector3(a, 2);
- let b5 = GameUtils.ScaleVector3(b, 5);
- let c4 = GameUtils.ScaleVector3(c, 4);
- let b2 = GameUtils.ScaleVector3(b, 2);
- Vector3$2.subtract(b3, a, this.step0_0);
- Vector3$2.subtract(this.step0_0, c3, this.step0_1);
- Vector3$2.add(this.step0_1, d, this.step0_2);
- this.step0 = GameUtils.ScaleVector3(this.step0_2, uuu);
- Vector3$2.subtract(a2, b5, this.step1_0);
- Vector3$2.add(this.step1_0, c4, this.step1_1);
- Vector3$2.subtract(this.step1_1, d, this.step1_2);
- this.step1 = GameUtils.ScaleVector3(this.step1_2, uu);
- Vector3$2.subtract(c, a, this.step2_0);
- this.step2 = GameUtils.ScaleVector3(this.step2_0, u);
- Vector3$2.add(this.step0, this.step1, this.add_0);
- Vector3$2.add(this.add_0, this.step2, this.add_1);
- Vector3$2.add(this.add_1, b2, this.add_2);
- this.end = GameUtils.ScaleVector3(this.add_2, 0.5);
- return this.end;
- }
- }
- var REG = Laya.ClassUtils.regClass;
- var ui;
- (function (ui) {
- var Window;
- (function (Window) {
- class BaoXiangWindowUI extends Laya.Scene {
- constructor() { super(); }
- createChildren() {
- super.createChildren();
- this.createView(BaoXiangWindowUI.uiView);
- }
- }
- BaoXiangWindowUI.uiView = { "type": "Scene", "props": { "width": 720, "visible": false, "height": 1280 }, "compId": 2, "child": [{ "type": "Image", "props": { "y": 0, "x": 0, "width": 720, "var": "bg", "top": 0, "skin": "game/task4.png", "bottom": 0, "sizeGrid": "10,10,10,10" }, "compId": 12 }, { "type": "Box", "props": { "y": 186, "x": 0, "width": 720, "var": "pan", "height": 664 }, "compId": 3, "child": [{ "type": "Image", "props": { "y": 182, "x": 176, "visible": false, "var": "firstbg", "skin": "bg/-4(1).png" }, "compId": 15 }, { "type": "Image", "props": { "y": 82, "x": 146, "skin": "game/-1(1).png" }, "compId": 14 }, { "type": "Image", "props": { "y": 359, "x": 359, "width": 281, "skin": "game/huode-1-4.png", "height": 281, "anchorY": 0.5, "anchorX": 0.5 }, "compId": 6 }, { "type": "Image", "props": { "y": 358, "x": 360, "var": "icon", "skin": "icon/skin1.png", "scaleY": 1.8, "scaleX": 1.8, "rotation": 0, "anchorY": 0.5, "anchorX": 0.5 }, "compId": 7 }, { "type": "Text", "props": { "y": 520, "x": 241, "width": 237, "visible": true, "var": "skindesc", "valign": "middle", "text": "获得奖励", "height": 50, "fontSize": 40, "font": "SimSun", "color": "#f6f636", "bold": true, "align": "center", "runtime": "laya.display.Text" }, "compId": 13 }] }, { "type": "Box", "props": { "y": 788, "x": 0, "width": 720, "var": "Btn", "height": 172 }, "compId": 4, "child": [{ "type": "Button", "props": { "y": 66, "x": 360, "width": 364, "var": "getbtn", "stateNum": 1, "skin": "cheatwindow/3 - 1.png", "pivotY": 66, "pivotX": 182, "height": 131 }, "compId": 9, "child": [{ "type": "Text", "props": { "y": 27, "x": 105, "width": 229, "var": "gettex", "valign": "middle", "text": "开启宝箱", "height": 77, "fontSize": 55, "color": "#ffffff", "bold": true, "align": "center", "runtime": "laya.display.Text" }, "compId": 11 }] }, { "type": "Button", "props": { "y": 72, "x": 314, "var": "passbtn", "stateNum": 1, "skin": "game/fuhuo-1-3.png", "bottom": 0 }, "compId": 10 }] }], "animations": [{ "nodes": [{ "target": 6, "keyframes": { "rotation": [{ "value": 0, "tweenMethod": "linearNone", "tween": true, "target": 6, "key": "rotation", "index": 0 }, { "value": 45, "tweenMethod": "linearNone", "tween": true, "target": 6, "key": "rotation", "index": 5 }, { "value": 90, "tweenMethod": "linearNone", "tween": true, "target": 6, "key": "rotation", "index": 10 }] } }], "name": "ani1", "id": 1, "frameRate": 24, "action": 2 }], "loadList": ["game/task4.png", "bg/-4(1).png", "game/-1(1).png", "game/huode-1-4.png", "icon/skin1.png", "cheatwindow/3 - 1.png", "game/fuhuo-1-3.png"], "loadList3D": [] };
- Window.BaoXiangWindowUI = BaoXiangWindowUI;
- REG("ui.Window.BaoXiangWindowUI", BaoXiangWindowUI);
- class CDKViewUI extends Laya.Scene {
- constructor() { super(); }
- createChildren() {
- super.createChildren();
- this.createView(CDKViewUI.uiView);
- }
- }
- CDKViewUI.uiView = { "type": "Scene", "props": { "width": 720, "height": 1280 }, "compId": 2, "child": [{ "type": "Image", "props": { "width": 720, "top": 0, "skin": "game/zhezhao.png", "name": "bg", "bottom": 0, "sizeGrid": "10,10,10,10" }, "compId": 3 }, { "type": "Box", "props": { "y": 386, "x": 0, "width": 720, "var": "pan", "height": 508 }, "compId": 4, "child": [{ "type": "Image", "props": { "x": 86, "top": 0, "skin": "bg/cdk3.png" }, "compId": 5, "child": [{ "type": "TextInput", "props": { "y": 181, "x": 90, "width": 366, "var": "inputtext", "valign": "middle", "type": "number", "text": "123456", "skin": "bg/cdk4.png", "prompt": "请输入兑换码", "maxChars": 10, "height": 63, "fontSize": 30, "align": "center" }, "compId": 7 }] }, { "type": "Button", "props": { "y": 14, "x": 580, "var": "closebtn", "stateNum": 1, "skin": "game/cdk6.png" }, "compId": 8 }, { "type": "Button", "props": { "x": 112, "var": "backbtn", "stateNum": 1, "skin": "game/cdk1.png", "bottom": 0 }, "compId": 9 }, { "type": "Button", "props": { "x": 386, "var": "getbtn", "stateNum": 1, "skin": "game/cdk2.png", "bottom": 0 }, "compId": 10 }] }], "loadList": ["game/zhezhao.png", "bg/cdk3.png", "bg/cdk4.png", "game/cdk6.png", "game/cdk1.png", "game/cdk2.png"], "loadList3D": [] };
- Window.CDKViewUI = CDKViewUI;
- REG("ui.Window.CDKViewUI", CDKViewUI);
- class CheatWindowUI extends Laya.Scene {
- constructor() { super(); }
- createChildren() {
- super.createChildren();
- this.createView(CheatWindowUI.uiView);
- }
- }
- CheatWindowUI.uiView = { "type": "Scene", "props": { "width": 720, "height": 1280 }, "compId": 2, "child": [{ "type": "Image", "props": { "width": 720, "var": "bg", "top": 0, "skin": "game/zhezhao.png", "bottom": 0, "sizeGrid": "10,10,10,10" }, "compId": 3 }, { "type": "Box", "props": { "y": 640, "x": 360, "width": 720, "var": "pan", "height": 700, "anchorY": 0.5, "anchorX": 0.5 }, "compId": 4, "child": [{ "type": "Image", "props": { "y": 0, "x": 158, "var": "tippan", "skin": "cheatwindow/2.png" }, "compId": 5 }, { "type": "Image", "props": { "y": 294, "x": 360, "width": 181, "skin": "cheatwindow/kuangdiankaixiang-1-3.png", "pivotY": 89, "pivotX": 91, "height": 177 }, "compId": 6 }] }, { "type": "Box", "props": { "y": 814, "x": 0, "width": 720, "var": "Btn", "height": 155 }, "compId": 8, "child": [{ "type": "Button", "props": { "y": 52, "x": 360, "var": "clickbtn", "stateNum": 1, "skin": "cheatwindow/3.png", "anchorY": 0.5, "anchorX": 0.5 }, "compId": 9 }, { "type": "Button", "props": { "x": 312, "var": "passbtn", "stateNum": 1, "skin": "cheatwindow/4.png", "bottom": 0 }, "compId": 11 }] }], "animations": [{ "nodes": [{ "target": 4, "keyframes": { "scaleY": [{ "value": 0.4, "tweenMethod": "linearNone", "tween": true, "target": 4, "key": "scaleY", "index": 0 }, { "value": 1, "tweenMethod": "linearNone", "tween": true, "target": 4, "key": "scaleY", "index": 10 }], "scaleX": [{ "value": 0.4, "tweenMethod": "linearNone", "tween": true, "target": 4, "key": "scaleX", "index": 0 }, { "value": 1, "tweenMethod": "linearNone", "tween": true, "target": 4, "key": "scaleX", "index": 10 }] } }, { "target": 8, "keyframes": { "visible": [{ "value": false, "tweenMethod": "linearNone", "tween": false, "target": 8, "key": "visible", "index": 0 }, { "value": true, "tweenMethod": "linearNone", "tween": false, "target": 8, "key": "visible", "index": 10 }] } }], "name": "ani1", "id": 1, "frameRate": 24, "action": 0 }, { "nodes": [{ "target": 6, "keyframes": { "scaleY": [{ "value": 1, "tweenMethod": "linearNone", "tween": true, "target": 6, "key": "scaleY", "index": 0 }, { "value": 1.2, "tweenMethod": "linearNone", "tween": true, "target": 6, "key": "scaleY", "index": 3 }, { "value": 1, "tweenMethod": "linearNone", "tween": true, "target": 6, "key": "scaleY", "index": 5 }], "scaleX": [{ "value": 1, "tweenMethod": "linearNone", "tween": true, "target": 6, "key": "scaleX", "index": 0 }, { "value": 1.2, "tweenMethod": "linearNone", "tween": true, "target": 6, "key": "scaleX", "index": 3 }, { "value": 1, "tweenMethod": "linearNone", "tween": true, "target": 6, "key": "scaleX", "index": 5 }] } }], "name": "ani2", "id": 2, "frameRate": 24, "action": 0 }], "loadList": ["game/zhezhao.png", "cheatwindow/2.png", "cheatwindow/kuangdiankaixiang-1-3.png", "cheatwindow/3.png", "cheatwindow/4.png"], "loadList3D": [] };
- Window.CheatWindowUI = CheatWindowUI;
- REG("ui.Window.CheatWindowUI", CheatWindowUI);
- class ChestWindowUI extends Laya.Scene {
- constructor() { super(); }
- createChildren() {
- super.createChildren();
- this.createView(ChestWindowUI.uiView);
- }
- }
- ChestWindowUI.uiView = { "type": "Scene", "props": { "width": 720, "height": 1280 }, "compId": 2, "child": [{ "type": "Image", "props": { "width": 720, "top": 0, "skin": "game/pifu-1-13.png", "name": "bg", "bottom": 0, "sizeGrid": "10,10,10,10" }, "compId": 3 }, { "type": "Button", "props": { "y": 78, "x": 38, "var": "homebtn", "stateNum": 1, "skin": "game/pifu-1-1.png" }, "compId": 4 }, { "type": "Box", "props": { "y": 203, "x": 0, "width": 720, "var": "chestpan", "height": 950 }, "compId": 26, "child": [{ "type": "Image", "props": { "y": 147, "x": 37, "width": 645, "skin": "game/dalandi.png", "height": 655, "sizeGrid": "65,65,65,65" }, "compId": 30, "child": [{ "type": "List", "props": { "y": 28, "x": 26, "width": 592, "var": "chestlist", "spaceY": 25, "spaceX": 25, "height": 599 }, "compId": 5, "child": [{ "type": "Box", "props": { "width": 180, "renderType": "render", "height": 180 }, "compId": 7, "child": [{ "type": "Image", "props": { "width": 180, "skin": "game/xiaodi.png", "height": 180, "sizeGrid": "35,35,35,35" }, "compId": 8 }, { "type": "Image", "props": { "y": 11, "x": 10, "skin": "game/baoxian.png", "name": "chest" }, "compId": 13, "child": [{ "type": "Image", "props": { "y": 106, "x": 101, "skin": "game/shipin.png", "name": "video" }, "compId": 19 }] }, { "type": "Box", "props": { "y": 15, "x": 15, "width": 150, "visible": false, "name": "skin", "height": 150 }, "compId": 14, "child": [{ "type": "Image", "props": { "y": 75, "x": 75, "skin": "icon/skin1.png", "name": "icon", "anchorY": 0.5, "anchorX": 0.5 }, "compId": 15 }] }, { "type": "Box", "props": { "y": 15, "x": 15, "width": 150, "visible": false, "name": "gold", "height": 150 }, "compId": 16, "child": [{ "type": "Image", "props": { "y": 53, "x": 29, "width": 41, "skin": "game/pifu-1-10.png", "height": 44 }, "compId": 17 }, { "type": "Text", "props": { "y": 59, "x": 75, "width": 68, "valign": "middle", "text": "100", "name": "gold", "height": 31, "fontSize": 30, "font": "Arial", "color": "#ffffff", "bold": true, "align": "left", "runtime": "laya.display.Text" }, "compId": 18 }] }, { "type": "Button", "props": { "y": 0, "x": 0, "width": 180, "name": "getbtn", "height": 180 }, "compId": 25 }] }] }] }, { "type": "Box", "props": { "y": 875, "x": 0, "width": 720, "var": "ys", "height": 150 }, "compId": 20, "child": [{ "type": "Image", "props": { "y": 8, "x": 234, "skin": "game/KeyIconBase.png" }, "compId": 31, "child": [{ "type": "Image", "props": { "y": 0, "x": 0, "var": "key1", "skin": "game/KeyIcon.png" }, "compId": 21 }] }, { "type": "Image", "props": { "y": 8, "x": 322, "skin": "game/KeyIconBase.png" }, "compId": 32, "child": [{ "type": "Image", "props": { "y": 0, "x": 0, "var": "key2", "skin": "game/KeyIcon.png" }, "compId": 23 }] }, { "type": "Image", "props": { "y": 8, "x": 410, "skin": "game/KeyIconBase.png" }, "compId": 33, "child": [{ "type": "Image", "props": { "y": 0, "x": 0, "var": "key3", "skin": "game/KeyIcon.png" }, "compId": 22 }] }, { "type": "Text", "props": { "y": -60, "x": 257, "width": 205, "var": "opspr", "valign": "middle", "text": "领取奖励", "styleSkin": "game/fasf.png", "height": 60, "fontSize": 45, "color": "#ffffff", "bold": true, "align": "center", "runtime": "laya.display.Text" }, "compId": 27 }, { "type": "Button", "props": { "y": 8, "x": 190, "visible": false, "var": "getys", "stateNum": 1, "skin": "game/baoxiang-1-14.png" }, "compId": 9, "child": [{ "type": "Text", "props": { "y": -72, "x": -37, "width": 413, "valign": "middle", "text": "额外获得三把钥匙", "height": 67, "fontSize": 45, "color": "#ffffff", "bold": true, "align": "center", "runtime": "laya.display.Text" }, "compId": 29 }] }] }, { "type": "Image", "props": { "y": -48, "x": 124, "skin": "game/biaoti.png" }, "compId": 10, "child": [{ "type": "Text", "props": { "y": 115, "x": 48.5, "width": 375, "valign": "middle", "text": "可免费开启2个宝箱", "height": 76, "fontSize": 36, "color": "#ffffff", "bold": true, "align": "center", "runtime": "laya.display.Text" }, "compId": 28 }] }] }], "loadList": ["game/pifu-1-13.png", "game/pifu-1-1.png", "game/dalandi.png", "game/xiaodi.png", "game/baoxian.png", "game/shipin.png", "icon/skin1.png", "game/pifu-1-10.png", "game/KeyIconBase.png", "game/KeyIcon.png", "game/fasf.png", "game/baoxiang-1-14.png", "game/biaoti.png"], "loadList3D": [] };
- Window.ChestWindowUI = ChestWindowUI;
- REG("ui.Window.ChestWindowUI", ChestWindowUI);
- class HomeWindowUI extends Laya.Scene {
- constructor() { super(); }
- createChildren() {
- super.createChildren();
- this.createView(HomeWindowUI.uiView);
- }
- }
- HomeWindowUI.uiView = { "type": "Scene", "props": { "width": 720, "height": 1280 }, "compId": 2, "child": [{ "type": "Image", "props": { "y": 77, "x": 487, "width": 233, "var": "moneypan", "skin": "game/zhujiemian-1-5.png", "height": 70, "sizeGrid": "30,30,30,30" }, "compId": 87, "child": [{ "type": "Image", "props": { "y": 8, "x": 20, "skin": "game/zhujiemian-1-4.png" }, "compId": 88 }, { "type": "Text", "props": { "y": 5, "x": 81, "width": 127, "var": "moneyclip", "valign": "middle", "text": "999", "height": 60, "fontSize": 35, "font": "SimHei", "color": "#ffffff", "bold": true, "align": "center", "runtime": "laya.display.Text" }, "compId": 89 }, { "type": "Button", "props": { "y": 97, "x": 70, "visible": false, "var": "backbtn", "stateNum": 1, "skin": "recommend/hutui-1-2.png" }, "compId": 145 }] }, { "type": "Box", "props": { "y": 912, "x": 0, "width": 720, "var": "bottombtnpan", "height": 118 }, "compId": 61, "child": [{ "type": "Image", "props": { "y": -178, "x": 236.5, "skin": "game/zhujiemian-1-8 (2).png" }, "compId": 91, "child": [{ "type": "Image", "props": { "y": 47.5, "x": 123, "width": 77, "skin": "game/zhujiemian-1-9.png", "pivotY": 24, "pivotX": 30, "height": 112 }, "compId": 92 }, { "type": "Image", "props": { "y": 185, "x": -8, "skin": "game/zhujiemian-1-10.png" }, "compId": 93 }] }, { "type": "Button", "props": { "y": -220, "x": 229, "width": 260, "var": "startbtn", "stateNum": 1, "labelSize": 50, "height": 324 }, "compId": 3 }, { "type": "Button", "props": { "y": -64, "visible": false, "var": "othergamebtn", "stateNum": 1, "skin": "game/zhujiemian-1-6.png", "left": 0 }, "compId": 62 }, { "type": "Button", "props": { "y": -66, "x": 541, "var": "skinbtn", "stateNum": 1, "skin": "game/zhujiemian-1-7.png" }, "compId": 86 }, { "type": "Button", "props": { "y": -215, "var": "signbtn", "stateNum": 1, "skin": "game/zhujiemian-1-11.png", "right": 0 }, "compId": 144 }, { "type": "Button", "props": { "y": -207, "visible": false, "var": "eggbtn", "stateNum": 1, "skin": "game/zhujiemian-1-6.png", "left": 0 }, "compId": 146 }, { "type": "Button", "props": { "y": -144, "x": 56, "var": "cdbtn", "stateNum": 1, "skin": "game/cdbtn.png", "anchorY": 0.5, "anchorX": 0.5 }, "compId": 147 }] }, { "type": "Box", "props": { "y": 227, "x": 0, "width": 720, "var": "stagepan", "height": 86 }, "compId": 94, "child": [{ "type": "Image", "props": { "y": 34, "x": 110, "width": 500, "skin": "game/zhujiemian-1-2.png", "sizeGrid": "10,10,10,10" }, "compId": 95 }, { "type": "Box", "props": { "y": 10, "x": 107, "width": 505, "var": "stagelist", "spaceX": 50, "repeatY": 1, "repeatX": 5, "height": 66 }, "compId": 96, "child": [{ "type": "Box", "props": { "renderType": "render" }, "compId": 97, "child": [{ "type": "Image", "props": { "skin": "game/zhujiemian-1-1.png" }, "compId": 98, "child": [{ "type": "Text", "props": { "y": 3, "x": 0, "width": 60, "valign": "middle", "text": "12", "height": 60, "fontSize": 35, "font": "SimHei", "color": "#ffffff", "bold": true, "align": "center", "runtime": "laya.display.Text" }, "compId": 100 }] }, { "type": "Image", "props": { "y": 0, "x": 0, "visible": false, "skin": "game/zhujiemian-1-3.png" }, "compId": 101 }] }, { "type": "Box", "props": { "y": 0, "x": 109, "renderType": "render" }, "compId": 103, "child": [{ "type": "Image", "props": { "skin": "game/zhujiemian-1-1.png" }, "compId": 104, "child": [{ "type": "Text", "props": { "y": 3, "x": 0, "width": 60, "valign": "middle", "text": "12", "height": 60, "fontSize": 35, "font": "SimHei", "color": "#ffffff", "bold": true, "align": "center", "runtime": "laya.display.Text" }, "compId": 105 }] }, { "type": "Image", "props": { "y": 0, "x": 0, "visible": false, "skin": "game/zhujiemian-1-3.png" }, "compId": 106 }] }, { "type": "Box", "props": { "y": 0, "x": 222, "renderType": "render" }, "compId": 107, "child": [{ "type": "Image", "props": { "skin": "game/zhujiemian-1-1.png" }, "compId": 108, "child": [{ "type": "Text", "props": { "y": 3, "x": 0, "width": 60, "valign": "middle", "text": "12", "height": 60, "fontSize": 35, "font": "SimHei", "color": "#ffffff", "bold": true, "align": "center", "runtime": "laya.display.Text" }, "compId": 109 }] }, { "type": "Image", "props": { "y": 0, "x": 0, "visible": false, "skin": "game/zhujiemian-1-3.png" }, "compId": 110 }] }, { "type": "Box", "props": { "y": 0, "x": 338, "renderType": "render" }, "compId": 111, "child": [{ "type": "Image", "props": { "skin": "game/zhujiemian-1-1.png" }, "compId": 112, "child": [{ "type": "Text", "props": { "y": 3, "x": 0, "width": 60, "valign": "middle", "text": "12", "height": 60, "fontSize": 35, "font": "SimHei", "color": "#ffffff", "bold": true, "align": "center", "runtime": "laya.display.Text" }, "compId": 113 }] }, { "type": "Image", "props": { "y": 0, "x": 0, "visible": false, "skin": "game/zhujiemian-1-3.png" }, "compId": 114 }] }, { "type": "Box", "props": { "y": 0, "x": 444, "renderType": "render" }, "compId": 115, "child": [{ "type": "Image", "props": { "skin": "game/zhujiemian-1-1.png" }, "compId": 116, "child": [{ "type": "Text", "props": { "y": 3, "x": 0, "width": 60, "valign": "middle", "text": "12", "height": 60, "fontSize": 35, "font": "SimHei", "color": "#ffffff", "bold": true, "align": "center", "runtime": "laya.display.Text" }, "compId": 117 }] }, { "type": "Image", "props": { "y": 0, "x": 0, "visible": false, "skin": "game/zhujiemian-1-3.png" }, "compId": 118 }] }] }] }, { "type": "Box", "props": { "y": 334, "width": 172, "var": "videopan", "right": 0, "height": 306 }, "compId": 148, "child": [{ "type": "Box", "props": { "width": 172, "top": 0, "height": 175 }, "compId": 149, "child": [{ "type": "Image", "props": { "y": 7, "x": 7.5, "skin": "bg/guangi.png" }, "compId": 151 }, { "type": "Image", "props": { "y": 87, "x": 85, "skin": "bg/Rays.png", "anchorY": 0.5, "anchorX": 0.5 }, "compId": 150 }, { "type": "Button", "props": { "y": 87, "x": 85, "var": "videogetweapon", "stateNum": 1, "skin": "bg/qiriqd.png", "anchorY": 0.5, "anchorX": 0.5 }, "compId": 152 }] }, { "type": "Box", "props": { "x": 0, "width": 172, "height": 175, "bottom": 0 }, "compId": 153, "child": [{ "type": "Image", "props": { "y": 0, "x": 0, "skin": "bg/gaungdi.png" }, "compId": 154 }, { "type": "Image", "props": { "y": 87, "x": 85, "skin": "bg/Rays.png", "anchorY": 0.5, "anchorX": 0.5 }, "compId": 155 }, { "type": "Button", "props": { "y": 87, "x": 85, "var": "videogettw", "stateNum": 1, "skin": "bg/qiriqd-2.png", "scaleY": 1, "scaleX": 1, "anchorY": 0.5, "anchorX": 0.5 }, "compId": 156 }] }] }], "animations": [{ "nodes": [{ "target": 92, "keyframes": { "y": [{ "value": 47.5, "tweenMethod": "linearNone", "tween": true, "target": 92, "key": "y", "index": 0 }, { "value": 17, "tweenMethod": "linearNone", "tween": true, "target": 92, "key": "y", "index": 10 }, { "value": 47.5, "tweenMethod": "linearNone", "tween": true, "target": 92, "key": "y", "index": 20 }, { "value": 95, "tweenMethod": "linearNone", "tween": true, "target": 92, "key": "y", "index": 30 }, { "value": 47.5, "tweenMethod": "linearNone", "tween": true, "target": 92, "key": "y", "index": 40 }, { "value": 14, "tweenMethod": "linearNone", "tween": true, "target": 92, "key": "y", "index": 50 }, { "value": 47.5, "tweenMethod": "linearNone", "tween": true, "target": 92, "key": "y", "index": 60 }, { "value": 95, "tweenMethod": "linearNone", "tween": true, "target": 92, "key": "y", "index": 70 }, { "value": 47.5, "tweenMethod": "linearNone", "tween": true, "target": 92, "key": "y", "index": 80 }], "x": [{ "value": 123, "tweenMethod": "linearNone", "tween": true, "target": 92, "key": "x", "index": 0 }, { "value": 57, "tweenMethod": "linearNone", "tween": true, "target": 92, "key": "x", "index": 10 }, { "value": 0, "tweenMethod": "linearNone", "tween": true, "target": 92, "key": "x", "index": 20 }, { "value": 58, "tweenMethod": "linearNone", "tween": true, "target": 92, "key": "x", "index": 30 }, { "value": 123.5, "tweenMethod": "linearNone", "tween": true, "target": 92, "key": "x", "index": 40 }, { "value": 197, "tweenMethod": "linearNone", "tween": true, "target": 92, "key": "x", "index": 50 }, { "value": 247, "tweenMethod": "linearNone", "tween": true, "target": 92, "key": "x", "index": 60 }, { "value": 195, "tweenMethod": "linearNone", "tween": true, "target": 92, "key": "x", "index": 70 }, { "value": 123.5, "tweenMethod": "linearNone", "tween": true, "target": 92, "key": "x", "index": 80 }] } }], "name": "ani1", "id": 1, "frameRate": 24, "action": 2 }, { "nodes": [{ "target": 147, "keyframes": { "scaleY": [{ "value": 1, "tweenMethod": "linearNone", "tween": true, "target": 147, "key": "scaleY", "index": 0 }, { "value": 1.3, "tweenMethod": "linearNone", "tween": true, "target": 147, "key": "scaleY", "index": 10 }, { "value": 1, "tweenMethod": "linearNone", "tween": true, "target": 147, "key": "scaleY", "index": 20 }], "scaleX": [{ "value": 1, "tweenMethod": "linearNone", "tween": true, "target": 147, "key": "scaleX", "index": 0 }, { "value": 1.3, "tweenMethod": "linearNone", "tween": true, "target": 147, "key": "scaleX", "index": 10 }, { "value": 1, "tweenMethod": "linearNone", "tween": true, "target": 147, "key": "scaleX", "index": 20 }] } }], "name": "ani2", "id": 2, "frameRate": 24, "action": 2 }, { "nodes": [{ "target": 150, "keyframes": { "rotation": [{ "value": 0, "tweenMethod": "linearNone", "tween": true, "target": 150, "key": "rotation", "index": 0 }, { "value": 45, "tweenMethod": "linearNone", "tween": true, "target": 150, "key": "rotation", "index": 10 }, { "value": 90, "tweenMethod": "linearNone", "tween": true, "target": 150, "key": "rotation", "index": 20 }, { "value": 135, "tweenMethod": "linearNone", "tween": true, "target": 150, "key": "rotation", "index": 30 }, { "value": 180, "tweenMethod": "linearNone", "tween": true, "target": 150, "key": "rotation", "index": 40 }] } }, { "target": 152, "keyframes": { "scaleY": [{ "value": 1, "tweenMethod": "linearNone", "tween": true, "target": 152, "key": "scaleY", "index": 0 }, { "value": 1.2, "tweenMethod": "linearNone", "tween": true, "target": 152, "key": "scaleY", "index": 10 }, { "value": 1, "tweenMethod": "linearNone", "tween": true, "target": 152, "key": "scaleY", "index": 20 }, { "value": 1.2, "tweenMethod": "linearNone", "tween": true, "target": 152, "key": "scaleY", "index": 30 }, { "value": 1, "tweenMethod": "linearNone", "tween": true, "target": 152, "key": "scaleY", "index": 40 }], "scaleX": [{ "value": 1, "tweenMethod": "linearNone", "tween": true, "target": 152, "key": "scaleX", "index": 0 }, { "value": 1.2, "tweenMethod": "linearNone", "tween": true, "target": 152, "key": "scaleX", "index": 10 }, { "value": 1, "tweenMethod": "linearNone", "tween": true, "target": 152, "key": "scaleX", "index": 20 }, { "value": 1.2, "tweenMethod": "linearNone", "tween": true, "target": 152, "key": "scaleX", "index": 30 }, { "value": 1, "tweenMethod": "linearNone", "tween": true, "target": 152, "key": "scaleX", "index": 40 }] } }], "name": "ani3", "id": 3, "frameRate": 24, "action": 2 }, { "nodes": [{ "target": 155, "keyframes": { "rotation": [{ "value": 0, "tweenMethod": "linearNone", "tween": true, "target": 155, "key": "rotation", "index": 0 }, { "value": 45, "tweenMethod": "linearNone", "tween": true, "target": 155, "key": "rotation", "index": 10 }, { "value": 90, "tweenMethod": "linearNone", "tween": true, "target": 155, "key": "rotation", "index": 20 }, { "value": 135, "tweenMethod": "linearNone", "tween": true, "target": 155, "key": "rotation", "index": 30 }, { "value": 180, "tweenMethod": "linearNone", "tween": true, "target": 155, "key": "rotation", "index": 40 }] } }, { "target": 156, "keyframes": { "scaleY": [{ "value": 1, "tweenMethod": "linearNone", "tween": true, "target": 156, "key": "scaleY", "index": 0 }, { "value": 1.2, "tweenMethod": "linearNone", "tween": true, "target": 156, "key": "scaleY", "index": 10 }, { "value": 1, "tweenMethod": "linearNone", "tween": true, "target": 156, "key": "scaleY", "index": 20 }, { "value": 1.2, "tweenMethod": "linearNone", "tween": true, "target": 156, "key": "scaleY", "index": 30 }, { "value": 1, "tweenMethod": "linearNone", "tween": true, "target": 156, "key": "scaleY", "index": 40 }], "scaleX": [{ "value": 1, "tweenMethod": "linearNone", "tween": true, "target": 156, "key": "scaleX", "index": 0 }, { "value": 1.2, "tweenMethod": "linearNone", "tween": true, "target": 156, "key": "scaleX", "index": 10 }, { "value": 1, "tweenMethod": "linearNone", "tween": true, "target": 156, "key": "scaleX", "index": 20 }, { "value": 1.2, "tweenMethod": "linearNone", "tween": true, "target": 156, "key": "scaleX", "index": 30 }, { "value": 1, "tweenMethod": "linearNone", "tween": true, "target": 156, "key": "scaleX", "index": 40 }] } }], "name": "ani3_0", "id": 3, "frameRate": 24, "action": 2 }], "loadList": ["game/zhujiemian-1-5.png", "game/zhujiemian-1-4.png", "recommend/hutui-1-2.png", "game/zhujiemian-1-8 (2).png", "game/zhujiemian-1-9.png", "game/zhujiemian-1-10.png", "game/zhujiemian-1-6.png", "game/zhujiemian-1-7.png", "game/zhujiemian-1-11.png", "game/cdbtn.png", "game/zhujiemian-1-2.png", "game/zhujiemian-1-1.png", "game/zhujiemian-1-3.png", "bg/guangi.png", "bg/Rays.png", "bg/qiriqd.png", "bg/gaungdi.png", "bg/qiriqd-2.png"], "loadList3D": [] };
- Window.HomeWindowUI = HomeWindowUI;
- REG("ui.Window.HomeWindowUI", HomeWindowUI);
- class InGameWindowUI extends Laya.Scene {
- constructor() { super(); }
- createChildren() {
- super.createChildren();
- this.createView(InGameWindowUI.uiView);
- }
- }
- InGameWindowUI.uiView = { "type": "Scene", "props": { "width": 720, "height": 1280 }, "compId": 2, "child": [{ "type": "Box", "props": { "x": 0, "width": 720, "var": "drawpan", "height": 300, "bottom": 1 }, "compId": 96, "child": [{ "type": "Box", "props": { "y": 25, "x": 0, "width": 127, "var": "attackbox", "height": 250 }, "compId": 97, "child": [{ "type": "Button", "props": { "y": 4, "x": 0, "var": "onebtn", "stateNum": 1, "skin": "game/--4.png" }, "compId": 98, "child": [{ "type": "Image", "props": { "y": -4, "x": 0, "skin": "game/--7.png" }, "compId": 104 }, { "type": "Image", "props": { "y": 22, "x": 7, "skin": "game/--3.png" }, "compId": 101 }] }, { "type": "Button", "props": { "y": 88, "x": 0, "var": "twobtn", "stateNum": 1, "skin": "game/--5.png" }, "compId": 99, "child": [{ "type": "Image", "props": { "y": -4, "skin": "game/--8.png" }, "compId": 102 }, { "type": "Image", "props": { "y": 22, "x": 18, "skin": "game/--2.png" }, "compId": 105 }] }, { "type": "Button", "props": { "y": 171, "x": 0, "var": "threebtn", "stateNum": 1, "skin": "game/--6.png" }, "compId": 100, "child": [{ "type": "Image", "props": { "y": -4, "skin": "game/--9.png" }, "compId": 103 }, { "type": "Image", "props": { "y": 22, "x": 18, "skin": "game/--1.png" }, "compId": 106 }] }] }, { "type": "Image", "props": { "y": 17, "x": 153, "width": 520, "var": "drawban", "skin": "bg/-12.png", "height": 279 }, "compId": 95, "child": [{ "type": "Text", "props": { "y": 5, "x": 44.5, "width": 431, "var": "drawtip", "valign": "middle", "text": "绘制你想要的武器", "height": 41, "fontSize": 40, "color": "#ffffff", "bold": true, "align": "center", "runtime": "laya.display.Text" }, "compId": 127 }] }, { "type": "List", "props": { "x": 165, "width": 497, "visible": false, "var": "skinlist", "top": 36, "spaceY": 5, "spaceX": 5, "height": 247 }, "compId": 107, "child": [{ "type": "Box", "props": { "width": 120, "renderType": "render", "height": 120 }, "compId": 108, "child": [{ "type": "Image", "props": { "y": 0, "x": 0, "width": 120, "skin": "game/pifu-1-12.png", "name": "bg", "height": 120, "alpha": 0.4, "sizeGrid": "35,35,35,35" }, "compId": 109 }, { "type": "Image", "props": { "y": 0, "x": 0, "width": 120, "visible": false, "skin": "game/pifu-1-8.png", "name": "selected", "height": 120, "alpha": 0.4, "sizeGrid": "35,35,35,35" }, "compId": 110 }, { "type": "Image", "props": { "y": 60, "x": 60, "skin": "icon/wuqi1.png", "scaleY": 0.7, "scaleX": 0.7, "name": "icon", "anchorY": 0.5, "anchorX": 0.5 }, "compId": 111 }, { "type": "Box", "props": { "x": 0, "width": 120, "styleSkin": "game/pifu-1-4.png", "height": 30, "bottom": 0 }, "compId": 113, "child": [{ "type": "Image", "props": { "x": 0, "width": 120, "skin": "game/pifu-1-9.png", "height": 30, "bottom": 0 }, "compId": 114 }, { "type": "Text", "props": { "y": 0, "x": 0, "width": 120, "valign": "middle", "text": "使用中", "strokeColor": "#812c03", "name": "useing", "height": 30, "fontSize": 20, "font": "Microsoft YaHei", "color": "#ffffff", "bold": false, "align": "center", "runtime": "laya.display.Text" }, "compId": 115 }, { "type": "Text", "props": { "x": 0, "width": 120, "visible": false, "valign": "middle", "text": "使用", "strokeColor": "#812c03", "name": "use", "height": 30, "fontSize": 20, "font": "Microsoft YaHei", "color": "#ffffff", "bold": false, "align": "center", "runtime": "laya.display.Text" }, "compId": 116 }, { "type": "Box", "props": { "x": 0, "width": 120, "visible": false, "name": "video", "height": 30, "bottom": 0 }, "compId": 117, "child": [{ "type": "Image", "props": { "y": 3, "x": 27, "width": 24, "skin": "game/pifu-1-11.png", "height": 24 }, "compId": 118 }, { "type": "Text", "props": { "y": 4, "x": 51, "width": 41, "valign": "middle", "text": "试用", "strokeColor": "#812c03", "name": "useing", "height": 22, "fontSize": 20, "font": "SimHei", "color": "#ffffff", "bold": false, "align": "left", "runtime": "laya.display.Text" }, "compId": 119 }] }] }, { "type": "Button", "props": { "y": 52, "x": 0, "width": 120, "stateNum": 1, "name": "getbtn", "height": 68 }, "compId": 126 }] }] }] }], "animations": [{ "nodes": [{ "target": 89, "keyframes": { "visible": [{ "value": true, "tweenMethod": "linearNone", "tween": false, "target": 89, "key": "visible", "index": 0 }], "scaleY": [{ "value": 1, "tweenMethod": "linearNone", "tween": true, "target": 89, "key": "scaleY", "index": 0 }, { "value": 1.2, "tweenMethod": "linearNone", "tween": true, "target": 89, "key": "scaleY", "index": 10 }, { "value": 1, "tweenMethod": "linearNone", "tween": true, "target": 89, "key": "scaleY", "index": 20 }], "scaleX": [{ "value": 1, "tweenMethod": "linearNone", "tween": true, "target": 89, "key": "scaleX", "index": 0 }, { "value": 1.2, "tweenMethod": "linearNone", "tween": true, "target": 89, "key": "scaleX", "index": 10 }, { "value": 1, "tweenMethod": "linearNone", "tween": true, "target": 89, "key": "scaleX", "index": 20 }] } }], "name": "ani1", "id": 1, "frameRate": 24, "action": 2 }], "loadList": ["game/--4.png", "game/--7.png", "game/--3.png", "game/--5.png", "game/--8.png", "game/--2.png", "game/--6.png", "game/--9.png", "game/--1.png", "bg/-12.png", "game/pifu-1-12.png", "game/pifu-1-8.png", "icon/wuqi1.png", "game/pifu-1-4.png", "game/pifu-1-9.png", "game/pifu-1-11.png"], "loadList3D": [] };
- Window.InGameWindowUI = InGameWindowUI;
- REG("ui.Window.InGameWindowUI", InGameWindowUI);
- class LoadWindowUI extends Laya.Scene {
- constructor() { super(); }
- createChildren() {
- super.createChildren();
- this.createView(LoadWindowUI.uiView);
- }
- }
- LoadWindowUI.uiView = { "type": "Scene", "props": { "width": 720, "height": 1280 }, "compId": 2, "child": [{ "type": "Image", "props": { "x": 0, "width": 720, "top": 0, "skin": "load/login.png", "name": "bg", "bottom": 0 }, "compId": 6 }, { "type": "Image", "props": { "y": 207, "x": 88, "var": "logo", "skin": "load/jiazai-1-3.png" }, "compId": 32 }, { "type": "Box", "props": { "y": 811, "x": 0, "width": 720, "var": "logo1", "styleSkin": "load/jiazai-1-1.png", "height": 100 }, "compId": 33, "child": [{ "type": "Image", "props": { "y": 33, "x": 405, "skin": "load/loding-3.png", "scaleY": 1, "scaleX": 1 }, "compId": 13 }, { "type": "FontClip", "props": { "y": 39, "x": 321, "width": 75, "var": "preclip", "value": "100", "skin": "load/43.png", "sheet": "0123456789", "scaleY": 1, "scaleX": 1, "height": 29, "align": "right" }, "compId": 12 }] }], "animations": [{ "nodes": [{ "target": 9, "keyframes": { "alpha": [{ "value": 0, "tweenMethod": "linearNone", "tween": true, "target": 9, "key": "alpha", "index": 0 }, { "value": 1, "tweenMethod": "linearNone", "tween": true, "target": 9, "key": "alpha", "index": 5 }, { "value": 0, "tweenMethod": "linearNone", "tween": true, "target": 9, "key": "alpha", "index": 20 }] } }, { "target": 10, "keyframes": { "alpha": [{ "value": 0, "tweenMethod": "linearNone", "tween": true, "target": 10, "key": "alpha", "index": 0 }, { "value": 1, "tweenMethod": "linearNone", "tween": true, "target": 10, "key": "alpha", "index": 10 }, { "value": 0, "tweenMethod": "linearNone", "tween": true, "target": 10, "key": "alpha", "index": 20 }] } }, { "target": 11, "keyframes": { "alpha": [{ "value": 0, "tweenMethod": "linearNone", "tween": true, "target": 11, "key": "alpha", "index": 0 }, { "value": 1, "tweenMethod": "linearNone", "tween": true, "target": 11, "key": "alpha", "index": 15 }, { "value": 0, "tweenMethod": "linearNone", "tween": true, "target": 11, "key": "alpha", "index": 20 }] } }], "name": "ani1", "id": 1, "frameRate": 24, "action": 2 }], "loadList": ["load/login.png", "load/jiazai-1-3.png", "load/jiazai-1-1.png", "load/loding-3.png", "load/43.png"], "loadList3D": [] };
- Window.LoadWindowUI = LoadWindowUI;
- REG("ui.Window.LoadWindowUI", LoadWindowUI);
- class ReviveWindowUI extends Laya.Scene {
- constructor() { super(); }
- createChildren() {
- super.createChildren();
- this.createView(ReviveWindowUI.uiView);
- }
- }
- ReviveWindowUI.uiView = { "type": "Scene", "props": { "width": 720, "height": 1280 }, "compId": 2, "child": [{ "type": "Image", "props": { "y": 0, "x": 0, "width": 720, "top": 0, "skin": "game/zhezhao.png", "name": "bg", "bottom": 0, "sizeGrid": "10,10,10,10" }, "compId": 3, "child": [{ "type": "Image", "props": { "y": 284, "x": 158.5, "skin": "game/fuhuo-1-2.png" }, "compId": 5 }] }, { "type": "Box", "props": { "y": 705, "x": 0, "width": 720, "var": "pan", "height": 112 }, "compId": 19, "child": [{ "type": "Text", "props": { "y": 2, "x": 281, "width": 157, "var": "timetex", "valign": "middle", "text": "5", "height": 124, "fontSize": 120, "font": "Arial", "color": "#ffffff", "bold": true, "align": "center", "runtime": "laya.display.Text" }, "compId": 6 }] }, { "type": "Box", "props": { "y": 817, "x": 0, "width": 720, "var": "Btn", "height": 143 }, "compId": 4, "child": [{ "type": "Button", "props": { "y": 42, "x": 360, "var": "passbtn", "stateNum": 1, "skin": "game/fuhuo-1-1.png", "scaleY": 1, "scaleX": 1, "anchorY": 0.5, "anchorX": 0.5 }, "compId": 7 }, { "type": "Button", "props": { "y": 155, "x": 314, "var": "closebtn", "stateNum": 1, "skin": "game/fuhuo-1-3.png", "bottom": 0 }, "compId": 8 }] }], "loadList": ["game/zhezhao.png", "game/fuhuo-1-2.png", "game/fuhuo-1-1.png", "game/fuhuo-1-3.png"], "loadList3D": [] };
- Window.ReviveWindowUI = ReviveWindowUI;
- REG("ui.Window.ReviveWindowUI", ReviveWindowUI);
- class RewardWindowUI extends Laya.Scene {
- constructor() { super(); }
- createChildren() {
- super.createChildren();
- this.createView(RewardWindowUI.uiView);
- }
- }
- RewardWindowUI.uiView = { "type": "Scene", "props": { "width": 720, "height": 1280 }, "compId": 2, "child": [{ "type": "Image", "props": { "width": 720, "top": 0, "skin": "game/zhezhao.png", "name": "bg", "bottom": 0, "alpha": 1, "sizeGrid": "10,10,10,10" }, "compId": 4 }, { "type": "Box", "props": { "y": 540, "x": 360, "width": 572, "var": "pan", "styleSkin": "game/shezhi-1-3.png", "pivotY": 220, "pivotX": 286, "height": 440 }, "compId": 3, "child": [{ "type": "Image", "props": { "y": -5, "x": 57, "width": 457, "skin": "game/pifu-1-13.png", "height": 459, "sizeGrid": "10,10,10,10" }, "compId": 21 }, { "type": "Image", "props": { "y": -30, "x": 192, "skin": "game/huode-1-2.png" }, "compId": 19 }, { "type": "Image", "props": { "y": 220, "x": 286, "width": 234, "skin": "game/huode-1-4.png", "pivotY": 118, "pivotX": 117, "height": 235 }, "compId": 20 }, { "type": "Image", "props": { "y": 220, "x": 287, "var": "icon", "anchorY": 0.5, "anchorX": 0.5 }, "compId": 15 }, { "type": "Text", "props": { "y": 405, "x": 167.5, "width": 237, "visible": false, "var": "skindesc", "valign": "middle", "text": "获得奖励", "height": 50, "fontSize": 40, "font": "SimSun", "color": "#f6f636", "bold": true, "align": "center", "runtime": "laya.display.Text" }, "compId": 17 }] }, { "type": "Box", "props": { "y": 817, "x": 0, "width": 720, "var": "Btn", "height": 113 }, "compId": 10, "child": [{ "type": "Button", "props": { "y": 0, "x": 255, "visible": false, "var": "usebtn", "top": 0, "stateNum": 1, "skin": "game/huode-1-1.png" }, "compId": 8 }, { "type": "Button", "props": { "y": 63, "x": 305, "var": "closebtn", "stateNum": 1, "skin": "game/huode-1-5.png", "bottom": 0 }, "compId": 9 }] }], "animations": [{ "nodes": [{ "target": 20, "keyframes": { "rotation": [{ "value": 0, "tweenMethod": "linearNone", "tween": true, "target": 20, "key": "rotation", "index": 0 }, { "value": 90, "tweenMethod": "linearNone", "tween": true, "target": 20, "key": "rotation", "index": 15 }, { "value": 180, "tweenMethod": "linearNone", "tween": true, "target": 20, "key": "rotation", "index": 30 }] } }], "name": "ani2", "id": 2, "frameRate": 24, "action": 2 }], "loadList": ["game/zhezhao.png", "game/shezhi-1-3.png", "game/pifu-1-13.png", "game/huode-1-2.png", "game/huode-1-4.png", "game/huode-1-1.png", "game/huode-1-5.png"], "loadList3D": [] };
- Window.RewardWindowUI = RewardWindowUI;
- REG("ui.Window.RewardWindowUI", RewardWindowUI);
- class SettingWindowUI extends Laya.Scene {
- constructor() { super(); }
- createChildren() {
- super.createChildren();
- this.createView(SettingWindowUI.uiView);
- }
- }
- SettingWindowUI.uiView = { "type": "Scene", "props": { "width": 720, "height": 1280 }, "compId": 2, "child": [{ "type": "Image", "props": { "width": 720, "top": 0, "skin": "bg/beijing-shengli.png", "name": "bg", "bottom": 0 }, "compId": 3 }, { "type": "Box", "props": { "y": 340, "x": 35, "width": 650, "height": 600 }, "compId": 4, "child": [{ "type": "Image", "props": { "x": 0, "width": 650, "skin": "game/shezhi-di.png", "height": 400, "bottom": 100, "sizeGrid": "20,20,20,20" }, "compId": 7 }, { "type": "Image", "props": { "y": 119, "x": 276, "skin": "game/shezhi (2).png" }, "compId": 6 }, { "type": "Button", "props": { "var": "closeBtn", "top": 125, "stateNum": 1, "skin": "game/guaidbi.png", "scaleY": 1.3, "scaleX": 1.3, "right": 24 }, "compId": 5 }, { "type": "Image", "props": { "y": 331, "skin": "game/zhendong.png", "left": 86 }, "compId": 8 }, { "type": "Image", "props": { "y": 239, "skin": "game/yinyue.png", "left": 86 }, "compId": 9 }, { "type": "Box", "props": { "y": 342, "x": 396, "width": 175, "var": "shakePan", "styleSkin": "settingwindow/shezhi_1_2_3.png", "height": 47 }, "compId": 11, "child": [{ "type": "Image", "props": { "y": 0, "x": 0, "visible": false, "skin": "game/di-kaiguan.png", "name": "openSprite" }, "compId": 14, "child": [{ "type": "Image", "props": { "y": 3, "skin": "game/huakuai.png", "left": 5 }, "compId": 32 }, { "type": "Image", "props": { "y": 14.5, "skin": "game/ON.png", "right": 15 }, "compId": 33 }] }, { "type": "Image", "props": { "y": 0, "x": 0, "visible": false, "skin": "game/di-kaiguan.png", "name": "closeSprite" }, "compId": 22, "child": [{ "type": "Image", "props": { "y": 3, "skin": "game/huakuai.png", "right": 5 }, "compId": 34 }, { "type": "Image", "props": { "y": 14, "skin": "game/OFF.png", "left": 10 }, "compId": 35 }] }, { "type": "Button", "props": { "y": 0, "x": 0, "width": 175, "name": "button", "height": 47 }, "compId": 17 }] }, { "type": "Box", "props": { "y": 229, "x": 396, "width": 175, "var": "soundPan", "styleSkin": "settingwindow/shezhi_1_2_3.png", "height": 47 }, "compId": 10, "child": [{ "type": "Image", "props": { "y": 0, "x": 0, "visible": false, "skin": "game/di-kaiguan.png", "name": "openSprite" }, "compId": 36, "child": [{ "type": "Image", "props": { "y": 3, "skin": "game/huakuai.png", "left": 5 }, "compId": 38 }, { "type": "Image", "props": { "y": 14.5, "skin": "game/ON.png", "right": 15 }, "compId": 39 }] }, { "type": "Image", "props": { "y": 0, "x": 0, "visible": false, "skin": "game/di-kaiguan.png", "name": "closeSprite" }, "compId": 37, "child": [{ "type": "Image", "props": { "y": 3, "skin": "game/huakuai.png", "right": 5 }, "compId": 40 }, { "type": "Image", "props": { "y": 14, "skin": "game/OFF.png", "left": 10 }, "compId": 41 }] }, { "type": "Button", "props": { "y": 0, "x": 0, "width": 175, "name": "button", "height": 47 }, "compId": 16 }] }, { "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": 28 }, { "type": "Text", "props": { "y": 571, "x": 24, "width": 602, "var": "ver", "valign": "middle", "text": "1.0.9", "height": 59, "fontSize": 30, "color": "#ffffff", "align": "center", "runtime": "laya.display.Text" }, "compId": 31 }] }], "loadList": ["bg/beijing-shengli.png", "game/shezhi-di.png", "game/shezhi (2).png", "game/guaidbi.png", "game/zhendong.png", "game/yinyue.png", "settingwindow/shezhi_1_2_3.png", "game/di-kaiguan.png", "game/huakuai.png", "game/ON.png", "game/OFF.png"], "loadList3D": [] };
- Window.SettingWindowUI = SettingWindowUI;
- REG("ui.Window.SettingWindowUI", SettingWindowUI);
- class SettlementWindowUI extends Laya.Scene {
- constructor() { super(); }
- createChildren() {
- super.createChildren();
- this.createView(SettlementWindowUI.uiView);
- }
- }
- SettlementWindowUI.uiView = { "type": "Scene", "props": { "width": 720, "height": 1280 }, "compId": 2, "child": [{ "type": "Image", "props": { "x": 0, "width": 720, "visible": true, "top": 0, "skin": "game/zhezhao.png", "name": "bg", "bottom": 0, "alpha": 0.8, "sizeGrid": "10,10,10,10" }, "compId": 7 }, { "type": "Box", "props": { "y": 229, "x": 0, "width": 720, "var": "pan", "height": 104 }, "compId": 30, "child": [{ "type": "Image", "props": { "y": 12, "x": 158, "var": "loseshow", "skin": "game/jiesuan-1-1.png" }, "compId": 41 }, { "type": "Image", "props": { "y": 12, "x": 159, "var": "winshow", "skin": "game/jiesuan-1-2.png" }, "compId": 31 }] }, { "type": "Box", "props": { "y": 577, "x": 176, "width": 368, "var": "moneypan", "height": 63 }, "compId": 32, "child": [{ "type": "Image", "props": { "x": 1, "width": 367, "top": 0, "skin": "game/jiesuan-1-5.png", "height": 64 }, "compId": 33 }, { "type": "Image", "props": { "y": 31.5, "x": 112, "width": 58, "var": "moneytt", "skin": "game/jiesuan-1-6.png", "pivotY": 31, "pivotX": 29, "height": 62 }, "compId": 34 }, { "type": "Text", "props": { "y": 9, "x": 160, "width": 121, "var": "moneyclip", "valign": "middle", "text": "1234", "height": 45, "fontSize": 55, "font": "SimHei", "color": "#ffffff", "bold": true, "align": "left", "runtime": "laya.display.Text" }, "compId": 35 }] }, { "type": "Box", "props": { "y": 821, "x": 0, "width": 720, "var": "Btn", "height": 149 }, "compId": 5, "child": [{ "type": "Button", "props": { "y": -35, "x": 228, "width": 263, "var": "videobtn", "height": 27 }, "compId": 71, "child": [{ "type": "Image", "props": { "y": 2, "skin": "game/waiquan.png" }, "compId": 73, "child": [{ "type": "Image", "props": { "y": 4, "x": 4, "var": "videopoint", "skin": "game/zhongquan.png" }, "compId": 74 }] }, { "type": "Image", "props": { "y": 0, "x": 29, "skin": "game/kanshipin-wenzi.png" }, "compId": 72 }] }, { "type": "Button", "props": { "y": 0, "x": 198, "var": "awardbtn", "stateNum": 1, "skin": "game/jiesuan-1-3.png" }, "compId": 40 }, { "type": "Button", "props": { "y": 105, "x": 293, "visible": true, "var": "nomalaward", "stateNum": 1, "skin": "game/jiesuan-1-4.png", "bottom": 0 }, "compId": 3 }] }], "loadList": ["game/zhezhao.png", "game/jiesuan-1-1.png", "game/jiesuan-1-2.png", "game/jiesuan-1-5.png", "game/jiesuan-1-6.png", "game/waiquan.png", "game/zhongquan.png", "game/kanshipin-wenzi.png", "game/jiesuan-1-3.png", "game/jiesuan-1-4.png"], "loadList3D": [] };
- Window.SettlementWindowUI = SettlementWindowUI;
- REG("ui.Window.SettlementWindowUI", SettlementWindowUI);
- class ShareVideoWindowUI extends Laya.Scene {
- constructor() { super(); }
- createChildren() {
- super.createChildren();
- this.createView(ShareVideoWindowUI.uiView);
- }
- }
- ShareVideoWindowUI.uiView = { "type": "Scene", "props": { "width": 720, "height": 1280 }, "compId": 2, "child": [{ "type": "Image", "props": { "width": 720, "top": 0, "skin": "game/pifu-1-13.png", "name": "bg", "bottom": 0, "sizeGrid": "10,10,10,10" }, "compId": 4 }, { "type": "Box", "props": { "y": 679, "x": 360, "width": 720, "var": "pan", "pivotY": 289, "pivotX": 360, "height": 578 }, "compId": 3, "child": [{ "type": "Image", "props": { "x": 112, "var": "sharetip", "top": 0, "skin": "game/-1(2).png" }, "compId": 5 }, { "type": "Image", "props": { "y": 0, "x": 103, "var": "firstshare", "skin": "bg/-1.png" }, "compId": 11, "child": [{ "type": "Box", "props": { "y": -86, "x": -104, "width": 720, "height": 664 }, "compId": 12, "child": [{ "type": "Image", "props": { "y": 359, "x": 359, "width": 281, "skin": "game/huode-1-4.png", "height": 281, "anchorY": 0.5, "anchorX": 0.5 }, "compId": 13 }, { "type": "Image", "props": { "y": 358, "x": 360, "var": "icon", "skin": "icon/skin1.png", "scaleY": 1.8, "scaleX": 1.8, "rotation": 0, "anchorY": 0.5, "anchorX": 0.5 }, "compId": 14 }] }] }, { "type": "Image", "props": { "y": 227, "x": 251, "width": 78, "var": "sharemoney", "skin": "game/jiesuan-1-6.png", "height": 81 }, "compId": 7, "child": [{ "type": "Text", "props": { "y": 0, "x": 101, "width": 102, "valign": "middle", "text": "100", "height": 82, "fontSize": 60, "color": "#ffffff", "bold": true, "align": "left", "runtime": "laya.display.Text" }, "compId": 8 }] }, { "type": "Button", "props": { "y": 478, "x": 217, "var": "sharebtn", "stateNum": 1, "skin": "game/-2.png", "bottom": 0 }, "compId": 9 }, { "type": "Button", "props": { "y": 594, "x": 314, "var": "closebtn", "stateNum": 1, "skin": "game/fuhuo-1-3.png" }, "compId": 10 }] }], "animations": [{ "nodes": [{ "target": 3, "keyframes": { "scaleY": [{ "value": 0.6, "tweenMethod": "linearNone", "tween": true, "target": 3, "key": "scaleY", "index": 0 }, { "value": 1, "tweenMethod": "linearNone", "tween": true, "target": 3, "key": "scaleY", "index": 5 }], "scaleX": [{ "value": 0.6, "tweenMethod": "linearNone", "tween": true, "target": 3, "key": "scaleX", "index": 0 }, { "value": 1, "tweenMethod": "linearNone", "tween": true, "target": 3, "key": "scaleX", "index": 5 }] } }, { "target": 10, "keyframes": { "visible": [{ "value": false, "tweenMethod": "linearNone", "tween": false, "target": 10, "key": "visible", "index": 0 }, { "value": true, "tweenMethod": "linearNone", "tween": false, "target": 10, "key": "visible", "index": 40 }] } }], "name": "ani1", "id": 1, "frameRate": 24, "action": 1 }, { "nodes": [{ "target": 13, "keyframes": { "rotation": [{ "value": 0, "tweenMethod": "linearNone", "tween": true, "target": 13, "key": "rotation", "index": 0 }, { "value": 45, "tweenMethod": "linearNone", "tween": true, "target": 13, "key": "rotation", "index": 5 }, { "value": 90, "tweenMethod": "linearNone", "tween": true, "target": 13, "key": "rotation", "index": 10 }] } }], "name": "ani2", "id": 2, "frameRate": 24, "action": 2 }], "loadList": ["game/pifu-1-13.png", "game/-1(2).png", "bg/-1.png", "game/huode-1-4.png", "icon/skin1.png", "game/jiesuan-1-6.png", "game/-2.png", "game/fuhuo-1-3.png"], "loadList3D": [] };
- Window.ShareVideoWindowUI = ShareVideoWindowUI;
- REG("ui.Window.ShareVideoWindowUI", ShareVideoWindowUI);
- class SignWindowUI extends Laya.Scene {
- constructor() { super(); }
- createChildren() {
- super.createChildren();
- this.createView(SignWindowUI.uiView);
- }
- }
- SignWindowUI.uiView = { "type": "Scene", "props": { "width": 720, "height": 1280 }, "compId": 2, "child": [{ "type": "Image", "props": { "width": 720, "top": 0, "skin": "game/zhezhao.png", "name": "bg", "bottom": 0, "alpha": 0.75, "sizeGrid": "10,10,10,10" }, "compId": 3 }, { "type": "Box", "props": { "y": 158, "x": 12, "width": 696, "var": "pan", "height": 642 }, "compId": 9, "child": [{ "type": "Image", "props": { "y": 51, "x": 53.5, "width": 589, "skin": "sign/qiandao-1-2.png", "sizeGrid": "60,60,60,60", "height": 580 }, "compId": 779, "child": [{ "type": "Image", "props": { "y": -31, "x": 177, "skin": "sign/qiandao-1-1.png" }, "compId": 985 }] }, { "type": "Box", "props": { "y": 105, "x": 89, "width": 520, "var": "signlist", "height": 472 }, "compId": 19, "child": [{ "type": "Box", "props": { "y": 11, "width": 122, "left": 50, "height": 133 }, "compId": 14, "child": [{ "type": "Box", "props": { "x": 0, "width": 122, "name": "lock", "height": 133 }, "compId": 49, "child": [{ "type": "Image", "props": { "y": -33, "x": 0, "width": 122, "skin": "sign/qiandao-1-3.png", "name": "bg", "height": 133, "bottom": 0, "sizeGrid": "28,20,27,21" }, "compId": 15, "child": [{ "type": "Text", "props": { "y": 10, "x": 17.5, "width": 87, "value": "100", "valign": "middle", "text": "第1天", "styleSkin": "game/qiandao-1-2.png", "sheet": "0123456789", "height": 34, "fontSize": 22, "font": "SimHei", "color": "#0d83ff", "bold": true, "align": "center", "runtime": "laya.display.Text" }, "compId": 996 }] }, { "type": "Box", "props": { "y": 33, "x": 0, "width": 122, "visible": false, "name": "gold", "height": 100 }, "compId": 50, "child": [{ "type": "Image", "props": { "y": 9, "x": 41, "width": 39, "skin": "sign/jb.png", "height": 49 }, "compId": 53 }, { "type": "Text", "props": { "y": 58, "x": 17.5, "width": 87, "value": "100", "valign": "middle", "text": "100", "styleSkin": "game/qiandao-1-2.png", "sheet": "0123456789", "height": 34, "fontSize": 26, "font": "SimHei", "color": "#0d83ff", "bold": true, "align": "center", "runtime": "laya.display.Text" }, "compId": 55 }] }, { "type": "Box", "props": { "y": 33, "x": 0, "width": 122, "visible": false, "name": "car", "height": 100 }, "compId": 51, "child": [{ "type": "Image", "props": { "y": 50, "x": 61, "width": 42, "skin": "icon/skin1.png", "height": 91, "anchorY": 0.5, "anchorX": 0.5 }, "compId": 56 }] }] }, { "type": "Box", "props": { "x": 0, "width": 122, "visible": false, "name": "arrive", "height": 133 }, "compId": 986, "child": [{ "type": "Image", "props": { "y": -33, "x": 0, "width": 122, "skin": "sign/qiandao-1-4.png", "name": "bg", "height": 133, "bottom": 0, "sizeGrid": "24,22,25,23" }, "compId": 992, "child": [{ "type": "Image", "props": { "y": 5.5, "x": 0, "width": 122, "skin": "sign/qiandao-1-7.png", "height": 122 }, "compId": 993 }, { "type": "Text", "props": { "y": 9, "x": 17, "width": 87, "value": "100", "valign": "middle", "text": "第2天", "styleSkin": "game/qiandao-1-2.png", "sheet": "0123456789", "height": 26, "fontSize": 22, "font": "SimHei", "color": "#ffffff", "bold": true, "align": "center", "runtime": "laya.display.Text" }, "compId": 997 }] }, { "type": "Box", "props": { "y": 33, "x": 0, "width": 122, "visible": false, "name": "gold", "height": 100 }, "compId": 987, "child": [{ "type": "Image", "props": { "y": 9, "x": 41, "width": 39, "skin": "sign/jb.png", "height": 49 }, "compId": 988 }, { "type": "Text", "props": { "y": 58, "x": 17.5, "width": 87, "value": "100", "valign": "middle", "text": "100", "styleSkin": "game/qiandao-1-2.png", "sheet": "0123456789", "height": 34, "fontSize": 26, "font": "SimHei", "color": "#ffffff", "bold": true, "align": "center", "runtime": "laya.display.Text" }, "compId": 989 }] }, { "type": "Box", "props": { "y": 33, "x": 0, "width": 122, "visible": false, "name": "car", "height": 100 }, "compId": 990, "child": [{ "type": "Image", "props": { "y": 50, "x": 61, "width": 42, "skin": "icon/skin1.png", "height": 91, "anchorY": 0.5, "anchorX": 0.5 }, "compId": 1202 }] }] }, { "type": "Box", "props": { "y": 0, "x": 0, "width": 122, "visible": false, "styleSkin": "sign/qianwan-di.png", "name": "complete", "height": 133 }, "compId": 47, "child": [{ "type": "Image", "props": { "y": 0, "x": 0, "width": 122, "skin": "sign/qiandao-1-3.png", "name": "bg", "height": 133, "bottom": 0, "sizeGrid": "28,20,27,21" }, "compId": 994, "child": [{ "type": "Text", "props": { "y": 9, "x": 17, "width": 87, "value": "100", "valign": "middle", "text": "第1天", "styleSkin": "game/qiandao-1-2.png", "sheet": "0123456789", "height": 26, "fontSize": 22, "font": "SimHei", "color": "#0d83ff", "bold": true, "align": "center", "runtime": "laya.display.Text" }, "compId": 998 }] }, { "type": "Box", "props": { "y": 32, "x": 0, "width": 122, "visible": false, "name": "gold", "height": 100 }, "compId": 999, "child": [{ "type": "Image", "props": { "y": 9, "x": 41, "width": 39, "skin": "sign/jb.png", "height": 49 }, "compId": 1001 }, { "type": "Text", "props": { "y": 58, "x": 17.5, "width": 87, "value": "100", "valign": "middle", "text": "100", "styleSkin": "game/qiandao-1-2.png", "sheet": "0123456789", "height": 34, "fontSize": 26, "font": "SimHei", "color": "#ffffff", "bold": true, "align": "center", "runtime": "laya.display.Text" }, "compId": 1002 }] }, { "type": "Box", "props": { "y": 32, "x": 0, "width": 122, "visible": false, "name": "car", "height": 100 }, "compId": 1000, "child": [{ "type": "Image", "props": { "y": 50, "x": 61, "width": 42, "skin": "icon/skin1.png", "height": 91, "anchorY": 0.5, "anchorX": 0.5 }, "compId": 1203 }] }, { "type": "Image", "props": { "y": 82, "x": 0, "skin": "sign/qiandao-1-5.png" }, "compId": 666 }] }, { "type": "Button", "props": { "y": 0, "x": 0, "width": 122, "visible": false, "stateNum": 1, "name": "signbtn", "height": 133 }, "compId": 675 }] }, { "type": "Box", "props": { "y": 11, "width": 273, "right": 50, "height": 133 }, "compId": 1032, "child": [{ "type": "Box", "props": { "x": 0, "width": 273, "name": "lock", "height": 133 }, "compId": 1033, "child": [{ "type": "Image", "props": { "y": -33, "x": 0, "width": 273, "skin": "sign/qiandao-1-3.png", "name": "bg", "height": 133, "bottom": 0, "sizeGrid": "28,20,27,21" }, "compId": 1034, "child": [{ "type": "Text", "props": { "y": 10, "x": 93, "width": 87, "value": "100", "valign": "middle", "text": "第2天", "styleSkin": "game/qiandao-1-2.png", "sheet": "0123456789", "height": 34, "fontSize": 22, "font": "SimHei", "color": "#0d83ff", "bold": true, "align": "center", "runtime": "laya.display.Text" }, "compId": 1035 }] }, { "type": "Box", "props": { "y": 33, "x": 75, "width": 122, "visible": false, "name": "gold", "height": 100 }, "compId": 1036, "child": [{ "type": "Image", "props": { "y": 9, "x": 41, "width": 39, "skin": "sign/jb.png", "height": 49 }, "compId": 1037 }, { "type": "Text", "props": { "y": 58, "x": 17.5, "width": 87, "value": "100", "valign": "middle", "text": "100", "styleSkin": "game/qiandao-1-2.png", "sheet": "0123456789", "height": 34, "fontSize": 26, "font": "SimHei", "color": "#0d83ff", "bold": true, "align": "center", "runtime": "laya.display.Text" }, "compId": 1038 }] }, { "type": "Box", "props": { "y": 33, "x": 75, "width": 122, "visible": false, "name": "car", "height": 100 }, "compId": 1039, "child": [{ "type": "Image", "props": { "y": 50, "x": 61, "width": 42, "skin": "icon/skin1.png", "height": 91, "anchorY": 0.5, "anchorX": 0.5 }, "compId": 1204 }] }] }, { "type": "Box", "props": { "x": 0, "width": 273, "visible": false, "name": "arrive", "height": 133 }, "compId": 1041, "child": [{ "type": "Image", "props": { "y": -33, "x": 0, "width": 273, "skin": "sign/qiandao-1-4.png", "name": "bg", "height": 133, "bottom": 0, "sizeGrid": "24,22,25,23" }, "compId": 1042, "child": [{ "type": "Image", "props": { "y": 5, "x": 75, "width": 122, "skin": "sign/qiandao-1-7.png", "height": 122 }, "compId": 1043 }, { "type": "Text", "props": { "y": 9, "x": 93, "width": 87, "value": "100", "valign": "middle", "text": "第2天", "styleSkin": "game/qiandao-1-2.png", "sheet": "0123456789", "height": 26, "fontSize": 22, "font": "SimHei", "color": "#ffffff", "bold": true, "align": "center", "runtime": "laya.display.Text" }, "compId": 1044 }] }, { "type": "Box", "props": { "y": 33, "x": 75, "width": 122, "visible": false, "name": "gold", "height": 100 }, "compId": 1045, "child": [{ "type": "Image", "props": { "y": 9, "x": 41, "width": 39, "skin": "sign/jb.png", "height": 49 }, "compId": 1046 }, { "type": "Text", "props": { "y": 58, "x": 17.5, "width": 87, "value": "100", "valign": "middle", "text": "100", "styleSkin": "game/qiandao-1-2.png", "sheet": "0123456789", "height": 34, "fontSize": 26, "font": "SimHei", "color": "#ffffff", "bold": true, "align": "center", "runtime": "laya.display.Text" }, "compId": 1047 }] }, { "type": "Box", "props": { "y": 33, "x": 75, "width": 122, "visible": false, "name": "car", "height": 100 }, "compId": 1048, "child": [{ "type": "Image", "props": { "y": 50, "x": 61, "width": 42, "skin": "icon/skin1.png", "height": 91, "anchorY": 0.5, "anchorX": 0.5 }, "compId": 1205 }] }] }, { "type": "Box", "props": { "y": 0, "x": 0, "width": 273, "visible": false, "styleSkin": "sign/qianwan-di.png", "name": "complete", "height": 133 }, "compId": 1050, "child": [{ "type": "Image", "props": { "y": 0, "x": 0, "width": 273, "skin": "sign/qiandao-1-3.png", "name": "bg", "height": 133, "bottom": 0, "sizeGrid": "28,20,27,21" }, "compId": 1051, "child": [{ "type": "Text", "props": { "y": 9, "x": 93, "width": 87, "value": "100", "valign": "middle", "text": "第2天", "styleSkin": "game/qiandao-1-2.png", "sheet": "0123456789", "height": 26, "fontSize": 22, "font": "SimHei", "color": "#0d83ff", "bold": true, "align": "center", "runtime": "laya.display.Text" }, "compId": 1052 }] }, { "type": "Box", "props": { "y": 32, "x": 75, "width": 122, "visible": false, "name": "gold", "height": 100 }, "compId": 1053, "child": [{ "type": "Image", "props": { "y": 9, "x": 41, "width": 39, "skin": "sign/jb.png", "height": 49 }, "compId": 1054 }, { "type": "Text", "props": { "y": 58, "x": 17.5, "width": 87, "value": "100", "valign": "middle", "text": "100", "styleSkin": "game/qiandao-1-2.png", "sheet": "0123456789", "height": 34, "fontSize": 26, "font": "SimHei", "color": "#ffffff", "bold": true, "align": "center", "runtime": "laya.display.Text" }, "compId": 1055 }] }, { "type": "Box", "props": { "y": 32, "x": 75, "width": 122, "visible": false, "name": "car", "height": 100 }, "compId": 1056, "child": [{ "type": "Image", "props": { "y": 50, "x": 61, "width": 42, "skin": "icon/skin1.png", "height": 91, "anchorY": 0.5, "anchorX": 0.5 }, "compId": 1206 }] }, { "type": "Image", "props": { "y": 82, "x": 0, "skin": "sign/qiandao-1-5.png" }, "compId": 1058 }] }, { "type": "Button", "props": { "y": 0, "x": 0, "width": 273, "visible": false, "stateNum": 1, "name": "signbtn", "height": 133 }, "compId": 1059 }] }, { "type": "Box", "props": { "y": 169.5, "x": 50, "width": 273, "height": 133 }, "compId": 1060, "child": [{ "type": "Box", "props": { "x": 0, "width": 273, "name": "lock", "height": 133 }, "compId": 1061, "child": [{ "type": "Image", "props": { "y": -33, "x": 0, "width": 273, "skin": "sign/qiandao-1-3.png", "name": "bg", "height": 133, "bottom": 0, "sizeGrid": "28,20,27,21" }, "compId": 1062, "child": [{ "type": "Text", "props": { "y": 10, "x": 93, "width": 87, "value": "100", "valign": "middle", "text": "第3天", "styleSkin": "game/qiandao-1-2.png", "sheet": "0123456789", "height": 34, "fontSize": 22, "font": "SimHei", "color": "#0d83ff", "bold": true, "align": "center", "runtime": "laya.display.Text" }, "compId": 1063 }] }, { "type": "Box", "props": { "y": 33, "x": 75, "width": 122, "visible": false, "name": "gold", "height": 100 }, "compId": 1064, "child": [{ "type": "Image", "props": { "y": 9, "x": 41, "width": 39, "skin": "sign/jb.png", "height": 49 }, "compId": 1065 }, { "type": "Text", "props": { "y": 58, "x": 17.5, "width": 87, "value": "100", "valign": "middle", "text": "100", "styleSkin": "game/qiandao-1-2.png", "sheet": "0123456789", "height": 34, "fontSize": 26, "font": "SimHei", "color": "#0d83ff", "bold": true, "align": "center", "runtime": "laya.display.Text" }, "compId": 1066 }] }, { "type": "Box", "props": { "y": 33, "x": 75, "width": 122, "visible": false, "name": "car", "height": 100 }, "compId": 1067, "child": [{ "type": "Image", "props": { "y": 50, "x": 61, "width": 42, "skin": "icon/skin1.png", "height": 91, "anchorY": 0.5, "anchorX": 0.5 }, "compId": 1207 }] }] }, { "type": "Box", "props": { "x": 0, "width": 273, "visible": false, "name": "arrive", "height": 133 }, "compId": 1069, "child": [{ "type": "Image", "props": { "y": -33, "x": 0, "width": 273, "skin": "sign/qiandao-1-4.png", "name": "bg", "height": 133, "bottom": 0, "sizeGrid": "24,22,25,23" }, "compId": 1070, "child": [{ "type": "Image", "props": { "y": 5, "x": 75, "width": 122, "skin": "sign/qiandao-1-7.png", "height": 122 }, "compId": 1071 }, { "type": "Text", "props": { "y": 9, "x": 93, "width": 87, "value": "100", "valign": "middle", "text": "第3天", "styleSkin": "game/qiandao-1-2.png", "sheet": "0123456789", "height": 26, "fontSize": 22, "font": "SimHei", "color": "#ffffff", "bold": true, "align": "center", "runtime": "laya.display.Text" }, "compId": 1072 }] }, { "type": "Box", "props": { "y": 33, "x": 75, "width": 122, "visible": false, "name": "gold", "height": 100 }, "compId": 1073, "child": [{ "type": "Image", "props": { "y": 9, "x": 41, "width": 39, "skin": "sign/jb.png", "height": 49 }, "compId": 1074 }, { "type": "Text", "props": { "y": 58, "x": 17.5, "width": 87, "value": "100", "valign": "middle", "text": "100", "styleSkin": "game/qiandao-1-2.png", "sheet": "0123456789", "height": 34, "fontSize": 26, "font": "SimHei", "color": "#ffffff", "bold": true, "align": "center", "runtime": "laya.display.Text" }, "compId": 1075 }] }, { "type": "Box", "props": { "y": 33, "x": 75, "width": 122, "visible": false, "name": "car", "height": 100 }, "compId": 1076, "child": [{ "type": "Image", "props": { "y": 50, "x": 61, "width": 42, "skin": "icon/skin1.png", "height": 91, "anchorY": 0.5, "anchorX": 0.5 }, "compId": 1208 }] }] }, { "type": "Box", "props": { "y": 0, "x": 0, "width": 273, "visible": false, "styleSkin": "sign/qianwan-di.png", "name": "complete", "height": 133 }, "compId": 1078, "child": [{ "type": "Image", "props": { "y": 0, "x": 0, "width": 273, "skin": "sign/qiandao-1-3.png", "name": "bg", "height": 133, "bottom": 0, "sizeGrid": "28,20,27,21" }, "compId": 1079, "child": [{ "type": "Text", "props": { "y": 9, "x": 93, "width": 87, "value": "100", "valign": "middle", "text": "第3天", "styleSkin": "game/qiandao-1-2.png", "sheet": "0123456789", "height": 26, "fontSize": 22, "font": "SimHei", "color": "#0d83ff", "bold": true, "align": "center", "runtime": "laya.display.Text" }, "compId": 1080 }] }, { "type": "Box", "props": { "y": 32, "x": 75, "width": 122, "visible": false, "name": "gold", "height": 100 }, "compId": 1081, "child": [{ "type": "Image", "props": { "y": 9, "x": 41, "width": 39, "skin": "sign/jb.png", "height": 49 }, "compId": 1082 }, { "type": "Text", "props": { "y": 58, "x": 17.5, "width": 87, "value": "100", "valign": "middle", "text": "100", "styleSkin": "game/qiandao-1-2.png", "sheet": "0123456789", "height": 34, "fontSize": 26, "font": "SimHei", "color": "#ffffff", "bold": true, "align": "center", "runtime": "laya.display.Text" }, "compId": 1083 }] }, { "type": "Box", "props": { "y": 32, "x": 75, "width": 122, "visible": false, "name": "car", "height": 100 }, "compId": 1084, "child": [{ "type": "Image", "props": { "y": 50, "x": 61, "width": 42, "skin": "icon/skin1.png", "height": 91, "anchorY": 0.5, "anchorX": 0.5 }, "compId": 1209 }] }, { "type": "Image", "props": { "y": 82, "x": 0, "skin": "sign/qiandao-1-5.png" }, "compId": 1086 }] }, { "type": "Button", "props": { "y": 0, "x": 0, "width": 273, "visible": false, "stateNum": 1, "name": "signbtn", "height": 133 }, "compId": 1087 }] }, { "type": "Box", "props": { "y": 169.5, "x": 348, "width": 122, "height": 133 }, "compId": 1088, "child": [{ "type": "Box", "props": { "x": 0, "width": 122, "name": "lock", "height": 133 }, "compId": 1089, "child": [{ "type": "Image", "props": { "y": -33, "x": 0, "width": 122, "skin": "sign/qiandao-1-3.png", "name": "bg", "height": 133, "bottom": 0, "sizeGrid": "28,20,27,21" }, "compId": 1090, "child": [{ "type": "Text", "props": { "y": 10, "x": 17.5, "width": 87, "value": "100", "valign": "middle", "text": "第4天", "styleSkin": "game/qiandao-1-2.png", "sheet": "0123456789", "height": 34, "fontSize": 22, "font": "SimHei", "color": "#0d83ff", "bold": true, "align": "center", "runtime": "laya.display.Text" }, "compId": 1091 }] }, { "type": "Box", "props": { "y": 33, "x": 0, "width": 122, "visible": false, "name": "gold", "height": 100 }, "compId": 1092, "child": [{ "type": "Image", "props": { "y": 9, "x": 41, "width": 39, "skin": "sign/jb.png", "height": 49 }, "compId": 1093 }, { "type": "Text", "props": { "y": 58, "x": 17.5, "width": 87, "value": "100", "valign": "middle", "text": "100", "styleSkin": "game/qiandao-1-2.png", "sheet": "0123456789", "height": 34, "fontSize": 26, "font": "SimHei", "color": "#0d83ff", "bold": true, "align": "center", "runtime": "laya.display.Text" }, "compId": 1094 }] }, { "type": "Box", "props": { "y": 33, "x": 0, "width": 122, "visible": false, "name": "car", "height": 100 }, "compId": 1095, "child": [{ "type": "Image", "props": { "y": 50, "x": 61, "width": 42, "skin": "icon/skin1.png", "height": 91, "anchorY": 0.5, "anchorX": 0.5 }, "compId": 1210 }] }] }, { "type": "Box", "props": { "x": 0, "width": 122, "visible": false, "name": "arrive", "height": 133 }, "compId": 1097, "child": [{ "type": "Image", "props": { "y": -33, "x": 0, "width": 122, "skin": "sign/qiandao-1-4.png", "name": "bg", "height": 133, "bottom": 0, "sizeGrid": "24,22,25,23" }, "compId": 1098, "child": [{ "type": "Image", "props": { "y": 5.5, "x": 0, "width": 122, "skin": "sign/qiandao-1-7.png", "height": 122 }, "compId": 1099 }, { "type": "Text", "props": { "y": 9, "x": 17, "width": 87, "value": "100", "valign": "middle", "text": "第4天", "styleSkin": "game/qiandao-1-2.png", "sheet": "0123456789", "height": 26, "fontSize": 22, "font": "SimHei", "color": "#ffffff", "bold": true, "align": "center", "runtime": "laya.display.Text" }, "compId": 1100 }] }, { "type": "Box", "props": { "y": 33, "x": 0, "width": 122, "visible": false, "name": "gold", "height": 100 }, "compId": 1101, "child": [{ "type": "Image", "props": { "y": 9, "x": 41, "width": 39, "skin": "sign/jb.png", "height": 49 }, "compId": 1102 }, { "type": "Text", "props": { "y": 58, "x": 17.5, "width": 87, "value": "100", "valign": "middle", "text": "100", "styleSkin": "game/qiandao-1-2.png", "sheet": "0123456789", "height": 34, "fontSize": 26, "font": "SimHei", "color": "#ffffff", "bold": true, "align": "center", "runtime": "laya.display.Text" }, "compId": 1103 }] }, { "type": "Box", "props": { "y": 33, "x": 0, "width": 122, "visible": false, "name": "car", "height": 100 }, "compId": 1104, "child": [{ "type": "Image", "props": { "y": 50, "x": 61, "width": 42, "skin": "icon/skin1.png", "height": 91, "anchorY": 0.5, "anchorX": 0.5 }, "compId": 1211 }] }] }, { "type": "Box", "props": { "y": 0, "x": 0, "width": 122, "visible": false, "styleSkin": "sign/qianwan-di.png", "name": "complete", "height": 133 }, "compId": 1106, "child": [{ "type": "Image", "props": { "y": 0, "x": 0, "width": 122, "skin": "sign/qiandao-1-3.png", "name": "bg", "height": 133, "bottom": 0, "sizeGrid": "28,20,27,21" }, "compId": 1107, "child": [{ "type": "Text", "props": { "y": 9, "x": 17, "width": 87, "value": "100", "valign": "middle", "text": "第4天", "styleSkin": "game/qiandao-1-2.png", "sheet": "0123456789", "height": 26, "fontSize": 22, "font": "SimHei", "color": "#0d83ff", "bold": true, "align": "center", "runtime": "laya.display.Text" }, "compId": 1108 }] }, { "type": "Box", "props": { "y": 32, "x": 0, "width": 122, "visible": false, "name": "gold", "height": 100 }, "compId": 1109, "child": [{ "type": "Image", "props": { "y": 9, "x": 41, "width": 39, "skin": "sign/jb.png", "height": 49 }, "compId": 1110 }, { "type": "Text", "props": { "y": 58, "x": 17.5, "width": 87, "value": "100", "valign": "middle", "text": "100", "styleSkin": "game/qiandao-1-2.png", "sheet": "0123456789", "height": 34, "fontSize": 26, "font": "SimHei", "color": "#ffffff", "bold": true, "align": "center", "runtime": "laya.display.Text" }, "compId": 1111 }] }, { "type": "Box", "props": { "y": 32, "x": 0, "width": 122, "visible": false, "name": "car", "height": 100 }, "compId": 1112, "child": [{ "type": "Image", "props": { "y": 50, "x": 61, "width": 42, "skin": "icon/skin1.png", "height": 91, "anchorY": 0.5, "anchorX": 0.5 }, "compId": 1212 }] }, { "type": "Image", "props": { "y": 82, "x": 0, "skin": "sign/qiandao-1-5.png" }, "compId": 1114 }] }, { "type": "Button", "props": { "y": 0, "x": 0, "width": 122, "visible": false, "stateNum": 1, "name": "signbtn", "height": 133 }, "compId": 1115 }] }, { "type": "Box", "props": { "y": 318, "x": 50, "width": 122, "height": 133 }, "compId": 1116, "child": [{ "type": "Box", "props": { "x": 0, "width": 122, "name": "lock", "height": 133 }, "compId": 1117, "child": [{ "type": "Image", "props": { "y": -33, "x": 0, "width": 122, "skin": "sign/qiandao-1-3.png", "name": "bg", "height": 133, "bottom": 0, "sizeGrid": "28,20,27,21" }, "compId": 1118, "child": [{ "type": "Text", "props": { "y": 10, "x": 17.5, "width": 87, "value": "100", "valign": "middle", "text": "第5天", "styleSkin": "game/qiandao-1-2.png", "sheet": "0123456789", "height": 34, "fontSize": 22, "font": "SimHei", "color": "#0d83ff", "bold": true, "align": "center", "runtime": "laya.display.Text" }, "compId": 1119 }] }, { "type": "Box", "props": { "y": 33, "x": 0, "width": 122, "visible": false, "name": "gold", "height": 100 }, "compId": 1120, "child": [{ "type": "Image", "props": { "y": 9, "x": 41, "width": 39, "skin": "sign/jb.png", "height": 49 }, "compId": 1121 }, { "type": "Text", "props": { "y": 58, "x": 17.5, "width": 87, "value": "100", "valign": "middle", "text": "100", "styleSkin": "game/qiandao-1-2.png", "sheet": "0123456789", "height": 34, "fontSize": 26, "font": "SimHei", "color": "#0d83ff", "bold": true, "align": "center", "runtime": "laya.display.Text" }, "compId": 1122 }] }, { "type": "Box", "props": { "y": 33, "x": 0, "width": 122, "visible": false, "name": "car", "height": 100 }, "compId": 1123, "child": [{ "type": "Image", "props": { "y": 50, "x": 61, "width": 42, "skin": "icon/skin1.png", "height": 91, "anchorY": 0.5, "anchorX": 0.5 }, "compId": 1213 }] }] }, { "type": "Box", "props": { "x": 0, "width": 122, "visible": false, "name": "arrive", "height": 133 }, "compId": 1125, "child": [{ "type": "Image", "props": { "y": -33, "x": 0, "width": 122, "skin": "sign/qiandao-1-4.png", "name": "bg", "height": 133, "bottom": 0, "sizeGrid": "24,22,25,23" }, "compId": 1126, "child": [{ "type": "Image", "props": { "y": 5.5, "x": 0, "width": 122, "skin": "sign/qiandao-1-7.png", "height": 122 }, "compId": 1127 }, { "type": "Text", "props": { "y": 9, "x": 17, "width": 87, "value": "100", "valign": "middle", "text": "第5天", "styleSkin": "game/qiandao-1-2.png", "sheet": "0123456789", "height": 26, "fontSize": 22, "font": "SimHei", "color": "#ffffff", "bold": true, "align": "center", "runtime": "laya.display.Text" }, "compId": 1128 }] }, { "type": "Box", "props": { "y": 33, "x": 0, "width": 122, "visible": false, "name": "gold", "height": 100 }, "compId": 1129, "child": [{ "type": "Image", "props": { "y": 9, "x": 41, "width": 39, "skin": "sign/jb.png", "height": 49 }, "compId": 1130 }, { "type": "Text", "props": { "y": 58, "x": 17.5, "width": 87, "value": "100", "valign": "middle", "text": "100", "styleSkin": "game/qiandao-1-2.png", "sheet": "0123456789", "height": 34, "fontSize": 26, "font": "SimHei", "color": "#ffffff", "bold": true, "align": "center", "runtime": "laya.display.Text" }, "compId": 1131 }] }, { "type": "Box", "props": { "y": 33, "x": 0, "width": 122, "visible": false, "name": "car", "height": 100 }, "compId": 1132, "child": [{ "type": "Image", "props": { "y": 50, "x": 61, "width": 42, "skin": "icon/skin1.png", "height": 91, "anchorY": 0.5, "anchorX": 0.5 }, "compId": 1214 }] }] }, { "type": "Box", "props": { "y": 0, "x": 0, "width": 122, "visible": false, "styleSkin": "sign/qianwan-di.png", "name": "complete", "height": 133 }, "compId": 1134, "child": [{ "type": "Image", "props": { "y": 0, "x": 0, "width": 122, "skin": "sign/qiandao-1-3.png", "name": "bg", "height": 133, "bottom": 0, "sizeGrid": "28,20,27,21" }, "compId": 1135, "child": [{ "type": "Text", "props": { "y": 9, "x": 17, "width": 87, "value": "100", "valign": "middle", "text": "第5天", "styleSkin": "game/qiandao-1-2.png", "sheet": "0123456789", "height": 26, "fontSize": 22, "font": "SimHei", "color": "#0d83ff", "bold": true, "align": "center", "runtime": "laya.display.Text" }, "compId": 1136 }] }, { "type": "Box", "props": { "y": 32, "x": 0, "width": 122, "visible": false, "name": "gold", "height": 100 }, "compId": 1137, "child": [{ "type": "Image", "props": { "y": 9, "x": 41, "width": 39, "skin": "sign/jb.png", "height": 49 }, "compId": 1138 }, { "type": "Text", "props": { "y": 58, "x": 17.5, "width": 87, "value": "100", "valign": "middle", "text": "100", "styleSkin": "game/qiandao-1-2.png", "sheet": "0123456789", "height": 34, "fontSize": 26, "font": "SimHei", "color": "#ffffff", "bold": true, "align": "center", "runtime": "laya.display.Text" }, "compId": 1139 }] }, { "type": "Box", "props": { "y": 32, "x": 0, "width": 122, "visible": false, "name": "car", "height": 100 }, "compId": 1140, "child": [{ "type": "Image", "props": { "y": 50, "x": 61, "width": 42, "skin": "icon/skin1.png", "height": 91, "anchorY": 0.5, "anchorX": 0.5 }, "compId": 1215 }] }, { "type": "Image", "props": { "y": 82, "x": 0, "skin": "sign/qiandao-1-5.png" }, "compId": 1142 }] }, { "type": "Button", "props": { "y": 0, "x": 0, "width": 122, "visible": false, "stateNum": 1, "name": "signbtn", "height": 133 }, "compId": 1143 }] }, { "type": "Box", "props": { "y": 318, "x": 209.5, "width": 122, "height": 133 }, "compId": 1144, "child": [{ "type": "Box", "props": { "x": 0, "width": 122, "name": "lock", "height": 133 }, "compId": 1145, "child": [{ "type": "Image", "props": { "y": -33, "x": 0, "width": 122, "skin": "sign/qiandao-1-3.png", "name": "bg", "height": 133, "bottom": 0, "sizeGrid": "28,20,27,21" }, "compId": 1146, "child": [{ "type": "Text", "props": { "y": 10, "x": 17.5, "width": 87, "value": "100", "valign": "middle", "text": "第6天", "styleSkin": "game/qiandao-1-2.png", "sheet": "0123456789", "height": 34, "fontSize": 22, "font": "SimHei", "color": "#0d83ff", "bold": true, "align": "center", "runtime": "laya.display.Text" }, "compId": 1147 }] }, { "type": "Box", "props": { "y": 33, "x": 0, "width": 122, "visible": false, "name": "gold", "height": 100 }, "compId": 1148, "child": [{ "type": "Image", "props": { "y": 9, "x": 41, "width": 39, "skin": "sign/jb.png", "height": 49 }, "compId": 1149 }, { "type": "Text", "props": { "y": 58, "x": 17.5, "width": 87, "value": "100", "valign": "middle", "text": "100", "styleSkin": "game/qiandao-1-2.png", "sheet": "0123456789", "height": 34, "fontSize": 26, "font": "SimHei", "color": "#0d83ff", "bold": true, "align": "center", "runtime": "laya.display.Text" }, "compId": 1150 }] }, { "type": "Box", "props": { "y": 33, "x": 0, "width": 122, "visible": false, "name": "car", "height": 100 }, "compId": 1151, "child": [{ "type": "Image", "props": { "y": 50, "x": 61, "width": 42, "skin": "icon/skin1.png", "height": 91, "anchorY": 0.5, "anchorX": 0.5 }, "compId": 1216 }] }] }, { "type": "Box", "props": { "x": 0, "width": 122, "visible": false, "name": "arrive", "height": 133 }, "compId": 1153, "child": [{ "type": "Image", "props": { "y": -33, "x": 0, "width": 122, "skin": "sign/qiandao-1-4.png", "name": "bg", "height": 133, "bottom": 0, "sizeGrid": "24,22,25,23" }, "compId": 1154, "child": [{ "type": "Image", "props": { "y": 5.5, "x": 0, "width": 122, "skin": "sign/qiandao-1-7.png", "height": 122 }, "compId": 1155 }, { "type": "Text", "props": { "y": 9, "x": 17, "width": 87, "value": "100", "valign": "middle", "text": "第6天", "styleSkin": "game/qiandao-1-2.png", "sheet": "0123456789", "height": 26, "fontSize": 22, "font": "SimHei", "color": "#ffffff", "bold": true, "align": "center", "runtime": "laya.display.Text" }, "compId": 1156 }] }, { "type": "Box", "props": { "y": 33, "x": 0, "width": 122, "visible": false, "name": "gold", "height": 100 }, "compId": 1157, "child": [{ "type": "Image", "props": { "y": 9, "x": 41, "width": 39, "skin": "sign/jb.png", "height": 49 }, "compId": 1158 }, { "type": "Text", "props": { "y": 58, "x": 17.5, "width": 87, "value": "100", "valign": "middle", "text": "100", "styleSkin": "game/qiandao-1-2.png", "sheet": "0123456789", "height": 34, "fontSize": 26, "font": "SimHei", "color": "#ffffff", "bold": true, "align": "center", "runtime": "laya.display.Text" }, "compId": 1159 }] }, { "type": "Box", "props": { "y": 33, "x": 0, "width": 122, "visible": false, "name": "car", "height": 100 }, "compId": 1160, "child": [{ "type": "Image", "props": { "y": 50, "x": 61, "width": 42, "skin": "icon/skin1.png", "height": 91, "anchorY": 0.5, "anchorX": 0.5 }, "compId": 1217 }] }] }, { "type": "Box", "props": { "y": 0, "x": 0, "width": 122, "visible": false, "styleSkin": "sign/qianwan-di.png", "name": "complete", "height": 133 }, "compId": 1162, "child": [{ "type": "Image", "props": { "y": 0, "x": 0, "width": 122, "skin": "sign/qiandao-1-3.png", "name": "bg", "height": 133, "bottom": 0, "sizeGrid": "28,20,27,21" }, "compId": 1163, "child": [{ "type": "Text", "props": { "y": 9, "x": 17, "width": 87, "value": "100", "valign": "middle", "text": "第6天", "styleSkin": "game/qiandao-1-2.png", "sheet": "0123456789", "height": 26, "fontSize": 22, "font": "SimHei", "color": "#0d83ff", "bold": true, "align": "center", "runtime": "laya.display.Text" }, "compId": 1164 }] }, { "type": "Box", "props": { "y": 32, "x": 0, "width": 122, "visible": false, "name": "gold", "height": 100 }, "compId": 1165, "child": [{ "type": "Image", "props": { "y": 9, "x": 41, "width": 39, "skin": "sign/jb.png", "height": 49 }, "compId": 1166 }, { "type": "Text", "props": { "y": 58, "x": 17.5, "width": 87, "value": "100", "valign": "middle", "text": "100", "styleSkin": "game/qiandao-1-2.png", "sheet": "0123456789", "height": 34, "fontSize": 26, "font": "SimHei", "color": "#ffffff", "bold": true, "align": "center", "runtime": "laya.display.Text" }, "compId": 1167 }] }, { "type": "Box", "props": { "y": 32, "x": 0, "width": 122, "visible": false, "name": "car", "height": 100 }, "compId": 1168, "child": [{ "type": "Image", "props": { "y": 50, "x": 61, "width": 42, "skin": "icon/skin1.png", "height": 91, "anchorY": 0.5, "anchorX": 0.5 }, "compId": 1218 }] }, { "type": "Image", "props": { "y": 82, "x": 0, "skin": "sign/qiandao-1-5.png" }, "compId": 1170 }] }, { "type": "Button", "props": { "y": 0, "x": 0, "width": 122, "visible": false, "stateNum": 1, "name": "signbtn", "height": 133 }, "compId": 1171 }] }, { "type": "Box", "props": { "y": 318, "x": 348, "width": 122, "height": 133 }, "compId": 1172, "child": [{ "type": "Box", "props": { "x": 0, "width": 122, "name": "lock", "height": 133 }, "compId": 1173, "child": [{ "type": "Image", "props": { "y": -33, "x": 0, "width": 122, "skin": "sign/qiandao-1-3.png", "name": "bg", "height": 133, "bottom": 0, "sizeGrid": "28,20,27,21" }, "compId": 1174, "child": [{ "type": "Text", "props": { "y": 10, "x": 17.5, "width": 87, "value": "100", "valign": "middle", "text": "第7天", "styleSkin": "game/qiandao-1-2.png", "sheet": "0123456789", "height": 34, "fontSize": 22, "font": "SimHei", "color": "#0d83ff", "bold": true, "align": "center", "runtime": "laya.display.Text" }, "compId": 1175 }] }, { "type": "Box", "props": { "y": 33, "x": 0, "width": 122, "visible": false, "name": "gold", "height": 100 }, "compId": 1176, "child": [{ "type": "Image", "props": { "y": 9, "x": 41, "width": 39, "skin": "sign/jb.png", "height": 49 }, "compId": 1177 }, { "type": "Text", "props": { "y": 58, "x": 17.5, "width": 87, "value": "100", "valign": "middle", "text": "100", "styleSkin": "game/qiandao-1-2.png", "sheet": "0123456789", "height": 34, "fontSize": 26, "font": "SimHei", "color": "#0d83ff", "bold": true, "align": "center", "runtime": "laya.display.Text" }, "compId": 1178 }] }, { "type": "Box", "props": { "y": 33, "x": 0, "width": 122, "visible": false, "name": "car", "height": 100 }, "compId": 1179, "child": [{ "type": "Image", "props": { "y": 50, "x": 61, "width": 42, "skin": "icon/skin1.png", "height": 91, "anchorY": 0.5, "anchorX": 0.5 }, "compId": 1219 }] }] }, { "type": "Box", "props": { "x": 0, "width": 122, "visible": false, "name": "arrive", "height": 133 }, "compId": 1181, "child": [{ "type": "Image", "props": { "y": -33, "x": 0, "width": 122, "skin": "sign/qiandao-1-4.png", "name": "bg", "height": 133, "bottom": 0, "sizeGrid": "24,22,25,23" }, "compId": 1182, "child": [{ "type": "Image", "props": { "y": 5.5, "x": 0, "width": 122, "skin": "sign/qiandao-1-7.png", "height": 122 }, "compId": 1183 }, { "type": "Text", "props": { "y": 9, "x": 17, "width": 87, "value": "100", "valign": "middle", "text": "第7天", "styleSkin": "game/qiandao-1-2.png", "sheet": "0123456789", "height": 26, "fontSize": 22, "font": "SimHei", "color": "#ffffff", "bold": true, "align": "center", "runtime": "laya.display.Text" }, "compId": 1184 }] }, { "type": "Box", "props": { "y": 33, "x": 0, "width": 122, "visible": false, "name": "gold", "height": 100 }, "compId": 1185, "child": [{ "type": "Image", "props": { "y": 9, "x": 41, "width": 39, "skin": "sign/jb.png", "height": 49 }, "compId": 1186 }, { "type": "Text", "props": { "y": 58, "x": 17.5, "width": 87, "value": "100", "valign": "middle", "text": "100", "styleSkin": "game/qiandao-1-2.png", "sheet": "0123456789", "height": 34, "fontSize": 26, "font": "SimHei", "color": "#ffffff", "bold": true, "align": "center", "runtime": "laya.display.Text" }, "compId": 1187 }] }, { "type": "Box", "props": { "y": 33, "x": 0, "width": 122, "visible": false, "name": "car", "height": 100 }, "compId": 1188, "child": [{ "type": "Image", "props": { "y": 50, "x": 61, "width": 42, "skin": "icon/skin1.png", "height": 91, "anchorY": 0.5, "anchorX": 0.5 }, "compId": 1220 }] }] }, { "type": "Box", "props": { "y": 0, "x": 0, "width": 122, "visible": false, "styleSkin": "sign/qianwan-di.png", "name": "complete", "height": 133 }, "compId": 1190, "child": [{ "type": "Image", "props": { "y": 0, "x": 0, "width": 122, "skin": "sign/qiandao-1-3.png", "name": "bg", "height": 133, "bottom": 0, "sizeGrid": "28,20,27,21" }, "compId": 1191, "child": [{ "type": "Text", "props": { "y": 9, "x": 17, "width": 87, "value": "100", "valign": "middle", "text": "第7天", "styleSkin": "game/qiandao-1-2.png", "sheet": "0123456789", "height": 26, "fontSize": 22, "font": "SimHei", "color": "#0d83ff", "bold": true, "align": "center", "runtime": "laya.display.Text" }, "compId": 1192 }] }, { "type": "Box", "props": { "y": 32, "x": 0, "width": 122, "visible": false, "name": "gold", "height": 100 }, "compId": 1193, "child": [{ "type": "Image", "props": { "y": 9, "x": 41, "width": 39, "skin": "sign/jb.png", "height": 49 }, "compId": 1194 }, { "type": "Text", "props": { "y": 58, "x": 17.5, "width": 87, "value": "100", "valign": "middle", "text": "100", "styleSkin": "game/qiandao-1-2.png", "sheet": "0123456789", "height": 34, "fontSize": 26, "font": "SimHei", "color": "#ffffff", "bold": true, "align": "center", "runtime": "laya.display.Text" }, "compId": 1195 }] }, { "type": "Box", "props": { "y": 32, "x": 0, "width": 122, "visible": false, "name": "car", "height": 100 }, "compId": 1196, "child": [{ "type": "Image", "props": { "y": 50, "x": 61, "width": 42, "skin": "icon/skin1.png", "height": 91, "anchorY": 0.5, "anchorX": 0.5 }, "compId": 1221 }] }, { "type": "Image", "props": { "y": 82, "x": 0, "skin": "sign/qiandao-1-5.png" }, "compId": 1198 }] }, { "type": "Button", "props": { "y": 0, "x": 0, "width": 122, "visible": false, "stateNum": 1, "name": "signbtn", "height": 133 }, "compId": 1199 }] }] }, { "type": "Button", "props": { "y": 35, "x": 590, "var": "closebtn2", "stateNum": 1, "skin": "sign/qiandao-1-8.png" }, "compId": 673 }] }, { "type": "Box", "props": { "y": 831, "x": 0, "width": 720, "visible": true, "var": "Btn", "height": 164 }, "compId": 598, "child": [{ "type": "Button", "props": { "y": -27, "x": 228.5, "width": 263, "var": "videobtn", "height": 27 }, "compId": 1222, "child": [{ "type": "Image", "props": { "y": 2, "skin": "game/waiquan.png" }, "compId": 1223, "child": [{ "type": "Image", "props": { "y": 4, "x": 4, "var": "videopoint", "skin": "game/zhongquan.png" }, "compId": 1224 }] }, { "type": "Image", "props": { "y": 0, "x": 29, "skin": "game/kanshipin-wenzi.png" }, "compId": 1225 }] }, { "type": "Button", "props": { "y": 146, "x": 353, "width": 124, "var": "signBtn", "stateNum": 1, "skin": "sign/qiandao-1-6.png", "scaleY": 1.1, "scaleX": 1.1, "pivotY": 17, "pivotX": 62, "height": 34 }, "compId": 46 }, { "type": "Button", "props": { "y": 61, "x": 377, "var": "awardbtn", "stateNum": 1, "skin": "game/jiesuan-1-3.png", "pivotY": 61, "pivotX": 179 }, "compId": 913 }] }], "animations": [{ "nodes": [{ "target": 913, "keyframes": { "scaleY": [{ "value": 1.1, "tweenMethod": "linearNone", "tween": true, "target": 913, "key": "scaleY", "index": 0 }, { "value": 1, "tweenMethod": "linearNone", "tween": true, "target": 913, "key": "scaleY", "index": 10 }, { "value": 1.1, "tweenMethod": "linearNone", "tween": true, "target": 913, "key": "scaleY", "index": 20 }], "scaleX": [{ "value": 1.1, "tweenMethod": "linearNone", "tween": true, "target": 913, "key": "scaleX", "index": 0 }, { "value": 1, "tweenMethod": "linearNone", "tween": true, "target": 913, "key": "scaleX", "index": 10 }, { "value": 1.1, "tweenMethod": "linearNone", "tween": true, "target": 913, "key": "scaleX", "index": 20 }] } }], "name": "ani8", "id": 8, "frameRate": 24, "action": 2 }], "loadList": ["game/zhezhao.png", "sign/qiandao-1-2.png", "sign/qiandao-1-1.png", "sign/qiandao-1-3.png", "game/qiandao-1-2.png", "sign/jb.png", "icon/skin1.png", "sign/qiandao-1-4.png", "sign/qiandao-1-7.png", "sign/qianwan-di.png", "sign/qiandao-1-5.png", "sign/qiandao-1-8.png", "game/waiquan.png", "game/zhongquan.png", "game/kanshipin-wenzi.png", "sign/qiandao-1-6.png", "game/jiesuan-1-3.png"], "loadList3D": [] };
- Window.SignWindowUI = SignWindowUI;
- REG("ui.Window.SignWindowUI", SignWindowUI);
- class SkinWindowUI extends Laya.Scene {
- constructor() { super(); }
- createChildren() {
- super.createChildren();
- this.createView(SkinWindowUI.uiView);
- }
- }
- SkinWindowUI.uiView = { "type": "Scene", "props": { "width": 720, "height": 1280 }, "compId": 2, "child": [{ "type": "Image", "props": { "x": 0, "width": 720, "top": 0, "skin": "game/pifu-1-13.png", "name": "bg", "bottom": 0, "sizeGrid": "10,10,10,10" }, "compId": 3 }, { "type": "Image", "props": { "y": 138, "x": 478, "width": 233, "var": "moneypan", "skin": "game/zhujiemian-1-5.png", "height": 70, "sizeGrid": "30,30,30,30" }, "compId": 122, "child": [{ "type": "Image", "props": { "y": 8, "x": 20, "skin": "game/zhujiemian-1-4.png" }, "compId": 123 }, { "type": "Text", "props": { "y": 5, "x": 81, "width": 127, "var": "moneyclip", "valign": "middle", "text": "999", "height": 60, "fontSize": 35, "font": "SimHei", "color": "#ffffff", "bold": true, "align": "center", "runtime": "laya.display.Text" }, "compId": 124 }] }, { "type": "Button", "props": { "y": 138, "var": "homebtn", "stateNum": 1, "skin": "game/pifu-1-1.png", "left": 11 }, "compId": 4 }, { "type": "Button", "props": { "y": 328, "x": 557, "var": "cdkbtn", "stateNum": 1, "skin": "game/cdkbtn.png" }, "compId": 132 }, { "type": "Image", "props": { "x": 0, "width": 720, "var": "listpan", "top": 550, "skin": "game/pifu-1-6.png", "height": 730, "bottom": 0, "sizeGrid": "32,11,9,8" }, "compId": 5, "child": [{ "type": "Image", "props": { "x": 35, "width": 650, "top": 50, "skin": "game/pifu-1-7.png", "bottom": 30, "sizeGrid": "25,25,25,25" }, "compId": 94 }, { "type": "Image", "props": { "y": -508, "x": 144, "width": 432, "var": "patbg", "height": 437 }, "compId": 120, "child": [{ "type": "Image", "props": { "y": 336, "x": 216, "width": 325, "var": "pt", "pivotY": 30, "pivotX": 163, "height": 77 }, "compId": 121 }] }, { "type": "Box", "props": { "x": 0, "width": 720, "var": "skinpan", "top": -80, "height": 80 }, "compId": 77, "child": [{ "type": "Box", "props": { "y": 0, "width": 194, "var": "pf", "left": 50, "height": 80 }, "compId": 96, "child": [{ "type": "Image", "props": { "y": 0, "x": 0, "skin": "game/pifu-1-2.png", "name": "openSprite1" }, "compId": 80 }, { "type": "Image", "props": { "x": 0, "visible": false, "skin": "game/pifu-1-3.png", "name": "closeSprite1" }, "compId": 81 }, { "type": "Image", "props": { "y": 17, "x": 50, "skin": "game/pifu-1-4.png" }, "compId": 109 }, { "type": "Button", "props": { "y": 0, "x": 0, "width": 194, "var": "pfbtn", "height": 80 }, "compId": 50 }] }, { "type": "Box", "props": { "y": 0, "x": 263, "width": 194, "var": "wq", "height": 80 }, "compId": 97, "child": [{ "type": "Image", "props": { "y": 0, "x": 0, "skin": "game/pifu-1-2.png", "name": "openSprite1" }, "compId": 98 }, { "type": "Image", "props": { "x": 0, "skin": "game/pifu-1-3.png", "name": "closeSprite1" }, "compId": 99 }, { "type": "Image", "props": { "y": 18, "x": 50, "skin": "game/pifu-1-5.png" }, "compId": 111 }, { "type": "Button", "props": { "y": 0, "x": 0, "width": 194, "var": "wqbtn", "height": 80 }, "compId": 100 }] }, { "type": "Box", "props": { "y": 0, "width": 194, "var": "tw", "right": 50, "height": 80 }, "compId": 127, "child": [{ "type": "Image", "props": { "y": 0, "x": 0, "skin": "game/pifu-1-2.png", "name": "openSprite1" }, "compId": 128 }, { "type": "Image", "props": { "x": 0, "skin": "game/pifu-1-3.png", "name": "closeSprite1" }, "compId": 129 }, { "type": "Image", "props": { "y": 18, "x": 50, "skin": "game/pifu-1-14.png" }, "compId": 130 }, { "type": "Button", "props": { "y": 0, "x": 0, "width": 194, "var": "twbtn", "height": 80 }, "compId": 131 }] }] }, { "type": "List", "props": { "x": 61, "width": 598, "var": "skinlist", "top": 71, "spaceY": 10, "spaceX": 10, "bottom": 44 }, "compId": 6, "child": [{ "type": "Box", "props": { "width": 190, "renderType": "render", "height": 191 }, "compId": 52, "child": [{ "type": "Image", "props": { "y": 0, "x": 0, "width": 190, "skin": "game/pifu-1-12.png", "name": "bg", "height": 191, "sizeGrid": "35,35,35,35" }, "compId": 8 }, { "type": "Image", "props": { "y": 0, "x": 0, "visible": false, "skin": "game/pifu-1-8.png", "name": "selected", "sizeGrid": "35,35,35,35" }, "compId": 119 }, { "type": "Image", "props": { "y": 95, "x": 95, "name": "icon", "anchorY": 0.5, "anchorX": 0.5 }, "compId": 117 }, { "type": "Button", "props": { "y": 0, "x": 0, "width": 190, "name": "showbtn", "height": 191 }, "compId": 22 }, { "type": "Box", "props": { "x": 0, "width": 190, "styleSkin": "game/pifu-1-4.png", "height": 63, "bottom": 5 }, "compId": 23, "child": [{ "type": "Image", "props": { "y": 17, "x": 8.5, "skin": "game/pifu-1-9.png" }, "compId": 118 }, { "type": "Text", "props": { "y": 23, "x": 28, "width": 133, "valign": "middle", "text": "使用中", "strokeColor": "#812c03", "name": "useing", "height": 28, "fontSize": 25, "font": "Microsoft YaHei", "color": "#ffffff", "bold": false, "align": "center", "runtime": "laya.display.Text" }, "compId": 25 }, { "type": "Text", "props": { "y": 23, "x": 28, "width": 133, "valign": "middle", "text": "使用", "strokeColor": "#812c03", "name": "use", "height": 28, "fontSize": 25, "font": "Microsoft YaHei", "color": "#ffffff", "bold": false, "align": "center", "runtime": "laya.display.Text" }, "compId": 26 }, { "type": "Box", "props": { "x": 20, "width": 149, "name": "video", "height": 43, "bottom": 5 }, "compId": 27, "child": [{ "type": "Image", "props": { "y": 4.5, "x": 34.5, "skin": "game/pifu-1-11.png" }, "compId": 28 }, { "type": "Text", "props": { "y": 12, "x": 81, "width": 49, "valign": "middle", "text": "0/2", "strokeColor": "#812c03", "name": "useing", "height": 28, "fontSize": 25, "font": "SimHei", "color": "#ffffff", "bold": false, "align": "left", "runtime": "laya.display.Text" }, "compId": 29 }] }, { "type": "Box", "props": { "x": 20, "width": 149, "name": "money", "height": 43, "bottom": 5 }, "compId": 30, "child": [{ "type": "Image", "props": { "y": 7, "x": 28, "width": 32, "skin": "game/zhujiemian-1-4.png", "height": 34 }, "compId": 31 }, { "type": "Text", "props": { "y": 12, "x": 65, "width": 61, "valign": "middle", "text": "1000", "strokeColor": "#812c03", "name": "useing", "height": 28, "fontSize": 25, "font": "SimHei", "color": "#ffffff", "bold": false, "align": "left", "runtime": "laya.display.Text" }, "compId": 32 }] }, { "type": "Text", "props": { "y": 23, "x": 40, "width": 110, "valign": "middle", "text": "活动获取", "strokeColor": "#812c03", "name": "activeity", "height": 33, "fontSize": 25, "font": "Microsoft YaHei", "color": "#ffffff", "bold": false, "align": "center", "runtime": "laya.display.Text" }, "compId": 33 }, { "type": "Text", "props": { "y": 23, "x": 40, "width": 110, "valign": "middle", "text": "签到获取", "strokeColor": "#812c03", "name": "sign", "height": 33, "fontSize": 25, "font": "Microsoft YaHei", "color": "#ffffff", "bold": false, "align": "center", "runtime": "laya.display.Text" }, "compId": 125 }, { "type": "Text", "props": { "y": 23, "x": 23, "width": 144, "valign": "middle", "text": "通过1关获取", "strokeColor": "#812c03", "name": "stage", "height": 33, "fontSize": 25, "font": "Microsoft YaHei", "color": "#ffffff", "bold": false, "align": "center", "runtime": "laya.display.Text" }, "compId": 126 }] }, { "type": "Button", "props": { "x": 0, "width": 190, "stateNum": 1, "name": "getbtn", "height": 63, "bottom": 5 }, "compId": 34 }] }] }] }], "loadList": ["game/pifu-1-13.png", "game/zhujiemian-1-5.png", "game/zhujiemian-1-4.png", "game/pifu-1-1.png", "game/cdkbtn.png", "game/pifu-1-6.png", "game/pifu-1-7.png", "game/pifu-1-2.png", "game/pifu-1-3.png", "game/pifu-1-4.png", "game/pifu-1-5.png", "game/pifu-1-14.png", "game/pifu-1-12.png", "game/pifu-1-8.png", "game/pifu-1-9.png", "game/pifu-1-11.png"], "loadList3D": [] };
- Window.SkinWindowUI = SkinWindowUI;
- REG("ui.Window.SkinWindowUI", SkinWindowUI);
- class TaoZhuangWindowUI extends Laya.Scene {
- constructor() { super(); }
- createChildren() {
- super.createChildren();
- this.createView(TaoZhuangWindowUI.uiView);
- }
- }
- TaoZhuangWindowUI.uiView = { "type": "Scene", "props": { "width": 720, "height": 1280 }, "compId": 2, "child": [{ "type": "Image", "props": { "x": 0, "width": 720, "top": 0, "skin": "bg/dise-2.png", "name": "bg", "bottom": 0 }, "compId": 4 }, { "type": "Box", "props": { "y": 514, "x": 360, "width": 720, "var": "pan", "height": 720, "anchorY": 0.5, "anchorX": 0.5 }, "compId": 3, "child": [{ "type": "Button", "props": { "y": -56, "x": 41, "var": "backbtn", "stateNum": 1, "skin": "game/fanhui.png" }, "compId": 5 }, { "type": "Image", "props": { "y": 117, "x": 4, "skin": "bg/dise.png" }, "compId": 6, "child": [{ "type": "Image", "props": { "y": 314, "x": 14, "skin": "bg/wenzilo.png" }, "compId": 7, "child": [{ "type": "Image", "props": { "y": -218, "x": 139, "width": 404, "skin": "bg/gagag.png", "height": 299 }, "compId": 17 }] }, { "type": "Image", "props": { "y": 514, "x": 7, "skin": "bg/disilv.png" }, "compId": 8, "child": [{ "type": "Image", "props": { "y": 19.5, "x": 202.5, "skin": "game/wenzi-1 (2).png" }, "compId": 9 }, { "type": "Image", "props": { "y": 63, "x": 238, "var": "pre1", "skin": "game/lanyuan.png" }, "compId": 11, "child": [{ "type": "Image", "props": { "skin": "game/youyuan.png" }, "compId": 14 }] }, { "type": "Image", "props": { "y": 63, "x": 315.5, "var": "pre2", "skin": "game/lanyuan.png" }, "compId": 10, "child": [{ "type": "Image", "props": { "skin": "game/youyuan.png" }, "compId": 13 }] }, { "type": "Image", "props": { "y": 63, "x": 396, "var": "pre3", "skin": "game/lanyuan.png" }, "compId": 12, "child": [{ "type": "Image", "props": { "skin": "game/youyuan.png" }, "compId": 15 }] }] }, { "type": "Button", "props": { "y": 645, "x": 205, "var": "getbtn", "stateNum": 1, "skin": "game/at-anni.png" }, "compId": 16 }] }] }], "animations": [{ "nodes": [{ "target": 3, "keyframes": { "scaleY": [{ "value": 0.6, "tweenMethod": "linearNone", "tween": true, "target": 3, "key": "scaleY", "index": 0 }, { "value": 1, "tweenMethod": "linearNone", "tween": true, "target": 3, "key": "scaleY", "index": 10 }], "scaleX": [{ "value": 0.6, "tweenMethod": "linearNone", "tween": true, "target": 3, "key": "scaleX", "index": 0 }, { "value": 1, "tweenMethod": "linearNone", "tween": true, "target": 3, "key": "scaleX", "index": 10 }] } }], "name": "ani1", "id": 1, "frameRate": 24, "action": 1 }], "loadList": ["bg/dise-2.png", "game/fanhui.png", "bg/dise.png", "bg/wenzilo.png", "bg/gagag.png", "bg/disilv.png", "game/wenzi-1 (2).png", "game/lanyuan.png", "game/youyuan.png", "game/at-anni.png"], "loadList3D": [] };
- Window.TaoZhuangWindowUI = TaoZhuangWindowUI;
- REG("ui.Window.TaoZhuangWindowUI", TaoZhuangWindowUI);
- class TaskContentViewUI extends Laya.Scene {
- constructor() { super(); }
- createChildren() {
- super.createChildren();
- this.createView(TaskContentViewUI.uiView);
- }
- }
- TaskContentViewUI.uiView = { "type": "Scene", "props": { "width": 720, "height": 1280 }, "compId": 2, "child": [{ "type": "Image", "props": { "y": 0, "x": 0, "width": 720, "top": 0, "skin": "game/taskcc5.png", "name": "bg", "bottom": 0, "sizeGrid": "10,10,10,10" }, "compId": 4, "child": [{ "type": "Image", "props": { "y": 57, "x": -150.5, "width": 149, "skin": "bg/taskcc4.png", "rotation": -32, "height": 702, "alpha": 0.5 }, "compId": 21 }, { "type": "Image", "props": { "y": -42, "x": 574, "skin": "bg/taskcc4.png", "rotation": 28, "alpha": 0.5 }, "compId": 13 }, { "type": "Image", "props": { "y": 0, "x": 232, "skin": "bg/taskcc4.png", "alpha": 0.5 }, "compId": 12 }, { "type": "Image", "props": { "y": 295, "x": -136, "skin": "bg/taskcc4.png", "rotation": -42, "alpha": 0.5 }, "compId": 14 }, { "type": "Image", "props": { "y": 1108, "x": -108, "skin": "bg/taskcc4.png", "rotation": -126, "alpha": 0.5 }, "compId": 15 }, { "type": "Image", "props": { "y": 1297, "x": 122, "skin": "bg/taskcc4.png", "rotation": -148, "alpha": 0.5 }, "compId": 16 }, { "type": "Image", "props": { "y": 1353, "x": 473, "skin": "bg/taskcc4.png", "rotation": -178, "alpha": 0.5 }, "compId": 17 }, { "type": "Image", "props": { "y": 1242, "x": 790, "skin": "bg/taskcc4.png", "rotation": -206, "alpha": 0.5 }, "compId": 18 }, { "type": "Image", "props": { "y": 1042, "x": 920, "skin": "bg/taskcc4.png", "rotation": -224, "alpha": 0.5 }, "compId": 19 }, { "type": "Image", "props": { "y": 179, "x": 720, "skin": "bg/taskcc4.png", "rotation": 38, "alpha": 0.5 }, "compId": 20 }, { "type": "Image", "props": { "x": 0, "width": 720, "top": 0, "skin": "bg/taskcc3.png", "bottom": 0 }, "compId": 11 }] }, { "type": "Box", "props": { "y": 640, "x": 360, "width": 720, "var": "mespan", "height": 440, "anchorY": 0.5, "anchorX": 0.5 }, "compId": 5, "child": [{ "type": "Image", "props": { "y": -177, "x": 158, "visible": false, "var": "tips", "skin": "bg/taskcc2.png" }, "compId": 24 }, { "type": "Image", "props": { "x": 111, "top": 0, "skin": "bg/taskmes2.png" }, "compId": 6, "child": [{ "type": "Text", "props": { "y": 38, "x": 167, "width": 176, "var": "title", "valign": "middle", "text": "愈挫愈勇", "height": 38, "fontSize": 25, "color": "#ffffff", "bold": true, "align": "center", "runtime": "laya.display.Text" }, "compId": 9 }, { "type": "Text", "props": { "y": 98.5, "x": 101.5, "wordWrap": true, "width": 296, "var": "content", "valign": "middle", "text": "在一关失败达到5次", "height": 67, "fontSize": 23, "color": "#5e3513", "bold": true, "align": "center", "runtime": "laya.display.Text" }, "compId": 10 }, { "type": "Text", "props": { "y": 144, "x": 101.5, "wordWrap": true, "width": 296, "var": "cdktex", "valign": "middle", "text": "兑换码:123456", "height": 67, "fontSize": 23, "color": "#5e3513", "bold": true, "align": "center", "runtime": "laya.display.Text" }, "compId": 22 }, { "type": "Button", "props": { "y": 85, "x": 404, "var": "closemesview", "stateNum": 1, "skin": "game/cd4.png" }, "compId": 7 }] }, { "type": "Button", "props": { "x": 247.5, "visible": false, "var": "sharebtn", "stateNum": 1, "skin": "game/taskmes1.png", "bottom": 0 }, "compId": 8 }] }], "animations": [{ "nodes": [{ "target": 5, "keyframes": { "scaleY": [{ "value": 0.6, "tweenMethod": "linearNone", "tween": true, "target": 5, "key": "scaleY", "index": 0 }, { "value": 1, "tweenMethod": "linearNone", "tween": true, "target": 5, "key": "scaleY", "index": 10 }], "scaleX": [{ "value": 0.6, "tweenMethod": "linearNone", "tween": true, "target": 5, "key": "scaleX", "index": 0 }, { "value": 1, "tweenMethod": "linearNone", "tween": true, "target": 5, "key": "scaleX", "index": 10 }] } }], "name": "ani1", "id": 1, "frameRate": 24, "action": 0 }], "loadList": ["game/taskcc5.png", "bg/taskcc4.png", "bg/taskcc3.png", "bg/taskcc2.png", "bg/taskmes2.png", "game/cd4.png", "game/taskmes1.png"], "loadList3D": [] };
- Window.TaskContentViewUI = TaskContentViewUI;
- REG("ui.Window.TaskContentViewUI", TaskContentViewUI);
- class TaskWindowUI extends Laya.Scene {
- constructor() { super(); }
- createChildren() {
- super.createChildren();
- this.createView(TaskWindowUI.uiView);
- }
- }
- TaskWindowUI.uiView = { "type": "Scene", "props": { "width": 720, "height": 1280 }, "compId": 2, "child": [{ "type": "Image", "props": { "y": 0, "x": 0, "width": 720, "top": 0, "skin": "game/task2.png", "name": "bg", "bottom": 0, "sizeGrid": "10,10,10,10" }, "compId": 3 }, { "type": "Button", "props": { "y": 138, "x": 0, "var": "homebtn", "stateNum": 1, "skin": "game/pifu-1-1.png", "left": 11 }, "compId": 5 }, { "type": "Image", "props": { "x": 0, "width": 720, "var": "listpan", "top": 466, "skin": "game/pifu-1-6.png", "bottom": 0, "sizeGrid": "32,11,9,8" }, "compId": 6, "child": [{ "type": "Image", "props": { "x": 0, "width": 720, "top": 62, "skin": "game/task4.png", "bottom": 0, "sizeGrid": "10,10,10,10" }, "compId": 9 }, { "type": "Image", "props": { "skin": "bg/task3.png" }, "compId": 48 }, { "type": "List", "props": { "x": 39, "width": 642, "var": "cdlist", "top": 73, "spaceY": 10, "spaceX": 10, "height": 668, "bottom": 73 }, "compId": 49, "child": [{ "type": "Box", "props": { "y": 0, "x": 0, "width": 207, "renderType": "render", "height": 215 }, "compId": 50, "child": [{ "type": "Image", "props": { "skin": "bg/task5.png" }, "compId": 69, "child": [{ "type": "Image", "props": { "y": 42, "x": 58, "skin": "bg/egg.png", "name": "egg" }, "compId": 81 }, { "type": "Text", "props": { "y": 77, "x": 5, "width": 197, "visible": false, "valign": "middle", "text": "兑换码:1234563", "height": 53, "fontSize": 25, "color": "#ffffff", "align": "center", "runtime": "laya.display.Text" }, "compId": 74 }, { "type": "Button", "props": { "y": 162, "x": 32, "stateNum": 1, "skin": "game/2.png", "name": "videogetbtn" }, "compId": 70 }, { "type": "Button", "props": { "y": 162, "x": 32, "stateNum": 1, "skin": "game/1(2).png", "name": "readbtn" }, "compId": 72 }] }, { "type": "Image", "props": { "y": 17, "x": 13, "skin": "game/cd1.png" }, "compId": 71 }, { "type": "Image", "props": { "y": 75, "x": 77, "skin": "game/gasgahah.png" }, "compId": 82 }] }] }] }], "animations": [{ "nodes": [{ "target": 78, "keyframes": { "scaleY": [{ "value": 0.6, "tweenMethod": "linearNone", "tween": true, "target": 78, "key": "scaleY", "index": 0 }, { "value": 1, "tweenMethod": "linearNone", "tween": true, "target": 78, "key": "scaleY", "index": 10 }], "scaleX": [{ "value": 0.6, "tweenMethod": "linearNone", "tween": true, "target": 78, "key": "scaleX", "index": 0 }, { "value": 1, "tweenMethod": "linearNone", "tween": true, "target": 78, "key": "scaleX", "index": 10 }] } }], "name": "ani1", "id": 1, "frameRate": 24, "action": 0 }], "loadList": ["game/task2.png", "game/pifu-1-1.png", "game/pifu-1-6.png", "game/task4.png", "bg/task3.png", "bg/task5.png", "bg/egg.png", "game/2.png", "game/1(2).png", "game/cd1.png", "game/gasgahah.png"], "loadList3D": [] };
- Window.TaskWindowUI = TaskWindowUI;
- REG("ui.Window.TaskWindowUI", TaskWindowUI);
- class TryoutWindowUI extends Laya.Scene {
- constructor() { super(); }
- createChildren() {
- super.createChildren();
- this.createView(TryoutWindowUI.uiView);
- }
- }
- TryoutWindowUI.uiView = { "type": "Scene", "props": { "width": 720, "height": 1280 }, "compId": 2, "child": [{ "type": "Image", "props": { "width": 720, "top": 0, "skin": "game/zhezhao.png", "name": "bg", "bottom": 0, "sizeGrid": "10,10,10,10" }, "compId": 3 }, { "type": "Box", "props": { "y": 146, "x": 0, "width": 720, "var": "pan", "height": 796 }, "compId": 5, "child": [{ "type": "Image", "props": { "x": 268, "top": 0, "skin": "game/wuqilo.png" }, "compId": 26 }, { "type": "Box", "props": { "y": 80, "x": 0, "width": 720, "var": "upskinpan", "height": 374 }, "compId": 27, "child": [{ "type": "Image", "props": { "skin": "game/zi-z.png", "left": 50 }, "compId": 28, "child": [{ "type": "Image", "props": { "y": 206, "x": 15, "skin": "game/shipin.png" }, "compId": 34 }, { "type": "Button", "props": { "y": 288, "x": 5, "var": "tribtn10", "stateNum": 1, "skin": "game/shiyong.png" }, "compId": 29 }, { "type": "Text", "props": { "y": 15, "x": 38.5, "width": 116, "valign": "middle", "text": "武器名字", "name": "name", "height": 34, "fontSize": 26, "color": "#ffffff", "bold": true, "align": "center", "runtime": "laya.display.Text" }, "compId": 42 }, { "type": "Image", "props": { "y": 131, "x": 96, "width": 99, "skin": "icon/wuqi12.png", "name": "icon", "height": 199, "anchorY": 0.5, "anchorX": 0.5 }, "compId": 45 }] }, { "type": "Image", "props": { "y": 0, "x": 263, "skin": "game/zi-z.png" }, "compId": 30, "child": [{ "type": "Image", "props": { "y": 206, "x": 15, "skin": "game/shipin.png" }, "compId": 35 }, { "type": "Button", "props": { "y": 288, "x": 5, "var": "tribtn11", "stateNum": 1, "skin": "game/shiyong.png" }, "compId": 31 }, { "type": "Text", "props": { "y": 15, "x": 38, "width": 116, "valign": "middle", "text": "武器名字", "name": "name", "height": 34, "fontSize": 26, "color": "#ffffff", "bold": true, "align": "center", "runtime": "laya.display.Text" }, "compId": 43 }, { "type": "Image", "props": { "y": 131, "x": 96, "width": 99, "skin": "icon/wuqi12.png", "name": "icon", "height": 199, "anchorY": 0.5, "anchorX": 0.5 }, "compId": 46 }] }, { "type": "Image", "props": { "y": 0, "skin": "game/zi-z.png", "right": 50 }, "compId": 32, "child": [{ "type": "Image", "props": { "y": 206, "x": 15, "skin": "game/shipin.png" }, "compId": 36 }, { "type": "Button", "props": { "y": 288, "x": 5, "var": "tribtn12", "stateNum": 1, "skin": "game/shiyong.png" }, "compId": 33 }, { "type": "Text", "props": { "y": 15, "x": 38, "width": 116, "valign": "middle", "text": "武器名字", "name": "name", "height": 34, "fontSize": 26, "color": "#ffffff", "bold": true, "align": "center", "runtime": "laya.display.Text" }, "compId": 44 }, { "type": "Image", "props": { "y": 131, "x": 96, "width": 99, "skin": "icon/wuqi12.png", "name": "icon", "height": 199, "anchorY": 0.5, "anchorX": 0.5 }, "compId": 47 }] }] }, { "type": "Image", "props": { "x": 0, "width": 720, "var": "downskinpan", "skin": "bg/hdi.png", "bottom": 0 }, "compId": 37, "child": [{ "type": "Image", "props": { "y": 3, "x": 16, "stateNum": 1, "skin": "game/wuqihdi.png" }, "compId": 38, "child": [{ "type": "Text", "props": { "y": 15, "x": 38, "width": 116, "valign": "middle", "text": "武器名字", "name": "name", "height": 34, "fontSize": 26, "color": "#ffffff", "bold": true, "align": "center", "runtime": "laya.display.Text" }, "compId": 48 }, { "type": "Image", "props": { "y": 131, "x": 96, "width": 99, "skin": "icon/wuqi12.png", "name": "icon", "height": 199, "anchorY": 0.5, "anchorX": 0.5 }, "compId": 49 }] }, { "type": "Image", "props": { "y": 62, "x": 254, "skin": "game/wenzi-6.png" }, "compId": 39, "child": [{ "type": "Image", "props": { "y": 70, "x": 0, "skin": "game/wenzi-1.png" }, "compId": 40 }] }, { "type": "Button", "props": { "y": 158, "x": 422, "var": "tribtn2", "stateNum": 1, "skin": "game/anniu-.png" }, "compId": 41 }] }] }, { "type": "Box", "props": { "y": 955, "x": 0, "width": 720, "var": "Btn", "height": 45 }, "compId": 12, "child": [{ "type": "Button", "props": { "y": 143, "x": 289, "var": "passbtn", "stateNum": 1, "skin": "game/tuichu.png", "bottom": 0 }, "compId": 16 }] }], "loadList": ["game/zhezhao.png", "game/wuqilo.png", "game/zi-z.png", "game/shipin.png", "game/shiyong.png", "icon/wuqi12.png", "bg/hdi.png", "game/wuqihdi.png", "game/wenzi-6.png", "game/wenzi-1.png", "game/anniu-.png", "game/tuichu.png"], "loadList3D": [] };
- Window.TryoutWindowUI = TryoutWindowUI;
- REG("ui.Window.TryoutWindowUI", TryoutWindowUI);
- })(Window = ui.Window || (ui.Window = {}));
- })(ui || (ui = {}));
- class ADHelper {
- static initAd() {
- if (!Laya.Browser.window.conch)
- return;
- ADHelper.Conch = Laya.Browser.window.conch;
- ADHelper.PlatformClass = Laya.Browser.window.PlatformClass;
- ADHelper.IsAndroid = ADHelper.Conch.config.getOS() == "Conch-android";
- if (ADHelper.IsAndroid) {
- ADHelper.JavaClassAdHelper = ADHelper.PlatformClass.createClass("ad.AdHelper");
- ADHelper.JavaClassAdHelper.callWithBack((isOk) => {
- console.log(">>>>>>>>>>>>>>>>Ad");
- console.log(isOk);
- ADHelper.IsReady = true;
- console.log("[LOG]Java_initAd ok");
- }, "initAd");
- }
- }
- static showVideoAd(callback) {
- if (ADHelper.IsAndroid) {
- console.log(">>>>>>>>>>>>>>>>Ad");
- console.log(ADHelper.JavaClassAdHelper);
- ADHelper.JavaClassAdHelper.callWithBack(isOk => {
- console.log(">>>>>>>>>>>>>");
- console.log(isOk);
- console.log("[LOG]Java_shwoVideoAd callback enter", isOk);
- callback && callback(isOk);
- }, "showVideoAd");
- }
- else {
- callback && callback(true);
- }
- }
- static showBanner() {
- if (ADHelper.IsAndroid) {
- ADHelper.IsBannerVisible = true;
- ADHelper.JavaClassAdHelper.callWithBack(() => {
- if (!ADHelper.IsBannerVisible) {
- ADHelper.hideBanner();
- }
- }, "showBanner");
- }
- }
- static hideBanner() {
- if (ADHelper.IsAndroid) {
- ADHelper.IsBannerVisible = false;
- ADHelper.JavaClassAdHelper.call("hideBanner");
- }
- }
- }
- ADHelper.IsReady = false;
- ADHelper.IsBannerVisible = false;
- var Vector2 = Laya.Vector2;
- var attacktype;
- (function (attacktype) {
- attacktype[attacktype["one"] = 0] = "one";
- attacktype[attacktype["two"] = 1] = "two";
- attacktype[attacktype["three"] = 2] = "three";
- })(attacktype || (attacktype = {}));
- class InGameWindow extends ui.Window.InGameWindowUI {
- constructor() {
- super();
- this.skindatas = [];
- this.enter = false;
- this.path = [];
- this.points = [];
- InGameWindow.instance = this;
- }
- static get Instance() {
- return InGameWindow.instance;
- }
- InitSize() {
- this.height = Laya.stage.height;
- Laya.stage.on(Laya.Event.RESIZE, this, () => { this.height = Laya.stage.height; });
- this.drawbany = Laya.stage.height - InGameWindow.Instance.drawpan.height + InGameWindow.Instance.drawban.y;
- }
- OnOpen(_win = false) {
- this.skindatas = this.GetSkinDatas(skintype.weapon);
- this.InitSize();
- this.RegButton();
- TtSdk.RecordEvent("enterGame");
- }
- RegButton() {
- this.onebtn.clickHandler = Laya.Handler.create(this, this.OnClickOne, null, false);
- this.twobtn.clickHandler = Laya.Handler.create(this, this.OnClickTwo, null, false);
- this.threebtn.clickHandler = Laya.Handler.create(this, this.OnClickThree, null, false);
- EventManager.InputOn(TouchState.down, this, this.OnDown);
- EventManager.InputOn(TouchState.up, this, this.OnUp);
- EventManager.InputOn(TouchState.slidermove, this, this.OnSlider);
- this.OnClickOne();
- }
- OnClickOne() {
- if (this.curattacktype == attacktype.one)
- return;
- this.skinlist.visible = true;
- this.SetBtnShow(attacktype.one);
- this.ShowWeaponList();
- if (this.drawbg) {
- this.drawbg.removeSelf();
- this.drawbg.destroy();
- this.drawbg = null;
- }
- this.drawtip.visible = false;
- Player.mainpalyer.ShowWeapon(true);
- }
- OnClickTwo() {
- if (this.curattacktype == attacktype.two)
- return;
- this.skinlist.visible = false;
- this.SetBtnShow(attacktype.two);
- if (this.drawbg) {
- this.drawbg.removeSelf();
- this.drawbg.destroy();
- this.drawbg = null;
- }
- this.drawtip.visible = true;
- }
- OnClickThree() {
- if (this.curattacktype == attacktype.three)
- return;
- this.skinlist.visible = false;
- this.SetBtnShow(attacktype.three);
- if (this.drawbg) {
- this.drawbg.removeSelf();
- this.drawbg.destroy();
- this.drawbg = null;
- }
- this.drawtip.visible = true;
- }
- ShowWeaponList() {
- this.skinlist.vScrollBarSkin = "";
- this.skinlist.array = this.skindatas;
- this.skinlist.renderHandler = Laya.Handler.create(this, this.OnRender, null, false);
- }
- OnRender(_cell) {
- var data = _cell.dataSource;
- var selected = _cell.getChildAt(1);
- selected.visible = false;
- var icon = _cell.getChildAt(2);
- var state = _cell.getChildAt(3);
- var geted = _cell.getChildAt(4);
- icon.skin = "icon/" + data.skinicon + ".png";
- this.SetGetBtn(state, data);
- if (data.curskinstate == skinstate.getnoues) {
- geted.clickHandler = Laya.Handler.create(this, this.OnUseSkin, [data], false);
- }
- else if (data.curskinstate == skinstate.lock) {
- geted.clickHandler = Laya.Handler.create(this, this.OnVideoGet, [data], false);
- }
- else if (data.curskinstate == skinstate.useing) {
- selected.visible = true;
- }
- }
- OnHide() {
- if (this.drawbg) {
- this.drawbg.removeSelf();
- this.drawbg.destroy();
- this.drawbg = null;
- }
- EventManager.InputOff(TouchState.down, this, this.OnDown);
- EventManager.InputOff(TouchState.up, this, this.OnUp);
- EventManager.InputOff(TouchState.slidermove, this, this.OnSlider);
- }
- OnUseSkin(_data) {
- if (this.wearskin == _data)
- return;
- this.WearSkin(_data);
- }
- OnVideoGet(_data) {
- if (Laya.Browser.onPC) {
- this.OnUseSkin(_data);
- }
- else {
- ADHelper.showVideoAd((flag) => {
- if (flag) {
- this.OnUseSkin(_data);
- }
- });
- }
- }
- WearSkin(_skin) {
- console.log("wear:", _skin.skinid);
- _skin.curskinstate = skinstate.useing;
- EventManager.Trigger(EventType.UseSkin, [_skin]);
- for (var i = 0; i < this.skindatas.length; i++) {
- var mskin = this.skindatas[i];
- if (mskin != _skin && mskin.curskinstate == skinstate.useing) {
- mskin.curskinstate = skinstate.getnoues;
- }
- }
- this.ShowWeaponList();
- }
- SetGetBtn(_btn, _data) {
- var getuseing = _btn.getChildAt(1);
- getuseing.visible = _data.curskinstate == skinstate.useing;
- var getuse = _btn.getChildAt(2);
- getuse.visible = _data.curskinstate == skinstate.getnoues;
- var getvideo = _btn.getChildAt(3);
- getvideo.visible = false;
- if (_data.curskinstate == skinstate.lock) {
- getvideo.visible = true;
- }
- }
- SetBtnShow(_skintype) {
- this.curattacktype = _skintype;
- for (var i = 0; i < this.attackbox.numChildren; i++) {
- var skin = this.attackbox.getChildAt(i);
- var openskin = skin.getChildAt(0);
- if (i == _skintype) {
- openskin.visible = true;
- }
- else {
- openskin.visible = false;
- }
- }
- }
- GetSkinDatas(_skintype) {
- var skins = PlayerAccount.CurAccountData.m_skinDic.values;
- var gets = [];
- var locks = [];
- for (var i = 0; i < skins.length; i++) {
- var curskin = skins[i];
- if (curskin.skintype != _skintype)
- continue;
- if (curskin.curskinstate != skinstate.lock) {
- gets.push(curskin);
- }
- else {
- locks.push(curskin);
- }
- }
- return gets.concat(locks);
- }
- OnDown() {
- if (this.curattacktype == attacktype.one)
- return;
- this.startpoint = new Vector2(this.drawban.mouseX, this.drawban.mouseY);
- if (this.drawban.mouseY < 50) {
- return;
- }
- if (this.drawban.mouseY > this.drawban.height) {
- return;
- }
- if (this.drawban.mouseX < 0) {
- return;
- }
- if (this.drawban.mouseX > this.drawban.width) {
- return;
- }
- this.enter = true;
- if (this.drawbg) {
- this.drawbg.removeSelf();
- this.drawbg.destroy();
- this.drawbg = null;
- }
- this.drawbg = new Laya.Sprite();
- this.drawbg.width = this.drawban.width;
- this.drawbg.height = this.drawban.height;
- this.drawbg.pos(this.drawban.x, this.drawban.y);
- this.drawpan.addChild(this.drawbg);
- this.points = [];
- this.path = [];
- }
- OnUp() {
- if (this.curattacktype == attacktype.one)
- return;
- if (this.drawbg) {
- this.drawbg.graphics.clear();
- this.drawbg.removeSelf();
- this.drawbg.destroy();
- this.drawbg = null;
- }
- if (this.drawban.mouseY < 50) {
- return;
- }
- if (this.drawban.mouseY > this.drawban.height) {
- return;
- }
- if (this.drawban.mouseX < 0) {
- return;
- }
- if (this.drawban.mouseX > this.drawban.width) {
- return;
- }
- this.enter = false;
- if (this.path.length > 4) {
- if (this.curattacktype == attacktype.two) {
- EventManager.Trigger(EventType.DrawEnd, [this.path, true]);
- }
- else {
- EventManager.Trigger(EventType.DrawEnd, [this.path, false]);
- }
- }
- }
- static get caninput() {
- if (InGameWindow.Instance.drawban.mouseY > 50) {
- return false;
- }
- else {
- return true;
- }
- }
- OnSlider() {
- if (!this.enter)
- return;
- if (this.curattacktype == attacktype.one)
- return;
- this.curscreenpos = new Vector2(this.drawban.mouseX, this.drawban.mouseY);
- if (this.startpoint == null) {
- this.startpoint = this.curscreenpos.clone();
- }
- if (this.varpoint == null) {
- this.varpoint = this.curscreenpos.clone();
- }
- if (this.drawban.mouseY < 50) {
- this.curscreenpos = new Vector2(this.curscreenpos.x, 50);
- }
- if (this.drawban.mouseY > this.drawban.height) {
- this.curscreenpos = new Vector2(this.curscreenpos.x, this.drawban.height);
- }
- if (this.drawban.mouseX < 0) {
- this.curscreenpos = new Vector2(0, this.curscreenpos.y);
- }
- if (this.drawban.mouseX > this.drawban.width) {
- this.curscreenpos = new Vector2(this.drawban.width, this.curscreenpos.y);
- }
- var curoffestx = this.curscreenpos.x - this.startpoint.x;
- var curoffesty = this.curscreenpos.y - this.startpoint.y;
- var dis = GameUtils.Vector2Length(this.varpoint, this.curscreenpos);
- if (dis > 5) {
- if (this.curattacktype == attacktype.two) {
- this.path.push(new Laya.Vector3(curoffesty, Math.abs(curoffestx), 0));
- }
- else {
- this.path.push(new Laya.Vector3(Math.abs(curoffestx), 0, curoffesty));
- }
- this.varpoint = this.curscreenpos;
- }
- this.points.push(curoffestx);
- this.points.push(curoffesty);
- if (this.drawbg) {
- this.drawbg.graphics.clear();
- this.curline = this.drawbg.graphics.drawLines(this.startpoint.x, this.startpoint.y, this.points, "#211f1e", 10);
- }
- }
- }
- var Vector3$3 = Laya.Vector3;
- class CameraManager extends Laya.Script3D {
- constructor() {
- super();
- this.follow = false;
- this.offest = new Vector3$3();
- this.followrate = 0.25;
- this.curcamerapos = new Vector3$3();
- this.curstarpos = new Vector3$3();
- CameraManager.instance = this;
- }
- static get Instance() {
- return CameraManager.instance;
- }
- SetFollow(_target) {
- if (!this.m_cameranode) {
- this.m_cameranode = SceneManager.maincamera;
- }
- this.follow = true;
- this.FollowTarget = _target;
- Vector3$3.subtract(_target.transform.position, this.m_cameranode.transform.position, this.offest);
- }
- SetOffest(_targetpos, _target) {
- this.FollowTarget = _target;
- Vector3$3.subtract(_target.transform.position, _targetpos, this.offest);
- }
- ResetTarget(_target) {
- this.FollowTarget = _target;
- this.follow = true;
- }
- StopFollow() {
- this.follow = false;
- this.FollowTarget = null;
- }
- onUpdate() {
- if (this.follow && this.FollowTarget) {
- Vector3$3.subtract(this.FollowTarget.transform.position, this.offest, this.curcamerapos);
- var curposz = this.curcamerapos.z;
- Vector3$3.lerp(SceneManager.maincamera.transform.position, this.curcamerapos, this.followrate, this.curcamerapos);
- this.curcamerapos = new Vector3$3(this.curcamerapos.x, this.curcamerapos.y, curposz);
- SceneManager.maincamera.transform.position = new Vector3$3(this.curcamerapos.x, this.curcamerapos.y, this.curcamerapos.z);
- }
- }
- }
- class WeaponTrigger extends Laya.Script3D {
- onAwake() {
- this.mainplayer = Player.mainpalyer;
- }
- onTriggerEnter(other) {
- if (this.mainplayer.currolestate != RoleState.Runing)
- return;
- if (this.cantrigger(other)) {
- EventManager.Trigger(EventType.Cut, [other]);
- }
- }
- cantrigger(_collider) {
- if (GameManager.Instance.curgamestate != GameState.Playing)
- return;
- if (_collider.collisionGroup == ColliderLay.monster) {
- return true;
- }
- else if (_collider.collisionGroup == ColliderLay.bullet) {
- return true;
- }
- else if (_collider.collisionGroup == ColliderLay.obstacle || _collider.collisionGroup == ColliderLay.grass) {
- return true;
- }
- }
- }
- var Vector3$4 = Laya.Vector3;
- class InputManager {
- constructor() {
- this.curtouthstate = TouchState.none;
- this.touchPos = new Vector3$4();
- this.curMousePos = new Vector3$4(0, 0, 0);
- this.sliderawakesize = 5;
- this.curdir = new Vector3$4();
- this.curtouchpos = new Vector3$4();
- InputManager.instance = this;
- this.Init();
- }
- static get Instance() {
- return InputManager.instance;
- }
- Init() {
- Laya.stage.on(Laya.Event.MOUSE_DOWN, this, this.TouchEnter);
- Laya.stage.on(Laya.Event.MOUSE_UP, this, this.OnTouchOut);
- Laya.stage.on(Laya.Event.MOUSE_OUT, this, this.OnTouchOut);
- Laya.stage.on(Laya.Event.MOUSE_MOVE, this, this.OnSliderMove);
- EventManager.GameOn(GameState.Ready, this, this.OnGameReady);
- EventManager.GameOn(GameState.Playing, this, this.OnGamePlaying);
- EventManager.GameOn(GameState.Resurrection, this, this.OnGameResurrection);
- EventManager.GameOn(GameState.Lose, this, this.OnGameLose);
- EventManager.GameOn(GameState.Win, this, this.OnGameWin);
- }
- OnGameReady() {
- Laya.timer.clear(this, this.OnTouchMove);
- this.curtouthstate = TouchState.down;
- InputManager.caninput = true;
- }
- OnGamePlaying() {
- InputManager.caninput = true;
- }
- OnGameResurrection() {
- Laya.timer.clear(this, this.OnTouchMove);
- this.curtouthstate = TouchState.down;
- InputManager.caninput = false;
- }
- OnGameLose() {
- Laya.timer.clear(this, this.OnTouchMove);
- this.curtouthstate = TouchState.down;
- InputManager.caninput = false;
- }
- OnGameWin() {
- Laya.timer.clear(this, this.OnTouchMove);
- this.curtouthstate = TouchState.down;
- InputManager.caninput = false;
- }
- TouchEnter(e) {
- this.curtouthstate = TouchState.down;
- EventManager.Trigger(EventType.InputState, [this.curtouthstate]);
- if (!InputManager.caninput)
- return;
- this.curtouchpos = new Laya.Vector3(Laya.MouseManager.instance.mouseX, Laya.MouseManager.instance.mouseY, 0);
- Laya.timer.clear(this, this.OnTouchMove);
- EventManager.InputTrigger(TouchState.down, [this.curMousePos]);
- Laya.timer.frameLoop(1, this, this.OnTouchMove);
- }
- OnTouchOut() {
- this.curtouthstate = TouchState.up;
- EventManager.Trigger(EventType.InputState, [this.curtouthstate]);
- if (!InputManager.caninput)
- return;
- Laya.timer.clear(this, this.OnTouchMove);
- EventManager.InputTrigger(TouchState.up);
- }
- OnTouchMove() {
- this.curtouthstate = TouchState.slider;
- EventManager.Trigger(EventType.InputState, [this.curtouthstate]);
- if (!InputManager.caninput)
- return;
- this.curMousePos = new Laya.Vector3(Laya.MouseManager.instance.mouseX, Laya.MouseManager.instance.mouseY, 0);
- var distance = Vector3$4.distance(this.curtouchpos, this.curMousePos);
- if (distance > this.sliderawakesize) {
- Vector3$4.subtract(this.curtouchpos, this.curMousePos, this.curdir);
- Vector3$4.normalize(this.curdir, this.curdir);
- EventManager.InputTrigger(TouchState.slider, [new Vector3$4(this.curdir.x, 0, this.curdir.y)]);
- }
- }
- OnSliderMove() {
- if (!InputManager.caninput)
- return;
- EventManager.InputTrigger(TouchState.slidermove);
- }
- }
- InputManager.caninput = false;
- var VoiceType;
- (function (VoiceType) {
- VoiceType[VoiceType["boom"] = 0] = "boom";
- VoiceType[VoiceType["cut"] = 1] = "cut";
- VoiceType[VoiceType["cutgrass"] = 2] = "cutgrass";
- VoiceType[VoiceType["lose"] = 3] = "lose";
- VoiceType[VoiceType["win"] = 4] = "win";
- })(VoiceType || (VoiceType = {}));
- var BgmType;
- (function (BgmType) {
- BgmType[BgmType["bgm"] = 0] = "bgm";
- })(BgmType || (BgmType = {}));
- class AudioControl {
- static voiceres(_type) {
- return "subpackage/res/sound/" + VoiceType[_type] + ".wav";
- }
- static PlayVoice(_type, _loop = false) {
- if (!this.play)
- return;
- var loop = _loop ? 0 : 1;
- Laya.SoundManager.playSound(this.voiceres(_type), loop);
- }
- static ClearAudio() {
- Laya.SoundManager.stopAllSound();
- }
- static bgmres(_type) {
- return "subpackage/res/sound/" + BgmType[_type] + ".mp3";
- }
- static PlayBgm(_type, _loop = true) {
- if (!this.play)
- return;
- var loop = _loop ? 0 : 1;
- Laya.SoundManager.playMusic(this.bgmres(_type), loop);
- }
- static ClearBgm() {
- Laya.SoundManager.stopMusic();
- }
- }
- AudioControl.play = true;
- var Vector3$5 = Laya.Vector3;
- var Vector4 = Laya.Vector4;
- class PlayerData extends RoleData {
- constructor(_id, _startpos) {
- super(_id, _startpos);
- }
- }
- class Player extends Role {
- constructor() {
- super(...arguments);
- this.onland = true;
- this.runpoint = [];
- this.allfall = false;
- this.allstand = false;
- this.hands = [];
- this.movespeed = 1.25;
- this.curpos = new Vector3$5();
- this.currot = new Laya.Quaternion();
- this.landhit = new Laya.HitResult();
- this.forwardhit = new Laya.HitResult();
- this.playfall = false;
- this.canfowardmove = true;
- this.landg = 0;
- this.falltime = 0;
- this.standtime = -2;
- this.startcamerapos = new Vector3$5();
- this.startcamerarot = new Laya.Quaternion();
- this.find = false;
- }
- static Create(_data, _roleskin) {
- var roleid = _roleskin.skinid;
- var curid = roleid <= 6 ? roleid : roleid - 12;
- var roleasset = AssetManager.role.getValue(curid);
- if (roleasset == null)
- roleasset = AssetManager.role.getValue(1);
- var model = PoolManager.GetSprite3D(roleasset);
- SceneManager.mainscene.addChild(model);
- model.transform.position = new Vector3$5(_data.startpos.x, _data.startpos.y + 0.2, _data.startpos.z);
- model.transform.rotationEuler = new Vector3$5(model.transform.rotationEuler.x, 360 - _data.startpos.w, model.transform.rotationEuler.z);
- var mainrole = model.addComponent(Player);
- Player.mainpalyer = mainrole;
- var mneck;
- if (curid == 1 || curid == 7 || curid == 10) {
- mneck = model.getChildAt(0).getChildAt(0).getChildAt(0).getChildAt(0).getChildAt(2).getChildAt(0);
- }
- else {
- mneck = model.getChildAt(0).getChildAt(0).getChildAt(0).getChildAt(0).getChildAt(2).getChildAt(0).getChildAt(0);
- }
- mainrole.lefthandpoint = mneck.getChildAt(1).getChildAt(0).getChildAt(0).getChildAt(0).getChildAt(0).getChildAt(0);
- mainrole.righthandpoint = mneck.getChildAt(2).getChildAt(0).getChildAt(0).getChildAt(0).getChildAt(0).getChildAt(0);
- mainrole.WeaponShow();
- mainrole.jseffect = PoolManager.GetSprite3D(AssetManager.effect.getValue(3));
- model.addChild(mainrole.jseffect);
- mainrole.jseffect.transform.localPosition = new Vector3$5(0, 0, 0);
- mainrole.jseffect.active = false;
- mainrole.mcollider = model.getChildAt(1).getComponent(Laya.PhysicsCollider);
- mainrole.mcollider.collisionGroup = ColliderLay.player;
- mainrole.handmaterial = new Laya.BlinnPhongMaterial;
- mainrole.handmaterial.albedoColor = new Vector4(0, 0, 0);
- mainrole.Init(model);
- mainrole.OnInit();
- return mainrole;
- }
- OnInit() {
- this.mlevel = LevelManager.Instance.curlevel;
- this.movespeed = this.mlevel.leveldata.missiondata.move;
- this.RegEvent();
- CameraManager.Instance.SetFollow(this.cursprite);
- Laya.timer.frameLoop(1, this, this.OnLifeLoop);
- this.runpoint.push(this.cursprite.transform.position.clone());
- }
- OnClear() {
- this.ClearDraws();
- EventManager.Off(EventType.DrawEnd, this, this.PathToCurve);
- this.curlweapontrigger.destroy();
- this.currweapontrigger.destroy();
- PoolManager.RecoverSprite3D(this.curlweapon, true);
- PoolManager.RecoverSprite3D(this.currweapon, true);
- PoolManager.RecoverSprite3D(this.jseffect, true);
- this.curlweaponeffect.destroy();
- this.currweaponeffect.destroy();
- if (this.wineffect)
- PoolManager.RecoverSprite3D(this.wineffect);
- EventManager.InputOff(TouchState.slider, this, this.OnSlider);
- EventManager.InputOff(TouchState.up, this, this.OnUp);
- EventManager.Off(EventType.Hit, this, this.OnHit);
- EventManager.GameOff(GameState.Playing, this, this.OnGamePlaying);
- Laya.timer.clear(this, this.OnLifeLoop);
- this.runpoint = [];
- }
- ClearDraws() {
- Laya.timer.clear(this, this.OnRotWeapon);
- this.ClearHands();
- if (this.currweaponrig != null) {
- this.currweaponrig.destroy();
- this.currdrawweaponcheck.destroy();
- this.currweaponrig = null;
- }
- if (this.curlweaponrig != null) {
- this.curlweaponrig.destroy();
- this.curldrawweaponcheck.destroy();
- this.curlweaponrig = null;
- }
- if (this.drawlweapon != null) {
- this.drawlweapon.destroy();
- this.drawlweapon = null;
- }
- if (this.drawrweapon != null) {
- this.drawrweapon.destroy();
- this.drawrweapon = null;
- }
- }
- ShowWeapon(_active) {
- this.curlweapon.active = _active;
- this.currweapon.active = _active;
- this.ClearDraws();
- }
- RegEvent() {
- EventManager.InputOn(TouchState.slider, this, this.OnSlider);
- EventManager.InputOn(TouchState.up, this, this.OnUp);
- EventManager.On(EventType.Hit, this, this.OnHit);
- EventManager.GameOn(GameState.Playing, this, this.OnGamePlaying);
- EventManager.On(EventType.DrawEnd, this, this.PathToCurve);
- }
- OnGamePlaying() {
- }
- onStateChange(_state, _data) {
- this.standtime = 0;
- if (_state == RoleState.Die) {
- this.OnEnterDie();
- }
- else if (_state == RoleState.Runing) {
- this.OnEnterRunning();
- }
- else if (_state == RoleState.Idle) {
- this.OnEnterIdle();
- }
- else if (_state == RoleState.Attack) {
- this.OnEnterAttack(_data);
- }
- else if (_state == RoleState.Win) {
- this.OnEnterWin();
- }
- }
- ClearHands() {
- for (var i = 0; i < this.hands.length; i++) {
- var mhand = this.hands[i];
- PoolManager.RecoverSprite3D(mhand);
- }
- this.hands = [];
- }
- PathToCurve(_path, one) {
- this.curlweapon.active = false;
- this.currweapon.active = false;
- this.ClearDraws();
- var lefthands = [];
- var righthands = [];
- this.drawlweapon = new Laya.Sprite3D();
- SceneManager.mainscene.addChild(this.drawlweapon);
- this.drawlweapon.transform.rotationEuler = new Vector3$5(0, 0, 0);
- this.drawlweapon.transform.position = new Vector3$5(0, 0, 0);
- this.drawrweapon = new Laya.Sprite3D();
- SceneManager.mainscene.addChild(this.drawrweapon);
- this.drawrweapon.transform.rotationEuler = new Vector3$5(0, 0, 0);
- this.drawrweapon.transform.position = new Vector3$5(0, 0, 0);
- this.curlweaponrig = this.drawlweapon.addComponent(Laya.Rigidbody3D);
- this.comlbincollider = new Laya.CompoundColliderShape();
- this.curlweaponrig.isKinematic = true;
- this.curlweaponrig.colliderShape = this.comlbincollider;
- this.curldrawweaponcheck = this.drawlweapon.addComponent(WeaponTrigger);
- this.currweaponrig = this.drawrweapon.addComponent(Laya.Rigidbody3D);
- this.comrbincollider = new Laya.CompoundColliderShape();
- this.currweaponrig.isKinematic = true;
- this.currweaponrig.colliderShape = this.comrbincollider;
- this.currdrawweaponcheck = this.drawrweapon.addComponent(WeaponTrigger);
- var leftpos = this.drawlweapon.transform.position;
- var rightpos = this.drawrweapon.transform.position;
- for (var i = 0; i < _path.length; i++) {
- var curp = _path[i];
- var curpoint = new Vector3$5(curp.x / 150, curp.y / 150, curp.z / 150);
- var leftpoint = new Vector3$5(leftpos.x + curpoint.x, leftpos.y + curpoint.y, leftpos.z + curpoint.z);
- lefthands.push(leftpoint);
- var rightpoint = new Vector3$5(rightpos.x - curpoint.x, rightpos.y - curpoint.y, rightpos.z - curpoint.z);
- righthands.push(rightpoint);
- }
- var leftcurve = new BezierCurve(lefthands);
- var rightcurve = new BezierCurve(righthands);
- this.CreateHand(leftcurve, rightcurve, one);
- }
- CreateHand(leftcurve, rightcurve, one) {
- var PathLength = GameUtils.PathangleLength(leftcurve.pts);
- var size = Math.floor(PathLength / 0.04);
- for (var i = 0; i < size; i++) {
- var pre = i * 0.02;
- if (pre >= 1)
- break;
- var curpos = leftcurve.Interp(pre);
- if (curpos == null || curpos == undefined) {
- console.log(curpos);
- return;
- }
- if (!one) {
- curpos = new Vector3$5(curpos.x + 1, curpos.y + 1.2, curpos.z);
- }
- var lefthand = PoolManager.GetSprite3D(AssetManager.hand);
- this.drawlweapon.addChild(lefthand);
- this.hands.push(lefthand);
- lefthand.transform.position = curpos;
- lefthand.transform.setWorldLossyScale(new Vector3$5(1, 1, 1));
- if (pre > 0.9 || i % 20 == 0) {
- var curshape = new Laya.SphereColliderShape(0.125);
- var playerpos = this.drawlweapon.transform.position.clone();
- curshape.localOffset = curpos;
- this.comlbincollider.addChildShape(curshape);
- }
- var lookpos = leftcurve.Interp(pre + 0.01);
- var quaternion1 = new Laya.Quaternion();
- Laya.Quaternion.lookAt(lookpos, lefthand.transform.position, new Vector3$5(0, 0, 1), quaternion1);
- quaternion1.invert(quaternion1);
- lefthand.transform.rotation = quaternion1;
- if (!one) {
- var curpos = rightcurve.Interp(pre);
- curpos = new Vector3$5(curpos.x - 1, curpos.y + 1.2, curpos.z);
- }
- var righthand = PoolManager.GetSprite3D(AssetManager.hand);
- this.drawrweapon.addChild(righthand);
- this.hands.push(righthand);
- righthand.transform.position = curpos;
- righthand.transform.setWorldLossyScale(new Vector3$5(1, 1, 1));
- if (pre > 0.9 || i % 20 == 0) {
- var curshape = new Laya.SphereColliderShape(0.125);
- var playerpos = this.drawrweapon.transform.position.clone();
- curshape.localOffset = curpos;
- this.comrbincollider.addChildShape(curshape);
- }
- var lookpos = leftcurve.Interp(pre + 0.01);
- var quaternion1 = new Laya.Quaternion();
- Laya.Quaternion.lookAt(lookpos, righthand.transform.position, new Vector3$5(0, 0, 1), quaternion1);
- quaternion1.invert(quaternion1);
- righthand.transform.rotation = quaternion1;
- }
- if (one) {
- this.lefthandpoint.addChild(this.drawlweapon);
- this.drawlweapon.transform.localPosition = new Vector3$5(0, 0, 0);
- this.drawlweapon.transform.localRotationEuler = new Vector3$5(0, 0, 0);
- this.drawlweapon.transform.setWorldLossyScale(new Vector3$5(1, 1, 1));
- this.righthandpoint.addChild(this.drawrweapon);
- this.drawrweapon.transform.localPosition = new Vector3$5(0, 0, 0);
- this.drawrweapon.transform.localRotationEuler = new Vector3$5(0, 0, 0);
- this.drawrweapon.transform.setWorldLossyScale(new Vector3$5(1, 1, 1));
- }
- else {
- this.cursprite.addChild(this.drawlweapon);
- this.drawlweapon.transform.localPosition = new Vector3$5(0, 0, 0);
- this.drawlweapon.transform.localRotationEuler = new Vector3$5(0, 0, 0);
- this.drawlweapon.transform.setWorldLossyScale(new Vector3$5(1, 1, 1));
- this.cursprite.addChild(this.drawrweapon);
- this.drawrweapon.transform.localPosition = new Vector3$5(0, 0, 0);
- this.drawrweapon.transform.localRotationEuler = new Vector3$5(0, 0, 0);
- this.drawrweapon.transform.setWorldLossyScale(new Vector3$5(1, 1, 1));
- Laya.timer.frameLoop(1, this, this.OnRotWeapon);
- }
- }
- OnRotWeapon() {
- if (this.drawlweapon) {
- this.drawlweapon.transform.rotate(new Vector3$5(0, 0.1, 0));
- }
- if (this.drawrweapon) {
- this.drawrweapon.transform.rotate(new Vector3$5(0, 0.1, 0));
- }
- }
- OnEnterWin() {
- TtSdk.Shake(false);
- this.curanimator.play("dance");
- Laya.timer.clear(this, this.OnLifeLoop);
- this.wineffect = PoolManager.GetSprite3D(AssetManager.effect.getValue(6));
- SceneManager.mainscene.addChild(this.wineffect);
- this.wineffect.transform.position = this.cursprite.transform.position;
- AudioControl.ClearBgm();
- AudioControl.PlayVoice(VoiceType.win);
- Laya.timer.once(2500, this, () => {
- GameManager.Instance.ChangeGameState(GameState.Win);
- });
- }
- OnHit(_monster) {
- if (InputManager.caninput == false)
- return;
- this.ChangeState(RoleState.Die);
- }
- OnEnterAttack(_sprite) {
- }
- OnEnterIdle() {
- if (!this.playfall)
- this.curanimator.play("idle");
- }
- OnEnterRunning() {
- if (!this.playfall)
- this.curanimator.play("run");
- }
- OnEnterDie() {
- TtSdk.Shake(false);
- AudioControl.ClearBgm();
- AudioControl.PlayVoice(VoiceType.lose);
- this.curanimator.play("die");
- CameraManager.Instance.StopFollow();
- Laya.timer.frameOnce(80, this, () => {
- GameManager.Instance.ChangeGameState(GameState.Lose);
- });
- }
- OnEnterLose() {
- }
- OnGameWin(_player) {
- }
- OnSlider(_dir) {
- if (GameManager.Instance.curgamestate != GameState.Playing)
- return;
- if (!InGameWindow.caninput)
- return;
- var rotdir = _dir;
- this.Move(_dir, rotdir);
- }
- get revivepoint() {
- if (this.runpoint.length > 0) {
- return this.runpoint[0];
- }
- var datapos = LevelManager.Instance.curlevel.leveldata.playerdata.startpos;
- return new Vector3$5(datapos.x, datapos.y, datapos.z);
- }
- Revive() {
- this.cursprite.transform.position = this.revivepoint;
- this.end = false;
- this.ChangeState(RoleState.Idle, true);
- CameraManager.Instance.ResetTarget(this.cursprite);
- this.SetWuDi();
- }
- SetWuDi(time = 5000) {
- this.wudi = true;
- Laya.timer.once(time, this, () => {
- this.wudi = false;
- });
- }
- Move(_dir, rotdir) {
- this.ChangeState(RoleState.Runing);
- if (this.currolestate != RoleState.Runing)
- return;
- var curdir = new Vector3$5(-rotdir.x, -rotdir.y, -rotdir.z);
- Laya.Quaternion.rotationLookAt(curdir, new Vector3$5(0, 1, 0), this.currot);
- this.currot.invert(this.currot);
- Laya.Quaternion.slerp(this.cursprite.transform.rotation, this.currot, 0.06, this.currot);
- this.cursprite.transform.rotation = this.currot;
- Vector3$5.add(this.cursprite.transform.position, _dir, this.curpos);
- var addv = 0.1 * this.movespeed;
- Vector3$5.lerp(this.cursprite.transform.position, this.curpos, addv, this.curpos);
- if (this.canfowardmove) {
- this.cursprite.transform.position = this.curpos;
- }
- EventManager.Trigger(EventType.Running, [this.cursprite.transform.position.clone()]);
- }
- OnUp() {
- this.ChangeState(RoleState.Idle);
- }
- WeaponShow(_skin = null) {
- var equip = PlayerAccount.CurAccountData.GetUser(AccountUser.equip_themes)[skintype.weapon];
- var equiipskin = PlayerAccount.CurAccountData.m_skinDic.getValue(equip);
- equiipskin = _skin == null ? equiipskin : _skin;
- var assetid = equiipskin.skinid - 6;
- if (this.curlweapon != null) {
- PoolManager.RecoverSprite3D(this.curlweapon);
- this.curlweaponeffect.destroy();
- }
- var weaponasset = AssetManager.weapon.getValue(assetid);
- if (weaponasset == null)
- weaponasset = AssetManager.weapon.getValue(1);
- this.curlweapon = PoolManager.GetSprite3D(weaponasset);
- this.curlweapontrigger = this.curlweapon.getChildAt(0).addComponent(WeaponTrigger);
- this.lefthandpoint.addChild(this.curlweapon);
- this.curlweapon.transform.localPosition = new Vector3$5(0, 0, 0);
- this.curlweapon.transform.setWorldLossyScale(new Vector3$5(1, 1, 1));
- var equiptw = PlayerAccount.CurAccountData.GetUser(AccountUser.equip_themes)[skintype.tw];
- var equiptwskin = PlayerAccount.CurAccountData.m_skinDic.getValue(equiptw);
- var twasset = AssetManager.tw.getValue(equiptwskin.skinid - 24);
- this.curlweaponeffect = PoolManager.GetSprite3D(twasset);
- this.curlweapon.addChild(this.curlweaponeffect);
- this.curlweaponeffect.transform.setWorldLossyScale(new Vector3$5(1, 1, 1));
- this.curlweaponeffect.transform.localPosition = new Vector3$5(0, 1, 0);
- if (this.currweapon != null) {
- PoolManager.RecoverSprite3D(this.currweapon);
- this.currweaponeffect.destroy();
- }
- this.currweapon = PoolManager.GetSprite3D(weaponasset);
- this.currweapontrigger = this.currweapon.getChildAt(0).addComponent(WeaponTrigger);
- this.righthandpoint.addChild(this.currweapon);
- this.currweapon.transform.localPosition = new Vector3$5(0, 0, 0);
- this.currweapon.transform.setWorldLossyScale(new Vector3$5(1, 1, 1));
- this.currweaponeffect = PoolManager.GetSprite3D(twasset);
- this.currweapon.addChild(this.currweaponeffect);
- this.currweaponeffect.transform.setWorldLossyScale(new Vector3$5(1, 1, 1));
- this.currweaponeffect.transform.localPosition = new Vector3$5(0, 1, 0);
- }
- TurnWeaponEffect(_skin) {
- var equip = PlayerAccount.CurAccountData.GetUser(AccountUser.equip_themes)[skintype.tw];
- var equiipskin = PlayerAccount.CurAccountData.m_skinDic.getValue(equip);
- equiipskin = _skin == null ? equiipskin : _skin;
- var assetid = equiipskin.skinid - 24;
- var twasset = AssetManager.tw.getValue(assetid);
- if (this.currweaponeffect)
- PoolManager.RecoverSprite3D(this.currweaponeffect);
- this.currweaponeffect = PoolManager.GetSprite3D(twasset);
- this.currweapon.addChild(this.currweaponeffect);
- this.currweaponeffect.transform.setWorldLossyScale(new Vector3$5(1, 1, 1));
- this.currweaponeffect.transform.localPosition = new Vector3$5(0, 1, 0);
- if (this.curlweaponeffect)
- PoolManager.RecoverSprite3D(this.curlweaponeffect);
- this.curlweaponeffect = PoolManager.GetSprite3D(twasset);
- this.curlweapon.addChild(this.curlweaponeffect);
- this.curlweaponeffect.transform.setWorldLossyScale(new Vector3$5(1, 1, 1));
- this.curlweaponeffect.transform.localPosition = new Vector3$5(0, 1, 0);
- }
- get LandCheck() {
- var hitenter = false;
- var curpos = this.cursprite.transform.position;
- var startpoint = new Vector3$5(curpos.x, curpos.y + 10, curpos.z);
- var dir = new Vector3$5(0, -1, 0);
- var ray = new Laya.Ray(startpoint, dir);
- var landlay = ColliderLay.plane | ColliderLay.end;
- if (SceneManager.mainscene.physicsSimulation.rayCast(ray, this.landhit, 100, 1, landlay)) {
- var hight = startpoint.y - this.landhit.point.y;
- hitenter = true;
- hitenter = (hight > 9 && hight < 11) ? true : false;
- if (this.landhit.collider.collisionGroup == ColliderLay.end) {
- this.ChangeState(RoleState.Win);
- }
- }
- return hitenter;
- }
- get ForwardCheck() {
- var hitenter = true;
- var curpos = this.cursprite.transform.position;
- var startpoint = new Vector3$5(curpos.x, curpos.y + 0.1, curpos.z);
- var dir = new Vector3$5();
- this.cursprite.transform.getForward(dir);
- dir = new Vector3$5(-dir.x, -dir.y, -dir.z);
- var ray = new Laya.Ray(startpoint, dir);
- if (SceneManager.mainscene.physicsSimulation.rayCast(ray, this.forwardhit, 0.5)) {
- if (this.forwardhit.collider.collisionGroup == ColliderLay.obstacle) {
- return false;
- }
- }
- return hitenter;
- }
- OnLifeLoop() {
- if (GameManager.Instance.curgamestate != GameState.Playing)
- return;
- var curland = this.LandCheck;
- if (curland) {
- var mpos = this.cursprite.transform.position;
- if (this.landhit) {
- this.cursprite.transform.position = new Vector3$5(mpos.x, this.landhit.point.y, mpos.z);
- this.runpoint.push(this.cursprite.transform.position.clone());
- if (this.runpoint.length > 50) {
- this.runpoint.splice(0, 1);
- }
- }
- }
- if (!this.onland && curland) {
- this.playfall = false;
- this.jseffect.active = false;
- if (this.currolestate == RoleState.Idle) {
- this.curanimator.play("idle");
- }
- else if (this.currolestate == RoleState.Runing) {
- this.curanimator.play("run");
- }
- this.landg = 0;
- this.falltime = 0;
- }
- this.onland = curland;
- if (!this.onland) {
- if (this.playfall == false) {
- this.playfall = true;
- this.curanimator.play("fall");
- this.jseffect.active = true;
- }
- if (this.landg != 0.1)
- this.landg = GameUtils.lerp(this.landg, 0.1, 0.025);
- var mpos = this.cursprite.transform.position;
- this.cursprite.transform.position = new Vector3$5(mpos.x, mpos.y - this.landg, mpos.z);
- this.falltime += 0.016;
- if (!this.allfall && this.falltime > 5) {
- this.allfall = true;
- }
- this.CheckFallDie();
- }
- this.canfowardmove = this.ForwardCheck;
- if (this.currolestate == RoleState.Idle) {
- this.standtime += 0.016;
- if (!this.allstand && this.standtime > 10) {
- this.allstand = true;
- }
- }
- }
- CheckFallDie() {
- if (this.cursprite.transform.position.y < LevelManager.Instance.curlevel.minhight - 3) {
- this.ChangeState(RoleState.Die);
- }
- }
- FindBoos(_boos) {
- if (this.find)
- return;
- this.find = true;
- InputManager.Instance.OnTouchOut();
- InputManager.caninput = false;
- this.startcamerapos = SceneManager.maincamera.transform.position.clone();
- this.startcamerarot = SceneManager.maincamera.transform.rotation.clone();
- CameraManager.Instance.StopFollow();
- this.ChangeState(RoleState.Wait);
- var lookdir = new Vector3$5();
- var boospos = _boos.cursprite.transform.position.clone();
- var mpos = Player.mainpalyer.cursprite.transform.position.clone();
- Vector3$5.subtract(mpos, boospos, lookdir);
- Vector3$5.normalize(lookdir, lookdir);
- Vector3$5.scale(lookdir, 6, lookdir);
- var lookpos = new Vector3$5();
- Vector3$5.add(boospos, lookdir, lookpos);
- lookpos = new Vector3$5(lookpos.x, lookpos.y + 3, lookpos.z);
- var booslookpos = new Vector3$5(boospos.x, boospos.y + 1, boospos.z);
- var ssf = GameUtils.TweenMove(SceneManager.maincamera.transform, lookpos, 1.2, Laya.Handler.create(this, () => {
- ssf.clear();
- _boos.Provocation(() => {
- this.BackCa();
- });
- }), Laya.Ease.quadOut, booslookpos);
- }
- BackCa() {
- SceneManager.maincamera.transform.rotation = this.startcamerarot;
- CameraManager.Instance.ResetTarget(this.cursprite);
- InputManager.caninput = true;
- }
- }
- var Vector3$6 = Laya.Vector3;
- class RigObj {
- constructor(_target, _complete = null, autocleartime = 2.5, rottime = 0) {
- this.awake = false;
- this.minhight = 0;
- this.mforce = 0;
- this.starty = 0;
- this.offestY = 0;
- this.g = 0.1;
- this.m_time = 0;
- this.curPos = new Vector3$6();
- this.screenhit = new Laya.HitResult();
- this.enter = false;
- this.completecallback = _complete;
- Laya.timer.frameLoop(1, this, this.LifeLoop);
- if (rottime < autocleartime)
- rottime = 0;
- this.rottime = rottime;
- if (autocleartime > 0) {
- var lifetime = autocleartime > rottime ? autocleartime : rottime;
- Laya.timer.once(1000 * lifetime, this, this.Destory);
- }
- this.msprite = _target;
- this.starty = _target.transform.position.y;
- this.minhight = this.starty;
- }
- AddForce(_dir, _force, _rotSpeed = 1) {
- this.awake = true;
- this.curdir = new Vector3$6();
- Vector3$6.normalize(_dir, this.curdir);
- Vector3$6.scale(this.curdir, _force, this.curdir);
- var xr = Math.random() > 0.5 ? 1 : -1;
- var yr = Math.random() > 0.5 ? 1 : -1;
- var zr = Math.random() > 0.5 ? 1 : -1;
- this.currotdir = new Vector3$6(Math.random() * 0.02 * xr * _rotSpeed, Math.random() * 0.02 * yr * _rotSpeed, Math.random() * 0.02 * zr * _rotSpeed);
- }
- LifeLoop() {
- if (!this.awake)
- return;
- var checkdis = this.PlaneCheck;
- if (checkdis != null && checkdis <= 0) {
- this.Destory();
- return;
- }
- var mpos = this.msprite.transform.position;
- this.m_time += 0.005;
- this.offestY -= this.g * this.m_time * this.m_time;
- Vector3$6.add(mpos, this.curdir, this.curPos);
- Vector3$6.lerp(mpos, this.curPos, 0.12, this.curPos);
- this.msprite.transform.rotate(this.currotdir);
- if (this.msprite.transform.position.y >= this.minhight) {
- var curoffestx = this.curPos.x - mpos.x;
- var curoffesty = this.curPos.y - mpos.y + this.offestY;
- var curoffextz = this.curPos.z - mpos.z;
- Vector3$6.add(mpos, new Vector3$6(curoffestx, curoffesty, curoffextz), this.curPos);
- this.msprite.transform.position = this.curPos;
- }
- if (curoffesty < 0 && this.msprite.transform.position.y < this.minhight && this.rottime > 0) {
- this.msprite.transform.position = new Vector3$6(mpos.x, this.minhight, mpos.z);
- this.Destory();
- }
- }
- Destory() {
- this.Clear();
- this.FallDown(() => {
- if (this.completecallback != null) {
- this.completecallback();
- }
- });
- }
- Clear() {
- Laya.timer.clearAll(this);
- Laya.timer.clear(this, this.LifeLoop);
- }
- FallDown(_cb) {
- var mpos = this.msprite.transform.position.clone();
- var targetpos = new Vector3$6(mpos.x, mpos.y - 2, mpos.z);
- GameUtils.TweenMove(this.msprite.transform, targetpos, 0.8, Laya.Handler.create(this, () => {
- _cb();
- }));
- }
- get PlaneCheck() {
- var centerpos = this.msprite.transform.position;
- var curray = new Laya.Ray(centerpos, new Vector3$6(0, -1, 0));
- if (SceneManager.mainscene.physicsSimulation.rayCast(curray, this.screenhit, 100)) {
- if (this.screenhit) {
- var dis = this.msprite.transform.position.y - this.screenhit.point.y;
- if (dis > 0) {
- return dis;
- }
- }
- return null;
- }
- else {
- return null;
- }
- }
- }
- var MonsterType;
- (function (MonsterType) {
- MonsterType[MonsterType["BallBoss"] = 0] = "BallBoss";
- MonsterType[MonsterType["Shooter"] = 1] = "Shooter";
- MonsterType[MonsterType["Warrior"] = 2] = "Warrior";
- })(MonsterType || (MonsterType = {}));
- var Weapontype;
- (function (Weapontype) {
- Weapontype[Weapontype["Guitar"] = 1] = "Guitar";
- Weapontype[Weapontype["Fireaxe"] = 2] = "Fireaxe";
- Weapontype[Weapontype["Chair"] = 3] = "Chair";
- Weapontype[Weapontype["Pole"] = 4] = "Pole";
- Weapontype[Weapontype["shuriken"] = 5] = "shuriken";
- Weapontype[Weapontype["Pistol"] = 6] = "Pistol";
- Weapontype[Weapontype["missile"] = 7] = "missile";
- Weapontype[Weapontype["wtaagsg"] = 8] = "wtaagsg";
- })(Weapontype || (Weapontype = {}));
- class MonsterConfig {
- constructor() {
- this.bulletamount = 1;
- this.recognition = 6;
- this.attack_range = 2;
- this.move_speed = 0.3;
- this.frequency = 1;
- this.bullet_speed = 1;
- }
- }
- class MonsterDataManager {
- constructor() {
- MonsterDataManager.OnInit();
- }
- static OnInit() {
- var enemy = PlayerAccount.CurAccountData.GetConfig(AccountConfig.enemy);
- for (var key in enemy) {
- var curdata = enemy[key];
- var id = Number(curdata.id);
- var monsterdata = new MonsterConfig();
- monsterdata.recognition = Number(curdata.recognition);
- monsterdata.attack_range = Number(curdata.attack_range);
- monsterdata.enemy_type = curdata.enemy_type;
- monsterdata.move_speed = Number(curdata.move_speed);
- monsterdata.frequency = Number(curdata.frequency);
- monsterdata.bullet_speed = Number(curdata.bullet_speed);
- this.MonsterDic.add(id, monsterdata);
- }
- var guitarmonster = this.MonsterDic.getValue(1);
- guitarmonster.monstertype = MonsterType.Warrior;
- guitarmonster.weapontype = Weapontype.Guitar;
- var fireaxemonster = this.MonsterDic.getValue(2);
- fireaxemonster.monstertype = MonsterType.Warrior;
- fireaxemonster.weapontype = Weapontype.Fireaxe;
- var chairmonster = this.MonsterDic.getValue(3);
- chairmonster.monstertype = MonsterType.Warrior;
- chairmonster.weapontype = Weapontype.Chair;
- var polemonster = this.MonsterDic.getValue(4);
- polemonster.monstertype = MonsterType.Warrior;
- polemonster.weapontype = Weapontype.Pole;
- var shurikenmonster1 = this.MonsterDic.getValue(5);
- shurikenmonster1.monstertype = MonsterType.Shooter;
- shurikenmonster1.bulletamount = 1;
- shurikenmonster1.weapontype = Weapontype.shuriken;
- var shurikenmonster2 = this.MonsterDic.getValue(6);
- shurikenmonster2.monstertype = MonsterType.Shooter;
- shurikenmonster2.weapontype = Weapontype.shuriken;
- shurikenmonster2.bulletamount = 2;
- var pistolmonster = this.MonsterDic.getValue(7);
- pistolmonster.monstertype = MonsterType.Shooter;
- pistolmonster.bulletamount = 1;
- pistolmonster.weapontype = Weapontype.Pistol;
- var pistolboos = this.MonsterDic.getValue(8);
- pistolboos.monstertype = MonsterType.Shooter;
- pistolboos.weapontype = Weapontype.Pistol;
- pistolboos.bulletamount = 3;
- pistolboos.masktype = 2;
- pistolboos.provocationclip = "gunboosprovocation";
- var shurikenboos = this.MonsterDic.getValue(9);
- shurikenboos.monstertype = MonsterType.Shooter;
- shurikenboos.weapontype = Weapontype.shuriken;
- shurikenboos.bulletamount = 3;
- shurikenboos.masktype = 3;
- shurikenboos.provocationclip = "dartsboosprovocation";
- var ballboos = this.MonsterDic.getValue(10);
- ballboos.monstertype = MonsterType.BallBoss;
- ballboos.weapontype = Weapontype.wtaagsg;
- ballboos.bulletamount = 1;
- ballboos.masktype = 5;
- ballboos.provocationclip = "chuiboosprovocation";
- var rooketboos = this.MonsterDic.getValue(11);
- rooketboos.monstertype = MonsterType.Shooter;
- rooketboos.weapontype = Weapontype.missile;
- rooketboos.bulletamount = 1;
- rooketboos.masktype = 4;
- rooketboos.provocationclip = "paoboosprovocation";
- }
- }
- MonsterDataManager.MonsterDic = new Dictionary();
- var Vector3$7 = Laya.Vector3;
- class MonsterData extends RoleData {
- constructor(_id, _startpos) {
- super(_id, _startpos);
- this.boos = false;
- this.monsterconfig = MonsterDataManager.MonsterDic.getValue(_id);
- }
- }
- class Warrior extends Role {
- constructor() {
- super(...arguments);
- this.movespeed = 0.3;
- this.awakedistance = 8;
- this.attackdistance = 2;
- this.attackrate = 1;
- this.life = false;
- this.movedir = new Vector3$7();
- this.movepos = new Vector3$7();
- this.moverot = new Laya.Quaternion;
- this.landhit = new Laya.HitResult();
- }
- static Create(_data) {
- var roleid = _data.id;
- var roleasset = AssetManager.enemy.getValue(1);
- var model = PoolManager.GetSprite3D(roleasset);
- SceneManager.mainscene.addChild(model);
- model.transform.position = new Vector3$7(_data.startpos.x, _data.startpos.y, _data.startpos.z);
- model.transform.rotationEuler = new Vector3$7(model.transform.rotationEuler.x, 360 - _data.startpos.w, model.transform.rotationEuler.z);
- var monster = model.addComponent(Warrior);
- monster.mdata = _data;
- monster.provocationclip = _data.monsterconfig.provocationclip;
- var neck = model.getChildAt(0).getChildAt(0).getChildAt(1).getChildAt(0).getChildAt(2).getChildAt(0);
- monster.headpoint = neck.getChildAt(0).getChildAt(0);
- monster.weaponpoint = neck.getChildAt(2).getChildAt(0).getChildAt(0).getChildAt(0).getChildAt(0);
- monster.Init(model);
- monster.collider = model.getChildAt(1).getComponent(Laya.PhysicsCollider);
- monster.collider.collisionGroup = ColliderLay.monster;
- monster.collider.enabled = true;
- monster.SkinShow(monster.mdata.monsterconfig.masktype, monster.mdata.monsterconfig.weapontype);
- monster.awakedistance = _data.monsterconfig.recognition;
- monster.attackdistance = _data.monsterconfig.attack_range;
- monster.movespeed = _data.monsterconfig.move_speed;
- monster.attackrate = _data.monsterconfig.frequency;
- monster.upsprite = model.getChildAt(0).getChildAt(2);
- monster.upsprite.active = true;
- monster.downsprite = model.getChildAt(0).getChildAt(1);
- monster.downsprite.active = true;
- monster.OnInit();
- return monster;
- }
- OnInit() {
- this.mlevel = LevelManager.Instance.curlevel;
- this.RegEvent();
- if (this.mdata.boos) {
- this.cursprite.transform.setWorldLossyScale(new Vector3$7(1.5, 1.5, 1.5));
- }
- }
- OnClear() {
- EventManager.Off(EventType.Cut, this, this.OnCut);
- EventManager.Off(EventType.Running, this, this.OnRunning);
- Laya.timer.clearAll(this);
- Laya.timer.clear(this, this.CheckAttack);
- Laya.timer.clear(this, this.AttackLoop);
- Laya.timer.clear(this, this.MoveLoop);
- Laya.timer.clear(this, this.OnLife);
- this.SkinShow(0, 0);
- if (this.cuteffect)
- PoolManager.RecoverSprite3D(this.cuteffect);
- this.curanimator.speed = 1;
- if (this.diedownsprite) {
- var dieani = this.diedownsprite.getChildAt(0).getComponent(Laya.Animator);
- dieani.speed = 1;
- PoolManager.RecoverSprite3D(this.diedownsprite);
- }
- }
- RegEvent() {
- EventManager.On(EventType.Cut, this, this.OnCut);
- EventManager.On(EventType.Running, this, this.OnRunning);
- }
- WithPlaying() {
- if (this.mdata.boos) {
- Player.mainpalyer.FindBoos(this);
- }
- }
- OnCut(_collider) {
- if (_collider != this.collider)
- return;
- TtSdk.Shake(false);
- AudioControl.PlayVoice(VoiceType.cut);
- if (this.AttackTarget)
- this.StopMove();
- this.ChangeState(RoleState.Die, !PlayerAccount.CurAccountData.cuteffect);
- }
- get displayer() {
- var curpos = this.cursprite.transform.position.clone();
- var mainplayerpos = Player.mainpalyer.cursprite.transform.position.clone();
- var dis = GameUtils.Vector32Length(mainplayerpos, curpos);
- return dis;
- }
- OnRunning(_playerpos) {
- if (this.life)
- return;
- var curpos = this.cursprite.transform.position.clone();
- var dis = GameUtils.Vector32Length(_playerpos, curpos);
- if (dis < this.attackdistance && this.currolestate == RoleState.Idle) {
- this.ChangeState(RoleState.Attack);
- }
- else if (dis < this.awakedistance && this.currolestate == RoleState.Idle) {
- this.ChangeState(RoleState.Awake);
- }
- }
- OnLife() {
- if (Player.mainpalyer.currolestate == RoleState.Die || Player.mainpalyer.currolestate == RoleState.Win)
- return;
- if (this.displayer < this.attackdistance && this.currolestate == RoleState.Idle) {
- this.ChangeState(RoleState.Attack);
- }
- else {
- this.ChangeState(RoleState.Awake);
- }
- }
- onStateChange(_state, _data) {
- Laya.timer.clearAll(this);
- Laya.timer.clear(this, this.AttackLoop);
- Laya.timer.clear(this, this.MoveLoop);
- Laya.timer.clear(this, this.OnLife);
- if (_state == RoleState.Awake) {
- this.OnEnterAwake();
- }
- else if (_state == RoleState.Die) {
- this.OnEnterDie(_data);
- }
- else if (_state == RoleState.Attack) {
- this.OnEnterAttack();
- }
- else if (_state == RoleState.Idle) {
- this.OnEnterIdle();
- }
- }
- OnEnterIdle() {
- this.curanimator.play("warrioridle");
- if (this.life) {
- Laya.timer.frameOnce(40, this, () => {
- Laya.timer.clear(this, this.OnLife);
- Laya.timer.frameLoop(1, this, this.OnLife);
- });
- }
- }
- OnEnterAttack() {
- Laya.timer.clear(this, this.AttackLoop);
- this.AttackLoop();
- }
- AttackLoop() {
- if (!InputManager.caninput)
- return;
- this.curanimator.play("attack");
- Laya.timer.frameOnce(40, this, this.CheckAttack);
- var attackduation = 100 / this.attackrate;
- Laya.timer.frameOnce(attackduation, this, () => {
- this.ChangeState(RoleState.Idle);
- });
- }
- CheckAttack() {
- if (this.currolestate == RoleState.Die)
- return;
- if (this.displayer < this.attackdistance * 1.4) {
- Player.mainpalyer.ChangeState(RoleState.Die);
- }
- }
- OnEnterAwake() {
- EventManager.Off(EventType.Running, this, this.OnRunning);
- this.life = true;
- this.curanimator.play("run");
- this.SetMove(Player.mainpalyer);
- }
- SetMove(_target) {
- this.AttackTarget = _target;
- Laya.timer.clear(this, this.MoveLoop);
- Laya.timer.frameLoop(1, this, this.MoveLoop);
- }
- StopMove() {
- Laya.timer.clear(this, this.MoveLoop);
- this.AttackTarget = null;
- }
- MoveLoop() {
- if (!InputManager.caninput)
- return;
- if (this.AttackTarget && this.AttackTarget.currolestate != RoleState.Wait) {
- var mpos = this.cursprite.transform.position.clone();
- Vector3$7.subtract(this.AttackTarget.cursprite.transform.position, mpos, this.movedir);
- Vector3$7.normalize(this.movedir, this.movedir);
- Vector3$7.scale(this.movedir, this.movespeed, this.movedir);
- Vector3$7.add(mpos, this.movedir, this.movepos);
- Vector3$7.lerp(mpos, this.movepos, 0.12, this.movepos);
- var curland = this.LandCheck;
- if (curland) {
- var gasgag = this.cursprite.transform.position;
- if (this.landhit) {
- this.cursprite.transform.position = new Vector3$7(gasgag.x, this.landhit.point.y, gasgag.z);
- }
- this.cursprite.transform.position = this.movepos;
- }
- this.cursprite.transform.rotation = this.RotLook(this.AttackTarget.cursprite.transform.position);
- if (this.displayer < this.attackdistance) {
- this.ChangeState(RoleState.Attack);
- }
- }
- }
- RotLook(_targetpos, _lerp = true) {
- var mpos = this.cursprite.transform.position.clone();
- _targetpos = new Vector3$7(_targetpos.x, mpos.y, _targetpos.z);
- Laya.Quaternion.lookAt(_targetpos, mpos, new Vector3$7(0, 1, 0), this.moverot);
- this.moverot.invert(this.moverot);
- if (_lerp)
- Laya.Quaternion.slerp(this.cursprite.transform.rotation, this.moverot, 0.2, this.moverot);
- this.cursprite.transform.rotation = this.moverot;
- return this.moverot;
- }
- BeBoom() {
- this.ChangeState(RoleState.Die, true);
- }
- OnEnterDie(_die = false) {
- GameManager.Instance.goldnum += LevelManager.Instance.curlevel.leveldata.missiondata.masterdrop;
- if (_die) {
- this.collider.enabled = false;
- this.curanimator.play("die");
- if (this.mdata.boos)
- EventManager.Trigger(EventType.BoosDie, [this]);
- Laya.timer.frameOnce(80, this, () => {
- this.FallLand(this.cursprite.transform.position.y - 1, () => {
- this.Clear();
- });
- });
- return;
- }
- var cutasset = AssetManager.effect.getValue(4);
- this.cuteffect = PoolManager.GetSprite3D(cutasset);
- SceneManager.mainscene.addChild(this.cuteffect);
- this.cuteffect.transform.position = this.upsprite.transform.position.clone();
- this.diedownsprite = PoolManager.GetSprite3D(AssetManager.enemy.getValue(1));
- SceneManager.mainscene.addChild(this.diedownsprite);
- this.diedownsprite.transform.position = this.cursprite.transform.position.clone();
- this.diedownsprite.transform.rotationEuler = this.cursprite.transform.rotationEuler.clone();
- if (this.mdata.boos) {
- this.diedownsprite.transform.setWorldLossyScale(new Vector3$7(1.5, 1.5, 1.5));
- }
- var dieupsprite = this.diedownsprite.getChildAt(0).getChildAt(2);
- dieupsprite.active = false;
- var dieupsprite2 = this.diedownsprite.getChildAt(0).getChildAt(1);
- dieupsprite2.active = true;
- var dieani = this.diedownsprite.getChildAt(0).getComponent(Laya.Animator);
- dieani.speed = 0;
- var diec = this.diedownsprite.getChildAt(1).getComponent(Laya.PhysicsCollider);
- diec.enabled = false;
- var downrig = new RigObj(this.diedownsprite, null, 1, 1.2);
- downrig.minhight = 1;
- downrig.AddForce(new Laya.Vector3(0, 1, 0.5), 0.3);
- this.curanimator.speed = 0;
- this.downsprite.active = false;
- var mrig = new RigObj(this.cursprite, () => {
- mrig.Clear();
- this.Clear();
- }, 1);
- mrig.AddForce(new Laya.Vector3(0, 1, 1), 0.5, 2);
- if (this.mdata.boos)
- EventManager.Trigger(EventType.BoosDie, [this]);
- }
- OnEnterLose() {
- }
- onUpdate() {
- }
- EscapeLoop() {
- }
- AwakeLoop() {
- }
- onTriggerEnter(_collider) {
- }
- SkinShow(headid, weaponid) {
- for (var i = 0; i < this.headpoint.numChildren; i++) {
- var head = this.headpoint.getChildAt(i);
- head.active = headid - 1 == i;
- }
- for (var i = 0; i < this.weaponpoint.numChildren; i++) {
- var weapon = this.weaponpoint.getChildAt(i);
- if (weaponid - 1 == i) {
- this.curweapon = weapon;
- this.curweapon.active = true;
- this.curweaponid = weaponid;
- }
- else {
- weapon.active = false;
- }
- }
- }
- get LandCheck() {
- var hitenter = false;
- var curpos = this.cursprite.transform.position;
- var startpoint = new Vector3$7(curpos.x, curpos.y + 10, curpos.z);
- var dir = new Vector3$7(0, -1, 0);
- var ray = new Laya.Ray(startpoint, dir);
- var landlay = ColliderLay.plane | ColliderLay.end;
- if (SceneManager.mainscene.physicsSimulation.rayCast(ray, this.landhit, 100, 1, landlay)) {
- var hight = startpoint.y - this.landhit.point.y;
- hitenter = true;
- hitenter = (hight > 9 && hight < 13) ? true : false;
- }
- return hitenter;
- }
- }
- var Vector3$8 = Laya.Vector3;
- class Bullet {
- constructor(_form, _startpos, _type, _speed) {
- this.cut = false;
- this.life = 10;
- this.clear = false;
- this.follower = false;
- this.curpos = new Vector3$8();
- this.currot = new Laya.Quaternion();
- this.firedir = new Vector3$8();
- this.tridis = 0.5;
- this.forwardhit = new Laya.HitResult();
- this.formonster = _form;
- this.type = _type;
- this.bulletspeed = _speed;
- this.cursprite = PoolManager.GetSprite3D(AssetManager.bullet.getValue(this.type));
- SceneManager.mainscene.addChild(this.cursprite);
- this.cursprite.transform.position = _startpos;
- if (this.type == 1 || this.type == 2) {
- this.tw = PoolManager.GetSprite3D(AssetManager.effect.getValue(1));
- this.cursprite.addChild(this.tw);
- this.tw.transform.localPosition = new Vector3$8(0, 0, 0);
- }
- else if (this.type == 3) {
- this.tw = PoolManager.GetSprite3D(AssetManager.effect.getValue(7));
- this.cursprite.addChild(this.tw);
- this.tw.transform.localPosition = new Vector3$8(0, 0, 0);
- }
- this.upsprite = this.cursprite.getChildAt(1);
- this.downsprite = this.cursprite.getChildAt(0);
- this.curcollider = this.cursprite.getChildAt(2).getComponent(Laya.PhysicsCollider);
- this.curcollider.collisionGroup = ColliderLay.bullet;
- this.OnInit();
- }
- OnInit() {
- EventManager.On(EventType.Cut, this, this.OnCut);
- EventManager.GameOn(GameState.Over, this, this.OnGameEnd);
- }
- OnGameEnd() {
- this.Clear();
- }
- OnCut(_collider) {
- if (_collider != this.curcollider || this.cut)
- return;
- this.BeCut();
- }
- Clear() {
- if (this.clear)
- return;
- this.clear = true;
- Laya.timer.clearAll(this);
- Laya.timer.clear(this, this.FireLoop);
- if (this.tw)
- this.tw.destroy();
- if (this.uprig)
- this.uprig.Clear();
- if (this.downrig)
- this.downrig.Clear();
- if (this.cuteffect) {
- PoolManager.RecoverSprite3D(this.cuteffect);
- }
- if (this.copysprite) {
- var dieupsprite1 = this.copysprite.getChildAt(1);
- dieupsprite1.active = true;
- PoolManager.RecoverSprite3D(this.copysprite);
- }
- this.downsprite.active = true;
- PoolManager.RecoverSprite3D(this.cursprite);
- EventManager.Off(EventType.Cut, this, this.OnCut);
- EventManager.GameOff(GameState.Over, this, this.OnGameEnd);
- }
- Fire(_startdir, _target = null, _follower = false) {
- this.firetarget = _target;
- this.firedir = _startdir ? _startdir : this.firedir;
- this.follower = _follower;
- if (_follower && this.type != 2) {
- var taretpos = this.firetarget.transform.position.clone();
- var lookpos = new Vector3$8(taretpos.x, taretpos.y + 0.5, taretpos.z);
- Laya.Quaternion.lookAt(lookpos, this.cursprite.transform.position, new Vector3$8(0, 1, 0), this.currot);
- this.currot.invert(this.currot);
- this.cursprite.transform.rotation = this.currot;
- }
- if (_target != null) {
- var sfsf = _target.transform.position.clone();
- var targetpos = new Vector3$8(sfsf.x, sfsf.y + 0.5, sfsf.z);
- Vector3$8.subtract(targetpos, this.cursprite.transform.position, this.firedir);
- }
- this.follower = this.follower && _target != null;
- Vector3$8.normalize(this.firedir, this.firedir);
- Vector3$8.scale(this.firedir, this.bulletspeed, this.firedir);
- Laya.timer.frameLoop(1, this, this.FireLoop);
- Laya.timer.once(this.life * 1000, this, this.Clear);
- }
- FireLoop() {
- if (!InputManager.caninput)
- return;
- Vector3$8.add(this.cursprite.transform.position, this.firedir, this.curpos);
- Vector3$8.lerp(this.cursprite.transform.position, this.curpos, 0.12, this.curpos);
- this.cursprite.transform.position = this.curpos;
- if (this.follower) {
- var sfsf = this.firetarget.transform.position.clone();
- var targetpos = new Vector3$8(sfsf.x, sfsf.y + 0.5, sfsf.z);
- Vector3$8.subtract(targetpos, this.cursprite.transform.position, this.firedir);
- Vector3$8.normalize(this.firedir, this.firedir);
- Vector3$8.scale(this.firedir, this.bulletspeed, this.firedir);
- if (this.type != 2) {
- var taretpos = this.firetarget.transform.position.clone();
- var lookpos = new Vector3$8(taretpos.x, this.cursprite.transform.position.y, taretpos.z);
- Laya.Quaternion.lookAt(lookpos, this.cursprite.transform.position, new Vector3$8(0, 1, 0), this.currot);
- this.currot.invert(this.currot);
- Laya.Quaternion.slerp(this.cursprite.transform.rotation, this.currot, 0.2, this.currot);
- this.cursprite.transform.rotation = this.currot;
- }
- }
- if (this.type == 2) {
- this.cursprite.transform.rotate(new Vector3$8(0, 0.1, 0));
- var hifbarrier = this.ForwardCheck(this.firedir);
- if (hifbarrier) {
- var normal = this.forwardhit.normal;
- var newdir = new Vector3$8();
- var fs = -2 * Vector3$8.dot(normal, this.firedir);
- var gsg = new Vector3$8();
- Vector3$8.scale(normal, fs, gsg);
- Vector3$8.subtract(normal, gsg, newdir);
- this.firedir = newdir;
- Vector3$8.normalize(this.firedir, this.firedir);
- Vector3$8.scale(this.firedir, this.bulletspeed, this.firedir);
- }
- }
- if (this.displayer < this.tridis) {
- this.Clear();
- EventManager.Trigger(EventType.Hit, [this.formonster]);
- }
- }
- BeCut() {
- this.cut = true;
- if (this.tw) {
- this.tw.destroy();
- this.tw = null;
- }
- Laya.timer.clear(this, this.FireLoop);
- var cutasset = AssetManager.effect.getValue(4);
- this.cuteffect = PoolManager.GetSprite3D(cutasset);
- SceneManager.mainscene.addChild(this.cuteffect);
- this.cuteffect.transform.position = this.upsprite.transform.position.clone();
- AudioControl.PlayVoice(VoiceType.cut);
- this.copysprite = PoolManager.GetSprite3D(AssetManager.bullet.getValue(this.type));
- SceneManager.mainscene.addChild(this.copysprite);
- this.copysprite.transform.position = this.cursprite.transform.position.clone();
- this.copysprite.transform.rotationEuler = this.cursprite.transform.rotationEuler.clone();
- var dieupsprite = this.copysprite.getChildAt(1);
- dieupsprite.active = false;
- this.uprig = new RigObj(this.copysprite, null, 1);
- this.uprig.minhight = 1;
- this.uprig.AddForce(new Laya.Vector3(0, 1, 0.1), 0.5);
- this.downsprite.active = false;
- this.downrig = new RigObj(this.cursprite, () => {
- this.Clear();
- }, 1.2);
- this.downrig.minhight = 1;
- this.downrig.AddForce(new Laya.Vector3(0, 1, 0.1), 0.3);
- }
- get displayer() {
- var curpos = this.cursprite.transform.position.clone();
- var mainplayerpos = Player.mainpalyer.cursprite.transform.position.clone();
- mainplayerpos = new Vector3$8(mainplayerpos.x, mainplayerpos.y + 0.5, mainplayerpos.z);
- var dis = Vector3$8.distance(mainplayerpos, curpos);
- return dis;
- }
- ForwardCheck(_dir) {
- var hitenter = false;
- var curpos = this.cursprite.transform.position;
- var startpoint = new Vector3$8(curpos.x, curpos.y, curpos.z);
- var ray = new Laya.Ray(startpoint, _dir);
- if (SceneManager.mainscene.physicsSimulation.rayCast(ray, this.forwardhit, 0.5)) {
- if (this.forwardhit.collider.collisionGroup == ColliderLay.obstacle) {
- return true;
- }
- }
- return hitenter;
- }
- }
- var Vector3$9 = Laya.Vector3;
- class Shooter extends Role {
- constructor() {
- super(...arguments);
- this.awakespeed = 0.3;
- this.awakedistance = 10;
- this.attackdistance = 10;
- this.attackrate = 1;
- this.bulletspeed = 1;
- this.life = false;
- this.movedir = new Vector3$9();
- this.movepos = new Vector3$9();
- this.moverot = new Laya.Quaternion;
- }
- static Create(_data) {
- var roleid = _data.id;
- var roleasset = AssetManager.enemy.getValue(1);
- var model = PoolManager.GetSprite3D(roleasset);
- SceneManager.mainscene.addChild(model);
- model.transform.position = new Vector3$9(_data.startpos.x, _data.startpos.y, _data.startpos.z);
- model.transform.rotationEuler = new Vector3$9(model.transform.rotationEuler.x, 360 - _data.startpos.w, model.transform.rotationEuler.z);
- var monster = model.addComponent(Shooter);
- monster.mdata = _data;
- monster.provocationclip = _data.monsterconfig.provocationclip;
- var neck = model.getChildAt(0).getChildAt(0).getChildAt(1).getChildAt(0).getChildAt(2).getChildAt(0);
- monster.headpoint = neck.getChildAt(0).getChildAt(0);
- monster.weaponpoint = neck.getChildAt(2).getChildAt(0).getChildAt(0).getChildAt(0).getChildAt(0);
- monster.Init(model);
- monster.collider = model.getChildAt(1).getComponent(Laya.PhysicsCollider);
- monster.collider.collisionGroup = ColliderLay.monster;
- monster.collider.enabled = true;
- monster.SkinShow(monster.mdata.monsterconfig.masktype, monster.mdata.monsterconfig.weapontype);
- monster.awakedistance = _data.monsterconfig.recognition;
- monster.attackdistance = _data.monsterconfig.attack_range;
- monster.movespeed = _data.monsterconfig.move_speed;
- monster.attackrate = _data.monsterconfig.frequency;
- monster.bulletspeed = _data.monsterconfig.bullet_speed;
- monster.upsprite = model.getChildAt(0).getChildAt(2);
- monster.upsprite.active = true;
- monster.downsprite = model.getChildAt(0).getChildAt(1);
- monster.downsprite.active = true;
- monster.OnInit();
- return monster;
- }
- OnInit() {
- this.mlevel = LevelManager.Instance.curlevel;
- this.RegEvent();
- if (this.mdata.boos) {
- this.cursprite.transform.setWorldLossyScale(new Vector3$9(1.5, 1.5, 1.5));
- }
- }
- OnClear() {
- EventManager.Off(EventType.Cut, this, this.OnCut);
- EventManager.Off(EventType.Running, this, this.OnRunning);
- Laya.timer.clearAll(this);
- Laya.timer.clear(this, this.AttackLoop);
- Laya.timer.clear(this, this.MoveLoop);
- Laya.timer.clear(this, this.OnLife);
- this.SkinShow(0, 0);
- this.curanimator.speed = 1;
- if (this.cuteffect)
- PoolManager.RecoverSprite3D(this.cuteffect);
- if (this.diedownsprite) {
- var dieani = this.diedownsprite.getChildAt(0).getComponent(Laya.Animator);
- dieani.speed = 1;
- PoolManager.RecoverSprite3D(this.diedownsprite);
- }
- }
- RegEvent() {
- EventManager.On(EventType.Cut, this, this.OnCut);
- EventManager.On(EventType.Running, this, this.OnRunning);
- }
- WithPlaying() {
- if (this.mdata.boos) {
- Player.mainpalyer.FindBoos(this);
- }
- }
- OnCut(_collider) {
- if (_collider != this.collider)
- return;
- TtSdk.Shake(false);
- AudioControl.PlayVoice(VoiceType.cut);
- if (this.AttackTarget)
- this.StopMove();
- this.ChangeState(RoleState.Die, !PlayerAccount.CurAccountData.cuteffect);
- }
- get displayer() {
- var curpos = this.cursprite.transform.position.clone();
- var mainplayerpos = Player.mainpalyer.cursprite.transform.position.clone();
- var dis = Vector3$9.distance(mainplayerpos, curpos);
- return dis;
- }
- OnRunning(_playerpos) {
- if (this.life)
- return;
- var curpos = this.cursprite.transform.position.clone();
- var dis = Vector3$9.distance(_playerpos, curpos);
- if (dis < this.attackdistance && this.currolestate == RoleState.Idle) {
- this.ChangeState(RoleState.Attack);
- }
- if (this.AttackTarget)
- this.cursprite.transform.rotation = this.RotLook(this.AttackTarget.transform.position, false);
- }
- OnLife() {
- if (Player.mainpalyer.currolestate == RoleState.Die || Player.mainpalyer.currolestate == RoleState.Win)
- return;
- if (this.currolestate == RoleState.Idle) {
- this.ChangeState(RoleState.Attack);
- }
- if (this.AttackTarget)
- this.cursprite.transform.rotation = this.RotLook(this.AttackTarget.transform.position, false);
- }
- onStateChange(_state, _data) {
- Laya.timer.clear(this, this.AttackLoop);
- Laya.timer.clear(this, this.MoveLoop);
- Laya.timer.clear(this, this.OnLife);
- if (_state == RoleState.Awake) {
- this.OnEnterAwake();
- }
- else if (_state == RoleState.Die) {
- this.OnEnterDie(_data);
- }
- else if (_state == RoleState.Attack) {
- this.OnEnterAttack();
- }
- else if (_state == RoleState.Idle) {
- this.OnEnterIdle();
- }
- }
- OnEnterIdle() {
- if (this.curweaponid == 5) {
- this.curanimator.crossFade("dartsidle", 0.2);
- }
- else if (this.curweaponid == 6) {
- this.curanimator.crossFade("gunidle", 0.2);
- }
- else if (this.curweaponid == 7) {
- this.curanimator.crossFade("paoboosidle", 0.2);
- }
- if (this.life) {
- Laya.timer.frameOnce(80, this, () => {
- Laya.timer.clear(this, this.OnLife);
- Laya.timer.frameLoop(1, this, this.OnLife);
- });
- }
- }
- OnEnterAttack() {
- this.life = true;
- Laya.timer.clear(this, this.AttackLoop);
- this.AttackLoop();
- this.AttackTarget = Player.mainpalyer.cursprite;
- this.cursprite.transform.rotation = this.RotLook(this.AttackTarget.transform.position, false);
- }
- AttackLoop() {
- if (this.curweaponid == 5) {
- this.curanimator.crossFade("darts", 0.2);
- }
- else if (this.curweaponid == 6) {
- this.curanimator.play("shoot");
- }
- else if (this.curweaponid == 7) {
- this.curanimator.crossFade("paoboosattack", 0.2);
- }
- Laya.timer.frameOnce(30, this, () => {
- if (this.currolestate != RoleState.Die)
- this.Fire();
- });
- var attackrate = 100 / this.attackrate;
- Laya.timer.frameOnce(attackrate, this, () => {
- this.ChangeState(RoleState.Idle);
- });
- }
- Fire() {
- if (!InputManager.caninput)
- return;
- var bulletid;
- var firepo;
- var follow = false;
- var speed = this.mdata.monsterconfig.bullet_speed;
- if (this.curweaponid == 5) {
- bulletid = 2;
- firepo = this.curweapon.transform.position;
- }
- else if (this.curweaponid == 6) {
- bulletid = 1;
- firepo = this.firepoint.transform.position;
- }
- else if (this.curweaponid == 7) {
- bulletid = 3;
- firepo = this.curweapon.transform.position;
- follow = true;
- }
- if (this.mdata.monsterconfig.bulletamount == 1) {
- var bullet = new Bullet(this, firepo, bulletid, speed);
- bullet.Fire(null, Player.mainpalyer.cursprite, follow);
- }
- else if (this.mdata.monsterconfig.bulletamount == 2) {
- var bullet1 = new Bullet(this, firepo, bulletid, speed);
- bullet1.Fire(null, Player.mainpalyer.cursprite, follow);
- var dir = new Vector3$9();
- Vector3$9.subtract(Player.mainpalyer.cursprite.transform.position, bullet1.cursprite.transform.position, dir);
- var ggy = Math.atan(dir.z / dir.x) * 180 / Math.PI;
- var f = Vector3$9.scalarLength(dir);
- if (dir.x > 0)
- ggy += 180;
- console.log("angle:", ggy);
- var ggy1 = ggy + 5;
- var xf1 = dir.x > 0 ? Math.abs(Math.sin(ggy1)) : -Math.abs(Math.sin(ggy1));
- var zf1 = dir.z > 0 ? Math.abs(Math.sin(ggy1)) : -Math.abs(Math.sin(ggy1));
- dir = new Vector3$9(xf1 * f, dir.y, zf1 * f);
- var bullet2 = new Bullet(this, firepo, bulletid, speed);
- bullet2.Fire(dir, null, follow);
- }
- else if (this.mdata.monsterconfig.bulletamount == 3) {
- var bullet = new Bullet(this, firepo, bulletid, speed);
- bullet.Fire(null, Player.mainpalyer.cursprite, follow);
- var dir = new Vector3$9();
- Vector3$9.subtract(Player.mainpalyer.cursprite.transform.position, bullet.cursprite.transform.position, dir);
- var ggy = Math.atan(dir.z / dir.x) * 180 / Math.PI;
- var f = Vector3$9.scalarLength(dir);
- if (dir.x > 0)
- ggy += 180;
- var ggy1 = ggy + 5;
- var xf1 = dir.x > 0 ? Math.abs(Math.sin(ggy1)) : -Math.abs(Math.sin(ggy1));
- var zf1 = dir.z > 0 ? Math.abs(Math.sin(ggy1)) : -Math.abs(Math.sin(ggy1));
- dir = new Vector3$9(xf1 * f, dir.y, zf1 * f);
- var bullet2 = new Bullet(this, firepo, bulletid, speed);
- bullet2.Fire(dir, null, follow);
- var dir2 = new Vector3$9();
- var ggy2 = ggy + 10;
- var xf2 = dir.x > 0 ? Math.abs(Math.sin(ggy2)) : -Math.abs(Math.sin(ggy2));
- var zf2 = dir.z > 0 ? Math.abs(Math.sin(ggy2)) : -Math.abs(Math.sin(ggy2));
- dir2 = new Vector3$9(xf2 * f, dir.y, zf2 * f);
- var bullet3 = new Bullet(this, firepo, bulletid, speed);
- bullet3.Fire(dir2, null, follow);
- }
- }
- OnEnterAwake() {
- EventManager.Off(EventType.Running, this, this.OnRunning);
- this.curanimator.play("run");
- this.SetMove(Player.mainpalyer.cursprite);
- }
- SetMove(_target) {
- this.AttackTarget = _target;
- this.movespeed = this.awakespeed;
- Laya.timer.clear(this, this.MoveLoop);
- Laya.timer.frameLoop(1, this, this.MoveLoop);
- }
- StopMove() {
- Laya.timer.clear(this, this.MoveLoop);
- this.AttackTarget = null;
- }
- MoveLoop() {
- if (this.AttackTarget) {
- var mpos = this.cursprite.transform.position.clone();
- Vector3$9.subtract(this.AttackTarget.transform.position, mpos, this.movedir);
- Vector3$9.normalize(this.movedir, this.movedir);
- Vector3$9.scale(this.movedir, this.movespeed, this.movedir);
- Vector3$9.add(mpos, this.movedir, this.movepos);
- Vector3$9.lerp(mpos, this.movepos, 0.12, this.movepos);
- this.cursprite.transform.position = this.movepos;
- this.cursprite.transform.rotation = this.RotLook(this.AttackTarget.transform.position);
- if (this.displayer < this.attackdistance) {
- this.ChangeState(RoleState.Attack);
- }
- }
- }
- RotLook(_targetpos, _lerp = true) {
- var mpos = this.cursprite.transform.position.clone();
- _targetpos = new Vector3$9(_targetpos.x, mpos.y, _targetpos.z);
- Laya.Quaternion.lookAt(_targetpos, mpos, new Vector3$9(0, 1, 0), this.moverot);
- this.moverot.invert(this.moverot);
- if (_lerp)
- Laya.Quaternion.slerp(this.cursprite.transform.rotation, this.moverot, 0.2, this.moverot);
- this.cursprite.transform.rotation = this.moverot;
- return this.moverot;
- }
- BeBoom() {
- this.ChangeState(RoleState.Die, true);
- }
- OnEnterDie(_die = false) {
- GameManager.Instance.goldnum += LevelManager.Instance.curlevel.leveldata.missiondata.masterdrop;
- if (_die) {
- this.collider.enabled = false;
- this.curanimator.play("die");
- if (this.mdata.boos)
- EventManager.Trigger(EventType.BoosDie, [this]);
- Laya.timer.frameOnce(80, this, () => {
- this.FallLand(this.cursprite.transform.position.y - 1, () => {
- this.Clear();
- });
- });
- return;
- }
- var cutasset = AssetManager.effect.getValue(4);
- this.cuteffect = PoolManager.GetSprite3D(cutasset);
- SceneManager.mainscene.addChild(this.cuteffect);
- this.cuteffect.transform.position = this.upsprite.transform.position.clone();
- this.diedownsprite = PoolManager.GetSprite3D(AssetManager.enemy.getValue(1));
- SceneManager.mainscene.addChild(this.diedownsprite);
- this.diedownsprite.transform.position = this.cursprite.transform.position.clone();
- this.diedownsprite.transform.rotationEuler = this.cursprite.transform.rotationEuler.clone();
- if (this.mdata.boos) {
- this.diedownsprite.transform.setWorldLossyScale(new Vector3$9(1.5, 1.5, 1.5));
- }
- var dieupsprite = this.diedownsprite.getChildAt(0).getChildAt(2);
- dieupsprite.active = false;
- var dieupsprite2 = this.diedownsprite.getChildAt(0).getChildAt(1);
- dieupsprite2.active = true;
- var dieani = this.diedownsprite.getChildAt(0).getComponent(Laya.Animator);
- dieani.speed = 0;
- var diec = this.diedownsprite.getChildAt(1).getComponent(Laya.PhysicsCollider);
- diec.enabled = false;
- var downrig = new RigObj(this.diedownsprite, null, 1, 1);
- downrig.minhight = 1;
- downrig.AddForce(new Laya.Vector3(0, 1, 0.5), 0.3);
- this.curanimator.speed = 0;
- this.downsprite.active = false;
- var mrig = new RigObj(this.cursprite, () => {
- mrig.Clear();
- this.Clear();
- }, 1);
- mrig.AddForce(new Laya.Vector3(0, 1, 1), 0.5, 2);
- if (this.mdata.boos)
- EventManager.Trigger(EventType.BoosDie, [this]);
- }
- OnEnterLose() {
- }
- onUpdate() {
- }
- EscapeLoop() {
- }
- AwakeLoop() {
- }
- SkinShow(headid, weaponid) {
- for (var i = 0; i < this.headpoint.numChildren; i++) {
- var head = this.headpoint.getChildAt(i);
- head.active = headid - 1 == i;
- }
- for (var i = 0; i < this.weaponpoint.numChildren; i++) {
- var weapon = this.weaponpoint.getChildAt(i);
- if (weaponid - 1 == i) {
- this.curweapon = weapon;
- this.curweapon.active = true;
- this.curweaponid = weaponid;
- if (weaponid == 6) {
- this.firepoint = this.curweapon.getChildAt(1);
- }
- }
- else {
- weapon.active = false;
- }
- }
- }
- }
- var Vector3$a = Laya.Vector3;
- class RoadData {
- constructor(_type) {
- this.type = _type;
- }
- }
- class Road {
- constructor(_data) {
- this.curdata = _data;
- var roadasset = AssetManager.road.getValue(_data.type);
- this.cursprite = PoolManager.GetSprite3D(roadasset);
- SceneManager.mainscene.addChild(this.cursprite);
- this.cursprite.transform.setWorldLossyScale(_data.scale);
- this.cursprite.transform.position = new Vector3$a(_data.pos.x, _data.pos.y, _data.pos.z);
- this.cursprite.transform.rotationEuler = new Vector3$a(_data.erot.x, 360 - _data.erot.y, _data.erot.z);
- GameUtils.SetColliderLay(this.cursprite, ColliderLay.plane);
- }
- Clear() {
- PoolManager.RecoverSprite3D(this.cursprite);
- }
- }
- class ChuiCheck extends Laya.Script3D {
- onAwake() {
- this.mainplayer = Player.mainpalyer;
- }
- onTriggerEnter(other) {
- if (this.mainplayer.currolestate == RoleState.Die)
- return;
- if (this.cantrigger(other)) {
- EventManager.Trigger(EventType.Chui, [other]);
- }
- }
- cantrigger(_collider) {
- if (GameManager.Instance.curgamestate != GameState.Playing)
- return false;
- if (_collider.collisionGroup == ColliderLay.player) {
- return true;
- }
- return false;
- }
- }
- var Vector3$b = Laya.Vector3;
- class BallBoos extends Role {
- constructor() {
- super(...arguments);
- this.awakespeed = 0.3;
- this.awakedistance = 8;
- this.attackdistance = 6;
- this.standattackdis = 2;
- this.attackrate = 1;
- this.life = false;
- this.movedir = new Vector3$b();
- this.movepos = new Vector3$b();
- this.moverot = new Laya.Quaternion;
- }
- static Create(_data) {
- var roleid = _data.id;
- var roleasset = AssetManager.enemy.getValue(1);
- var model = PoolManager.GetSprite3D(roleasset);
- SceneManager.mainscene.addChild(model);
- model.transform.position = new Vector3$b(_data.startpos.x, _data.startpos.y, _data.startpos.z);
- model.transform.rotationEuler = new Vector3$b(model.transform.rotationEuler.x, 360 - _data.startpos.w, model.transform.rotationEuler.z);
- var monster = model.addComponent(BallBoos);
- monster.mdata = _data;
- monster.provocationclip = _data.monsterconfig.provocationclip;
- var neck = model.getChildAt(0).getChildAt(0).getChildAt(1).getChildAt(0).getChildAt(2).getChildAt(0);
- monster.headpoint = neck.getChildAt(0).getChildAt(0);
- monster.weaponpoint = neck.getChildAt(2).getChildAt(0).getChildAt(0).getChildAt(0).getChildAt(0);
- monster.Init(model);
- monster.collider = model.getChildAt(1).getComponent(Laya.PhysicsCollider);
- monster.collider.collisionGroup = ColliderLay.monster;
- monster.SkinShow(_data.monsterconfig.masktype, 8);
- monster.awakedistance = _data.monsterconfig.recognition;
- monster.attackdistance = _data.monsterconfig.attack_range;
- monster.movespeed = _data.monsterconfig.move_speed;
- monster.attackrate = _data.monsterconfig.frequency;
- monster.upsprite = model.getChildAt(0).getChildAt(2);
- monster.upsprite.active = true;
- monster.downsprite = model.getChildAt(0).getChildAt(1);
- monster.downsprite.active = true;
- monster.OnInit();
- return monster;
- }
- OnInit() {
- this.mlevel = LevelManager.Instance.curlevel;
- this.RegEvent();
- this.cursprite.transform.setWorldLossyScale(new Vector3$b(1.2, 1.2, 1.2));
- }
- OnClear() {
- EventManager.Off(EventType.Cut, this, this.OnCut);
- EventManager.Off(EventType.Running, this, this.OnRunning);
- EventManager.Off(EventType.Chui, this, this.CheckAttack);
- Laya.timer.clearAll(this);
- Laya.timer.clear(this, this.CheckAttack);
- Laya.timer.clear(this, this.AttackLoop);
- Laya.timer.clear(this, this.MoveLoop);
- Laya.timer.clear(this, this.OnLife);
- var chuicheck = this.curweapon.getComponent(ChuiCheck);
- if (chuicheck)
- chuicheck.destroy();
- if (this.cuteffect)
- PoolManager.RecoverSprite3D(this.cuteffect);
- this.curanimator.speed = 1;
- this.SkinShow(0, 0);
- if (this.diedownsprite) {
- var dieani = this.diedownsprite.getChildAt(0).getComponent(Laya.Animator);
- dieani.speed = 1;
- PoolManager.RecoverSprite3D(this.diedownsprite);
- }
- }
- RegEvent() {
- EventManager.On(EventType.Cut, this, this.OnCut);
- EventManager.On(EventType.Running, this, this.OnRunning);
- EventManager.On(EventType.Chui, this, this.CheckAttack);
- }
- WithPlaying() {
- if (this.mdata.boos) {
- Player.mainpalyer.FindBoos(this);
- }
- }
- OnCut(_collider) {
- if (_collider != this.collider)
- return;
- if (this.AttackTarget)
- this.StopMove();
- this.ChangeState(RoleState.Die, !PlayerAccount.CurAccountData.cuteffect);
- TtSdk.Shake(false);
- AudioControl.PlayVoice(VoiceType.cut);
- var cutasset = AssetManager.effect.getValue(4);
- this.cuteffect = PoolManager.GetSprite3D(cutasset);
- SceneManager.mainscene.addChild(this.cuteffect);
- this.cuteffect.transform.position = this.upsprite.transform.position.clone();
- }
- get displayer() {
- var curpos = this.cursprite.transform.position.clone();
- var mainplayerpos = Player.mainpalyer.cursprite.transform.position.clone();
- var dis = GameUtils.Vector32Length(mainplayerpos, curpos);
- return dis;
- }
- OnRunning(_playerpos) {
- if (this.life)
- return;
- var curpos = this.cursprite.transform.position.clone();
- var dis = GameUtils.Vector32Length(_playerpos, curpos);
- if (dis < this.attackdistance && this.currolestate == RoleState.Idle) {
- this.ChangeState(RoleState.Attack);
- }
- else if (dis < this.awakedistance && this.currolestate == RoleState.Idle) {
- this.ChangeState(RoleState.Awake);
- }
- }
- OnLife() {
- if (Player.mainpalyer.currolestate == RoleState.Die)
- return;
- if (this.displayer < this.attackdistance && this.currolestate == RoleState.Idle) {
- this.ChangeState(RoleState.Attack);
- }
- else {
- this.ChangeState(RoleState.Awake);
- }
- }
- onStateChange(_state, _data) {
- Laya.timer.clearAll(this);
- Laya.timer.clear(this, this.AttackLoop);
- Laya.timer.clear(this, this.MoveLoop);
- Laya.timer.clear(this, this.OnLife);
- if (_state == RoleState.Awake) {
- this.OnEnterAwake();
- }
- else if (_state == RoleState.Die) {
- this.OnEnterDie(_data);
- }
- else if (_state == RoleState.Attack) {
- this.OnEnterAttack();
- }
- else if (_state == RoleState.Idle) {
- this.OnEnterIdle();
- }
- }
- OnEnterIdle() {
- this.curanimator.play("warrioridle");
- this.curanimator.speed = 1;
- if (this.life) {
- Laya.timer.frameOnce(40, this, () => {
- Laya.timer.clear(this, this.OnLife);
- Laya.timer.frameLoop(1, this, this.OnLife);
- });
- }
- }
- OnEnterAttack() {
- Laya.timer.clear(this, this.AttackLoop);
- this.AttackLoop();
- }
- AttackLoop() {
- this.curanimator.play("chuiboosattack");
- this.curanimator.speed = 0.5;
- var attackduation = 250 / this.attackrate;
- if (this.displayer > this.standattackdis) {
- this.AttackTarget = Player.mainpalyer;
- this.movespeed = this.awakespeed;
- Laya.timer.clear(this, this.MoveLoop);
- Laya.timer.frameLoop(1, this, this.MoveLoop);
- }
- Laya.timer.frameOnce(attackduation, this, () => {
- this.ChangeState(RoleState.Idle);
- });
- }
- CheckAttack() {
- if (this.currolestate == RoleState.Die)
- return;
- Player.mainpalyer.ChangeState(RoleState.Die);
- }
- OnEnterAwake() {
- EventManager.Off(EventType.Running, this, this.OnRunning);
- this.life = true;
- this.curanimator.play("run");
- this.curanimator.speed = 1;
- this.SetMove(Player.mainpalyer);
- }
- SetMove(_target) {
- this.AttackTarget = _target;
- this.movespeed = this.awakespeed;
- Laya.timer.clear(this, this.MoveLoop);
- Laya.timer.frameLoop(1, this, this.MoveLoop);
- }
- StopMove() {
- Laya.timer.clear(this, this.MoveLoop);
- this.AttackTarget = null;
- }
- MoveLoop() {
- if (!InputManager.caninput)
- return;
- if (this.AttackTarget && this.AttackTarget.currolestate != RoleState.Die) {
- var mpos = this.cursprite.transform.position.clone();
- Vector3$b.subtract(this.AttackTarget.cursprite.transform.position, mpos, this.movedir);
- Vector3$b.normalize(this.movedir, this.movedir);
- Vector3$b.scale(this.movedir, this.movespeed, this.movedir);
- Vector3$b.add(mpos, this.movedir, this.movepos);
- Vector3$b.lerp(mpos, this.movepos, 0.12, this.movepos);
- this.cursprite.transform.position = this.movepos;
- Laya.Quaternion.lookAt(this.AttackTarget.cursprite.transform.position, mpos, new Vector3$b(0, 1, 0), this.moverot);
- this.moverot.invert(this.moverot);
- Laya.Quaternion.slerp(this.cursprite.transform.rotation, this.moverot, 0.2, this.moverot);
- this.cursprite.transform.rotation = this.moverot;
- if (this.displayer < this.attackdistance) {
- this.ChangeState(RoleState.Attack);
- }
- }
- }
- OnEnterDie(_die) {
- GameManager.Instance.goldnum += LevelManager.Instance.curlevel.leveldata.missiondata.masterdrop;
- if (_die) {
- this.curanimator.play("die");
- this.curanimator.speed = 1;
- if (this.mdata.boos)
- EventManager.Trigger(EventType.BoosDie, [this]);
- Laya.timer.frameOnce(80, this, () => {
- this.FallLand(this.cursprite.transform.position.y - 1, () => {
- this.Clear();
- });
- });
- return;
- }
- var cutasset = AssetManager.effect.getValue(4);
- this.cuteffect = PoolManager.GetSprite3D(cutasset);
- SceneManager.mainscene.addChild(this.cuteffect);
- this.cuteffect.transform.position = this.upsprite.transform.position.clone();
- this.diedownsprite = PoolManager.GetSprite3D(AssetManager.enemy.getValue(1));
- SceneManager.mainscene.addChild(this.diedownsprite);
- this.diedownsprite.transform.position = this.cursprite.transform.position.clone();
- this.diedownsprite.transform.rotationEuler = this.cursprite.transform.rotationEuler.clone();
- this.diedownsprite.transform.setWorldLossyScale(new Vector3$b(1.2, 1.2, 1.2));
- var dieupsprite = this.diedownsprite.getChildAt(0).getChildAt(2);
- dieupsprite.active = false;
- var dieupsprite2 = this.diedownsprite.getChildAt(0).getChildAt(1);
- dieupsprite2.active = true;
- var dieani = this.diedownsprite.getChildAt(0).getComponent(Laya.Animator);
- dieani.speed = 0;
- var diec = this.diedownsprite.getChildAt(1).getComponent(Laya.PhysicsCollider);
- diec.enabled = false;
- var downrig = new RigObj(this.diedownsprite, null, 1, 1);
- downrig.minhight = 1;
- downrig.AddForce(new Laya.Vector3(0, 1, 0.5), 0.6);
- this.curanimator.speed = 0;
- this.downsprite.active = false;
- var mrig = new RigObj(this.cursprite, () => {
- this.Clear();
- }, 1);
- mrig.AddForce(new Laya.Vector3(0, 1, 0.6), 0.5, 2);
- if (this.mdata.boos)
- EventManager.Trigger(EventType.BoosDie, [this]);
- }
- BeBoom() {
- this.ChangeState(RoleState.Die, true);
- }
- OnEnterLose() {
- }
- onUpdate() {
- }
- EscapeLoop() {
- }
- AwakeLoop() {
- }
- onTriggerEnter(_collider) {
- }
- SkinShow(headid, weaponid) {
- for (var i = 0; i < this.headpoint.numChildren; i++) {
- var head = this.headpoint.getChildAt(i);
- head.active = headid - 1 == i;
- }
- for (var i = 0; i < this.weaponpoint.numChildren; i++) {
- var weapon = this.weaponpoint.getChildAt(i);
- if (weaponid - 1 == i) {
- this.curweapon = weapon;
- this.curweapon.active = true;
- this.curweapon.addComponent(ChuiCheck);
- this.curweaponid = weaponid;
- }
- else {
- weapon.active = false;
- }
- }
- }
- }
- var Vector3$c = Laya.Vector3;
- class GirlData extends RoleData {
- constructor(_id, _startpos) {
- super(_id, _startpos);
- }
- }
- class Girl extends Role {
- constructor() {
- super(...arguments);
- this.awakedistance = 8;
- this.life = false;
- }
- static Create(_data) {
- var roleid = _data.id;
- var roleasset = AssetManager.girl.getValue(roleid);
- var model = PoolManager.GetSprite3D(roleasset);
- SceneManager.mainscene.addChild(model);
- model.transform.position = new Vector3$c(_data.startpos.x, _data.startpos.y, _data.startpos.z);
- model.transform.rotationEuler = new Vector3$c(model.transform.rotationEuler.x, 360 - _data.startpos.w, model.transform.rotationEuler.z);
- var monster = model.addComponent(Girl);
- monster.Init(model);
- monster.collider = model.getChildAt(1).getComponent(Laya.PhysicsCollider);
- monster.collider.collisionGroup = ColliderLay.monster;
- monster.OnInit();
- return monster;
- }
- OnInit() {
- this.mlevel = LevelManager.Instance.curlevel;
- this.RegEvent();
- }
- OnClear() {
- EventManager.Off(EventType.Cut, this, this.OnCut);
- EventManager.Off(EventType.Running, this, this.OnRunning);
- }
- RegEvent() {
- EventManager.On(EventType.Cut, this, this.OnCut);
- EventManager.On(EventType.Running, this, this.OnRunning);
- }
- OnCut(_collider) {
- if (_collider != this.collider)
- return;
- this.ChangeState(RoleState.Die);
- }
- get displayer() {
- var curpos = this.cursprite.transform.position.clone();
- var mainplayerpos = Player.mainpalyer.cursprite.transform.position.clone();
- var dis = GameUtils.Vector32Length(mainplayerpos, curpos);
- return dis;
- }
- OnRunning(_playerpos) {
- if (this.life)
- return;
- var curpos = this.cursprite.transform.position.clone();
- var dis = GameUtils.Vector32Length(_playerpos, curpos);
- if (dis < this.awakedistance && this.currolestate == RoleState.Idle) {
- this.ChangeState(RoleState.Awake);
- }
- }
- OnLife() {
- if (Player.mainpalyer.currolestate == RoleState.Die)
- return;
- this.ChangeState(RoleState.Awake);
- }
- onStateChange(_state, _data) {
- Laya.timer.clearAll(this);
- Laya.timer.clear(this, this.OnLife);
- if (_state == RoleState.Awake) {
- this.OnEnterAwake();
- }
- else if (_state == RoleState.Die) {
- this.OnEnterDie();
- }
- else if (_state == RoleState.Attack) {
- this.OnEnterAttack();
- }
- else if (_state == RoleState.Idle) {
- this.OnEnterIdle();
- }
- }
- OnEnterIdle() {
- this.curanimator.play("idle");
- if (this.life) {
- Laya.timer.frameOnce(40, this, () => {
- Laya.timer.clear(this, this.OnLife);
- Laya.timer.frameLoop(1, this, this.OnLife);
- });
- }
- }
- OnEnterAttack() {
- Laya.timer.clear(this, this.AttackLoop);
- this.AttackLoop();
- }
- AttackLoop() {
- this.curanimator.play("help");
- var attackduation = 80;
- Laya.timer.frameOnce(attackduation, this, () => {
- this.ChangeState(RoleState.Idle);
- });
- }
- OnEnterAwake() {
- this.life = true;
- }
- OnEnterDie() {
- this.curanimator.play("die");
- Laya.timer.frameOnce(50, this, () => {
- this.FallLand(0, () => {
- this.Clear();
- });
- GameManager.Instance.ChangeGameState(GameState.Lose);
- });
- }
- OnEnterLose() {
- }
- onUpdate() {
- }
- EscapeLoop() {
- }
- AwakeLoop() {
- }
- onTriggerEnter(_collider) {
- }
- }
- var taskstate;
- (function (taskstate) {
- taskstate[taskstate["lock"] = 0] = "lock";
- taskstate[taskstate["open"] = 1] = "open";
- taskstate[taskstate["complete"] = 2] = "complete";
- taskstate[taskstate["geted"] = 3] = "geted";
- })(taskstate || (taskstate = {}));
- class Task {
- constructor(_id) {
- this.state = 0;
- this.find = 1;
- this.id = _id;
- }
- }
- class TaskManager {
- constructor() {
- TaskManager.Init();
- }
- static Init() {
- if (PlayerAccount.is_new) {
- Laya.LocalStorage.removeItem("cdtask");
- Laya.LocalStorage.removeItem("firstbx");
- Laya.LocalStorage.removeItem("firstshare");
- Laya.LocalStorage.removeItem("curleveldata");
- Laya.LocalStorage.removeItem("tzpre");
- }
- var cdtask = Laya.LocalStorage.getItem("cdtask");
- if (cdtask) {
- this.cdtask = JSON.parse(cdtask);
- for (var i = 0; i < this.cdtask.length; i++) {
- var cddata = this.cdtask[i];
- var id = Number(cddata.id);
- var curtask = new Task(id);
- curtask.title = cddata.title;
- curtask.content = cddata.content;
- curtask.cdk = Number(cddata.cdk);
- curtask.find = Number(cddata.find);
- curtask.state = Number(cddata.state);
- this.taskdic.add(id, curtask);
- }
- }
- else {
- var exchange = PlayerAccount.CurAccountData.GetConfig(AccountConfig.exchange);
- if (exchange) {
- for (var key in exchange) {
- var data = exchange[key];
- var id = Number(data.id);
- var curtask = new Task(id);
- curtask.title = data.name;
- curtask.content = data.content;
- curtask.cdk = Number(data.code);
- this.taskdic.add(id, curtask);
- }
- }
- for (var i = 0; i < this.taskdic.values.length; i++) {
- var cuss = this.taskdic.values[i];
- var mdd = {};
- mdd["id"] = cuss.id;
- mdd["title"] = cuss.title;
- mdd["content"] = cuss.content;
- mdd["cdk"] = cuss.cdk;
- mdd["state"] = 0;
- mdd["find"] = 1;
- this.cdtask.push(mdd);
- }
- var mcdmes = JSON.stringify(this.cdtask);
- Laya.LocalStorage.setItem("cdtask", mcdmes);
- }
- }
- static SetData(_data = null) {
- if (this.cdtask.length > 0) {
- if (_data != null) {
- for (var i = 0; i < this.cdtask.length; i++) {
- if (_data.id == this.cdtask[i].id) {
- this.cdtask[i].find = _data.find;
- this.cdtask[i].state = _data.state;
- break;
- }
- }
- }
- var mcdmes = JSON.stringify(this.cdtask);
- Laya.LocalStorage.setItem("cdtask", mcdmes);
- this.taskdic = new Dictionary();
- for (var i = 0; i < this.cdtask.length; i++) {
- var cddata = this.cdtask[i];
- var id = Number(cddata.id);
- var curtask = new Task(id);
- curtask.title = cddata.title;
- curtask.content = cddata.content;
- curtask.cdk = Number(cddata.cdk);
- curtask.find = Number(cddata.find);
- curtask.state = Number(cddata.state);
- this.taskdic.add(id, curtask);
- }
- }
- }
- static GetEgg(_set = false) {
- if (this.cdtask.length > 0) {
- var mcd;
- var mms = [];
- for (var i = 0; i < this.cdtask.length; i++) {
- var fgg = this.cdtask[i];
- if (fgg.find == 1) {
- mms.push(fgg);
- }
- }
- if (mms.length > 0) {
- mcd = mms[GameUtils.getRandomInt(0, mms.length - 1)];
- }
- if (mcd != null && _set) {
- mcd.find = 1;
- this.SetData();
- }
- }
- return mcd;
- }
- static OpenEgg(_egg) {
- for (var i = 0; i < this.cdtask.length; i++) {
- var mtassk = this.cdtask[i];
- if (mtassk.id == _egg.id && mtassk.state == 0) {
- mtassk.state = 1;
- this.SetData();
- break;
- }
- }
- }
- static CompleteEgg(_egg) {
- for (var i = 0; i < this.cdtask.length; i++) {
- var mtassk = this.cdtask[i];
- if (mtassk.id == _egg.id && mtassk.state == 1) {
- mtassk.state = 2;
- this.SetData();
- break;
- }
- }
- }
- static GeEgg(_id) {
- var has = false;
- var curtask;
- for (var i = 0; i < this.taskdic.values.length; i++) {
- var mtask = this.taskdic.values[i];
- if (mtask.cdk == _id) {
- has = true;
- curtask = mtask;
- break;
- }
- }
- if (has) {
- for (var i = 0; i < this.cdtask.length; i++) {
- var mtassk = this.cdtask[i];
- if (mtassk.id == curtask.id && mtassk.state == 2) {
- mtassk.state = 3;
- this.SetData();
- break;
- }
- }
- }
- }
- }
- TaskManager.cdtask = [];
- TaskManager.taskdic = new Dictionary();
- var Vector3$d = Laya.Vector3;
- class missiondata {
- constructor(_id) {
- this.color = new Laya.Vector4(130 / 255, 201 / 255, 254 / 255);
- this.trial = false;
- this.ID = _id;
- }
- }
- class LevelData {
- constructor(id) {
- this.camerapos = new Vector3$d();
- this.cameraerot = new Vector3$d();
- this.girldatas = [];
- this.enemydatas = [];
- this.builddatas = [];
- this.roaddatas = [];
- this.move = 1.25;
- this.color = new Laya.Vector4();
- this.id = Number(id);
- }
- getbooslevel() {
- var ss = false;
- for (var i = 0; i < this.enemydatas.length; i++) {
- var curenemy = this.enemydatas[i];
- if (curenemy.boos) {
- ss = true;
- }
- }
- for (var i = 0; i < this.builddatas.length; i++) {
- var curbuild = this.builddatas[i];
- if (curbuild.boos) {
- ss = true;
- }
- }
- return ss;
- }
- }
- class Level {
- constructor(_id, _config) {
- this.simple = false;
- this.gameroles = [];
- this.booss = [];
- this.lenemys = [];
- this.roads = [];
- this.builds = [];
- this.caocongs = [];
- this.leveltasks = [];
- this.minhight = 100;
- this.allboomree = false;
- this.create = false;
- this.clear = false;
- this.levelid = _id;
- this.leveldata = _config;
- this.Init();
- }
- Init() {
- this.map = new Laya.Node();
- this.levelname = "stage" + this.levelid;
- this.map.name = this.levelname;
- }
- GetTask() {
- this.leveltasks = [];
- for (var i = 0; i < TaskManager.taskdic.values.length; i++) {
- var mtask = TaskManager.taskdic.values[i];
- if (mtask.state == taskstate.open) {
- this.leveltasks.push(mtask);
- }
- }
- }
- Create() {
- if (this.create)
- return;
- this.GetTask();
- EventManager.On(EventType.BoosDie, this, this.OnBoosDie);
- EventManager.On(EventType.UseSkin, this, this.OnUseSkin);
- SceneManager.maincamera.clearColor = this.leveldata.missiondata.color;
- SceneManager.maincamera.transform.position = this.leveldata.camerapos;
- SceneManager.maincamera.transform.rotationEuler = this.leveldata.cameraerot;
- if (this.leveldata.endpos) {
- SceneManager.endsprite.active = true;
- SceneManager.endsprite.transform.position = this.leveldata.endpos;
- SceneManager.endsprite.transform.rotationEuler = new Vector3$d(0, this.leveldata.enderoty, 0);
- }
- else {
- SceneManager.endsprite.active = false;
- }
- var equip = PlayerAccount.CurAccountData.GetUser(AccountUser.equip_themes)[skintype.role];
- var equiipskin = PlayerAccount.CurAccountData.m_skinDic.getValue(equip);
- equiipskin = equiipskin == null ? PlayerAccount.CurAccountData.m_skinDic.getValue(1) : equiipskin;
- var mainplayer = Player.Create(this.leveldata.playerdata, equiipskin);
- this.gameroles.push(mainplayer);
- for (var i = 0; i < this.leveldata.enemydatas.length; i++) {
- var curenemydata = this.leveldata.enemydatas[i];
- var monster;
- if (curenemydata.monsterconfig.monstertype == MonsterType.Warrior) {
- monster = Warrior.Create(curenemydata);
- }
- else if (curenemydata.monsterconfig.monstertype == MonsterType.Shooter) {
- monster = Shooter.Create(curenemydata);
- }
- else {
- monster = BallBoos.Create(curenemydata);
- }
- if (curenemydata.boos) {
- this.booss.push(monster);
- }
- this.lenemys.push(monster);
- this.gameroles.push(monster);
- }
- for (var i = 0; i < this.leveldata.girldatas.length; i++) {
- var girldata = this.leveldata.girldatas[i];
- var mgirl = Girl.Create(girldata);
- this.gameroles.push(mgirl);
- }
- for (var i = 0; i < this.leveldata.builddatas.length; i++) {
- var curbuilddata = this.leveldata.builddatas[i];
- var mbuild = GameManager.GetBuild(curbuilddata);
- SceneManager.mainscene.addChild(mbuild.cursprite);
- mbuild.cursprite.transform.position = new Vector3$d(curbuilddata.startpos.x, curbuilddata.startpos.y, curbuilddata.startpos.z);
- mbuild.cursprite.transform.rotationEuler = new Vector3$d(-mbuild.cursprite.transform.rotationEuler.x, 360 - curbuilddata.starteroty, mbuild.cursprite.transform.rotationEuler.z);
- mbuild.OnInit();
- this.builds.push(mbuild);
- if (mbuild.mdata.buildid == 6) {
- this.caocongs.push(mbuild);
- }
- }
- for (var i = 0; i < this.leveldata.roaddatas.length; i++) {
- var curroad = this.leveldata.roaddatas[i];
- var mroad = new Road(curroad);
- this.roads.push(mroad);
- if (mroad.cursprite.transform.position.y < this.minhight) {
- this.minhight = mroad.cursprite.transform.position.y;
- }
- }
- console.log("minhight:", this.minhight);
- console.log("Create Level", this.levelid);
- this.create = true;
- this.clear = false;
- }
- Clear() {
- if (this.clear)
- return;
- SceneManager.endsprite.active = false;
- EventManager.Off(EventType.UseSkin, this, this.OnUseSkin);
- EventManager.Off(EventType.BoosDie, this, this.OnBoosDie);
- this.leveltasks = [];
- this.lenemys = [];
- for (var i = 0; i < this.gameroles.length; i++) {
- var currole = this.gameroles[i];
- currole.Clear();
- }
- this.gameroles = [];
- this.booss = [];
- for (var i = 0; i < this.builds.length; i++) {
- var curbuild = this.builds[i];
- curbuild.Clear();
- }
- this.builds = [];
- for (var i = 0; i < this.roads.length; i++) {
- var curroad = this.roads[i];
- curroad.Clear();
- }
- this.roads = [];
- console.log("Clear Level", this.levelid);
- this.create = false;
- this.clear = true;
- }
- get allccclear() {
- if (this.caocongs.length == 0)
- return false;
- for (var i = 0; i < this.caocongs.length; i++) {
- var mcc = this.caocongs[i];
- if (!mcc.die) {
- return false;
- }
- }
- return true;
- }
- get alllenemynoneclear() {
- if (this.lenemys.length == 0)
- return false;
- for (var i = 0; i < this.lenemys.length; i++) {
- var menene = this.lenemys[i];
- if (menene.die) {
- return false;
- }
- }
- return true;
- }
- get allbuildnoclear() {
- if (this.builds.length == 0)
- return false;
- for (var i = 0; i < this.builds.length; i++) {
- var mbbd = this.builds[i];
- if (mbbd.die) {
- return false;
- }
- }
- return true;
- }
- OnBoosDie(_role) {
- console.log("BoosDie", this.booss.length);
- var curboosindex = this.booss.indexOf(_role);
- if (curboosindex != -1) {
- this.booss.splice(curboosindex, 1);
- }
- if (this.booss.length == 0) {
- Player.mainpalyer.ChangeState(RoleState.Win);
- }
- }
- OnUseSkin(_skin) {
- if (_skin == null)
- return;
- if (_skin.skintype == skintype.role) {
- var curplayer = Player.mainpalyer;
- var curstandpos = curplayer.revivepoint;
- var curindex = this.gameroles.indexOf(curplayer);
- this.gameroles.splice(curindex, 1);
- curplayer.Clear();
- this.leveldata.playerdata.startpos = new Laya.Vector4(curstandpos.x, curstandpos.y, curstandpos.z, 0);
- var mainplayer = Player.Create(this.leveldata.playerdata, _skin);
- this.gameroles.push(mainplayer);
- }
- else if (_skin.skintype == skintype.weapon) {
- var curplayer = Player.mainpalyer;
- curplayer.WeaponShow(_skin);
- }
- else {
- var curplayer = Player.mainpalyer;
- curplayer.TurnWeaponEffect(_skin);
- }
- }
- }
- var Vector3$e = Laya.Vector3;
- class LevelManager {
- constructor() {
- this.missiondatas = new Dictionary();
- this.leveldatas = new Dictionary();
- this.levelConfigs = new Dictionary();
- LevelManager.instance = this;
- console.log("关卡初始化...");
- this.LevelInit();
- }
- static get Instance() {
- return LevelManager.instance;
- }
- LevelInit() {
- this.LevelConfigInit();
- }
- LevelConfigInit() {
- var mission = PlayerAccount.CurAccountData.GetConfig(AccountConfig.mission);
- for (var key in mission) {
- var misdata = mission[key];
- var id = Number(misdata.ID);
- var curmisdata = new missiondata(id);
- curmisdata.win = Number(misdata.win);
- curmisdata.lose = Number(misdata.lose);
- curmisdata.masterdrop = Number(misdata.masterdrop);
- curmisdata.move = Number(misdata.move);
- var misdatacolor = misdata.color.split(";");
- curmisdata.color = new Laya.Vector4(Number(misdatacolor[0]) / 255, Number(misdatacolor[1]) / 255, Number(misdatacolor[2]) / 255, 1);
- var curmisdatatrial = misdata.trial;
- curmisdata.trial = curmisdatatrial == 1;
- curmisdata.type = misdata.type;
- this.missiondatas.add(id, curmisdata);
- }
- var leveldataconfig = PlayerAccount.CurAccountData.GetConfig(AccountConfig.config);
- var leveldataS = "";
- for (var key in leveldataconfig) {
- var curconfig = leveldataconfig[key]["config"];
- leveldataS += curconfig;
- }
- leveldataconfig = JSON.parse(leveldataS);
- for (var key in leveldataconfig) {
- var configdata = leveldataconfig[key];
- var id = Number(configdata.id);
- var leveldata = new LevelData(id);
- var camera = configdata.camera.split(",");
- leveldata.camerapos = new Vector3$e(-Number(camera[0]), Number(camera[1]), Number(camera[2]));
- leveldata.cameraerot = new Vector3$e(-Number(camera[3]), 180 - Number(camera[4]), Number(camera[5]));
- var player = configdata.player.split(",");
- leveldata.playerdata = new PlayerData(Number(player[0]), new Laya.Vector4(-Number(player[1]), Number(player[2]), Number(player[3])));
- if (configdata["end"] && configdata["end"] != "") {
- var curend = configdata["end"].split(",");
- leveldata.endpos = new Vector3$e(-Number(curend[0]), Number(curend[1]), Number(curend[2]));
- leveldata.enderoty = 360 - Number(curend[3]);
- }
- if (configdata.enemy && configdata.enemy != "") {
- var curmonsters = configdata.enemy.split(":");
- for (var i = 0; i < curmonsters.length; i++) {
- var curmonster = curmonsters[i].split(",");
- var curenemy = new MonsterData(Number(curmonster[0]), new Laya.Vector4(-Number(curmonster[1]), Number(curmonster[2]), Number(curmonster[3]), Number(curmonster[4])));
- curenemy.boos = curmonster[5] == "1";
- leveldata.enemydatas.push(curenemy);
- }
- }
- if (configdata.barrier && configdata.barrier != "") {
- var curbarriers = configdata.barrier.split(":");
- for (var i = 0; i < curbarriers.length; i++) {
- var curbarrier = curbarriers[i].split(",");
- var curobs = new builddata(buildtype.barrier, Number(curbarrier[0]), new Laya.Vector4(-Number(curbarrier[1]), Number(curbarrier[2]), Number(curbarrier[3]), Number(curbarrier[4])));
- leveldata.builddatas.push(curobs);
- }
- }
- if (configdata.stand && configdata.stand != "") {
- var curstands = configdata.stand.split(":");
- for (var i = 0; i < curstands.length; i++) {
- var curstand = curstands[i].split(",");
- var curst = new builddata(buildtype.stand, Number(curstand[0]), new Laya.Vector4(-Number(curstand[3]), Number(curstand[4]), Number(curstand[5]), Number(curstand[6])));
- curst.monsterid = Number(curstand[1]);
- curst.boos = curstand[2] == 1;
- leveldata.builddatas.push(curst);
- }
- }
- if (configdata.road && configdata.road != "") {
- var curroad = configdata.road.split(":");
- for (var i = 0; i < curroad.length; i++) {
- var currd = curroad[i].split(",");
- var curr = new RoadData(Number(currd[0]));
- curr.pos = new Vector3$e(-Number(currd[1]), Number(currd[2]), Number(currd[3]));
- curr.erot = new Vector3$e(Number(currd[4]), Number(currd[5]), Number(currd[6]));
- curr.scale = new Vector3$e(Number(currd[7]), Number(currd[8]), Number(currd[9]));
- leveldata.roaddatas.push(curr);
- }
- }
- if (configdata.girl && configdata.girl != "") {
- var curgirl = configdata.girl.split(":");
- for (var i = 0; i < curgirl.length; i++) {
- var mg = curgirl[i].split(",");
- var startpos = new Laya.Vector4(-Number(mg[1]), Number(mg[2]), Number(mg[3]), Number(mg[4]));
- var mgdata = new GirlData(Number(mg[0]), startpos);
- leveldata.girldatas.push(mgdata);
- }
- }
- if (this.missiondatas.containKey(id)) {
- var misda = this.missiondatas.getValue(id);
- leveldata.missiondata = misda;
- }
- this.leveldatas.add(id, leveldata);
- var curlevel = new Level(leveldata.id, leveldata);
- this.levelConfigs.add(curlevel.levelid, curlevel);
- }
- var levelcount = this.levelConfigs.count;
- while (this.levelConfigs.count < 500) {
- var curcount = this.levelConfigs.count;
- var randomindex = GameUtils.getRandomInt(levelcount * 0.5, this.levelConfigs.count);
- var randomlevel = this.levelConfigs.getValue(randomindex);
- var newdata = new LevelData(curcount + 1);
- newdata.camerapos = randomlevel.leveldata.camerapos;
- newdata.cameraerot = randomlevel.leveldata.cameraerot;
- newdata.endpos = randomlevel.leveldata.endpos;
- newdata.enderoty = randomlevel.leveldata.enderoty;
- newdata.playerdata = randomlevel.leveldata.playerdata;
- newdata.girldatas = randomlevel.leveldata.girldatas;
- newdata.enemydatas = randomlevel.leveldata.enemydatas;
- newdata.builddatas = randomlevel.leveldata.builddatas;
- newdata.roaddatas = randomlevel.leveldata.roaddatas;
- newdata.missiondata = randomlevel.leveldata.missiondata;
- var curnelevel = new Level(curcount + 1, newdata);
- this.levelConfigs.add(curnelevel.levelid, curnelevel);
- }
- }
- CreateLevel(_level) {
- this.curlevel = _level;
- _level.Create();
- EventManager.Trigger(EventType.LevelCreateComplete, [_level]);
- }
- ReadyLevel() {
- var stage = Number(PlayerAccount.CurAccountData.GetUser(AccountUser.stage));
- console.log("ready level", stage + 1);
- this.curlevel = this.levelConfigs.getValue(Number(stage + 1));
- this.CreateLevel(this.curlevel);
- }
- ClearLevel() {
- if (this.curlevel)
- this.curlevel.Clear();
- }
- }
- LevelManager.teststage = 19;
- class HomeWindow extends ui.Window.HomeWindowUI {
- constructor() {
- super();
- this.showlevel = [];
- this.cantouch = true;
- HomeWindow.instance = this;
- }
- static get Instance() {
- return HomeWindow.instance;
- }
- InitSize() {
- this.height = Laya.stage.height;
- Laya.stage.on(Laya.Event.RESIZE, this, () => { this.height = Laya.stage.height; });
- this.moneypan.y = Laya.stage.height / 1280 * this.moneypan.y;
- this.bottombtnpan.y = Laya.stage.height / 1280 * this.bottombtnpan.y;
- this.stagepan.y = Laya.stage.height / 1280 * this.stagepan.y;
- this.videopan.y = Laya.stage.height / 1280 * this.videopan.y;
- }
- getshowleveldata() {
- var levels = [];
- var curstageid = Number(PlayerAccount.CurAccountData.GetUser(AccountUser.stage)) + 1;
- var levelsdata = LevelManager.Instance.levelConfigs.values;
- for (var i = 0; i < levelsdata.length; i++) {
- var curdata = levelsdata[i].leveldata;
- if (curdata.id >= curstageid - 2 && curdata.id <= curstageid + 2) {
- curdata.booslevel = curdata.getbooslevel();
- if (curdata.id < curstageid)
- curdata.state = -1;
- if (curdata.id == curstageid)
- curdata.state = 0;
- if (curdata.id > curstageid)
- curdata.state = 1;
- levels.push(curdata);
- }
- }
- var maxstage = levels[levels.length - 1].id;
- if (levels.length == 4) {
- var nextlevel = LevelManager.Instance.levelConfigs.getValue(maxstage + 1).leveldata;
- nextlevel.booslevel = nextlevel.getbooslevel();
- levels.push(nextlevel);
- }
- else if (levels.length == 3) {
- var nextlevel = LevelManager.Instance.levelConfigs.getValue(maxstage + 1).leveldata;
- nextlevel.booslevel = nextlevel.getbooslevel();
- nextlevel.state = 1;
- var nextlevel2 = LevelManager.Instance.levelConfigs.getValue(maxstage + 2).leveldata;
- nextlevel2.booslevel = nextlevel2.getbooslevel();
- nextlevel2.state = 1;
- levels.push(nextlevel);
- levels.push(nextlevel2);
- }
- return levels;
- }
- OnOpen(data = false) {
- console.log("主界面打开...");
- TtSdk.RecordEvent("enterMain");
- this.InitSize();
- this.RegButton();
- this.showlevel = this.getshowleveldata();
- this.RenderStage();
- this.moneyclip.text = PlayerAccount.CurAccountData.GetUser(AccountUser.money);
- }
- RegButton() {
- this.startbtn.clickHandler = Laya.Handler.create(this, this.OnClickStart, null, false);
- this.othergamebtn.clickHandler = Laya.Handler.create(this, this.OnClickMoreGame, null, false);
- this.skinbtn.clickHandler = Laya.Handler.create(this, this.OnClickSkinShop, null, false);
- this.signbtn.clickHandler = Laya.Handler.create(this, this.OnSign, null, false);
- this.cdbtn.clickHandler = Laya.Handler.create(this, this.OnClickCD, null, false);
- this.videogetweapon.clickHandler = Laya.Handler.create(this, this.OnClickVideoGetWeapon, null, false);
- this.videogettw.clickHandler = Laya.Handler.create(this, this.OnClickVideoGetTw, null, false);
- EventManager.InputOn(TouchState.slider, this, this.OnTouchStart);
- }
- OnClickVideoGetWeapon() {
- var reward = PlayerAccount.CurAccountData.GetReward(skintype.weapon);
- if (reward == null)
- return;
- ADHelper.showVideoAd((flag) => {
- if (flag) {
- this.VideoGet(reward);
- }
- });
- }
- OnClickVideoGetTw() {
- var reward = PlayerAccount.CurAccountData.GetReward(skintype.tw);
- if (reward == null)
- return;
- ADHelper.showVideoAd((flag) => {
- if (flag) {
- this.VideoGet(reward);
- }
- });
- }
- VideoGet(_reward) {
- var reward_item = _reward.rewarditem;
- let param = [{ "reward_item": reward_item.toString() }, { "reward_num": _reward.rewardnum.toString() }, { "t": PlayerAccount.ServerTime.toString() }];
- NetworkManager.Instance.HttpPostRequest(PROTOCOLS.vd, param, Laya.Handler.create(this, (e) => {
- WindowManager.Instance.OpenPopView(WindowType.RewardWindow, _reward);
- }), Laya.Handler.create(this, this.OnSignError), true);
- }
- RenderStage() {
- for (var i = 0; i < this.stagelist.numChildren; i++) {
- var _cell = this.stagelist.getChildAt(i);
- var curdata = this.showlevel[i];
- var bg = _cell.getChildAt(0);
- bg.visible = !curdata.booslevel;
- var bgskin = "";
- var stageid = bg.getChildAt(0);
- stageid.text = curdata.id.toString();
- if (curdata.state == -1) {
- bgskin = "zhujiemian-1-1";
- bg.gray = true;
- }
- else if (curdata.state == 0) {
- bgskin = "zhujiemian-3-1";
- }
- else {
- bgskin = "zhujiemian-1-1";
- }
- bg.skin = "game/" + bgskin + ".png";
- var boosksin = "";
- var boosbg = _cell.getChildAt(1);
- boosbg.visible = curdata.booslevel;
- if (curdata.state == -1) {
- boosksin = "zhujiemian-1-3";
- boosbg.gray = true;
- }
- else if (curdata.state == 0) {
- boosksin = "zhujiemian-4-3";
- }
- else {
- boosksin = "zhujiemian-1-3";
- }
- boosbg.skin = "game/" + boosksin + ".png";
- }
- }
- OnHide() {
- Laya.timer.clearAll(this);
- EventManager.InputOff(TouchState.slider, this, this.OnTouchStart);
- }
- OnTouchStart() {
- if (!this.cantouch)
- return;
- var startpoint = new Laya.Point();
- startpoint = this.bottombtnpan.localToGlobal(new Laya.Point(this.startbtn.x, this.startbtn.y));
- var touchpos = new Laya.Vector2(this.mouseX, this.mouseY);
- if (this.mouseX < startpoint.x || this.mouseX > startpoint.x + this.startbtn.width)
- return;
- if (this.mouseY < startpoint.y || this.mouseY > startpoint.y + this.startbtn.height)
- return;
- EventManager.InputOff(TouchState.slider, this, this.OnTouchStart);
- GameManager.Instance.BeginGame();
- }
- OnClickStart() {
- GameManager.Instance.BeginGame();
- }
- OnClickSkinShop() {
- GameUtils.TweenButton(this.skinbtn, () => {
- WindowManager.Instance.ShowWindow(WindowType.SkinWindow);
- });
- }
- OnSign() {
- GameUtils.TweenButton(this.signbtn, () => {
- WindowManager.Instance.ShowWindow(WindowType.SignWindow);
- });
- }
- OnClickCD() {
- WindowManager.Instance.ShowWindow(WindowType.TaskWindow);
- }
- OnClickMoreGame() {
- GameUtils.TweenButton(this.othergamebtn, () => {
- TtSdk.showToast("暂未开放");
- });
- }
- OnSignError(e) {
- console.log(e);
- }
- }
- HomeWindow.sign = true;
- HomeWindow.skin = true;
- class SettlementWindow extends ui.Window.SettlementWindowUI {
- constructor() {
- super();
- this.curwin = false;
- this.videoopen = true;
- this.settment = false;
- SettlementWindow.instance = this;
- }
- static get Instance() {
- return SettlementWindow.instance;
- }
- InitSize() {
- this.height = Laya.stage.height;
- Laya.stage.on(Laya.Event.RESIZE, this, () => { this.height = Laya.stage.height; });
- this.pan.y = Laya.stage.height / 1280 * this.pan.y;
- this.moneypan.y = Laya.stage.height / 1280 * this.moneypan.y;
- this.Btn.y = Laya.stage.height / 1280 * this.Btn.y;
- }
- OnOpen(_win = false) {
- this.curwin = _win;
- this.curlevel = LevelManager.Instance.curlevel;
- var money = this.curwin ? this.curlevel.leveldata.missiondata.win : this.curlevel.leveldata.missiondata.lose;
- money += GameManager.Instance.goldnum;
- this.moneyclip.text = money.toString();
- this.InitSize();
- this.RegButton();
- TtSdk.Instance.RecordStop();
- TtSdk.RecordEvent("openResult");
- this.winshow.visible = this.curwin;
- this.loseshow.visible = !this.curwin;
- this.videoopen = PlayerAccount.CurAccountData.videolock;
- this.videopoint.visible = this.videoopen;
- }
- RegButton() {
- this.nomalaward.clickHandler = Laya.Handler.create(this, this.OnClickNomalAward, null, false);
- this.awardbtn.clickHandler = Laya.Handler.create(this, this.OnGetAward, null, false);
- this.videobtn.clickHandler = Laya.Handler.create(this, this.OnClcikVideo, null, false);
- }
- OnHide() {
- }
- OnClcikVideo() {
- this.videoopen = !this.videoopen;
- this.videopoint.visible = this.videoopen;
- }
- GetSettment(_cb, double = false) {
- if (this.settment) {
- _cb();
- GameManager.Instance.ChangeGameState(GameState.Over, this.curwin);
- }
- this.settment = true;
- var money = this.curwin ? this.curlevel.leveldata.missiondata.win : this.curlevel.leveldata.missiondata.lose;
- money += GameManager.Instance.goldnum;
- if (double)
- money *= 3;
- var goldnum = money.toString();
- var wins = this.curwin ? "1" : "0";
- var agrs = [{ "t": PlayerAccount.CurrentAccount.ServerTime.toString() }, { "play_id": GameManager.Instance.play_id.toString() }, { "win": wins }, { "money": goldnum }];
- NetworkManager.Instance.HttpPostRequest(PROTOCOLS.end, agrs, new Laya.Handler(this, (_data) => {
- _cb();
- }), new Laya.Handler(this, (_data) => {
- console.log("游戏结果err", _data);
- }));
- }
- OnClickNomalAward() {
- GameUtils.TweenButton(this.nomalaward, this.OnSee);
- }
- OnSee() {
- if (SettlementWindow.Instance.videoopen) {
- SettlementWindow.Instance.OnGetAward();
- }
- else {
- SettlementWindow.Instance.GetSettment(() => {
- GameManager.Instance.ChangeGameState(GameState.Over, SettlementWindow.Instance.curwin);
- });
- }
- }
- OnGetAward() {
- if (ADHelper.IsAndroid) {
- ADHelper.showVideoAd((flag) => {
- if (flag) {
- this.GetSettment(() => {
- GameManager.Instance.ChangeGameState(GameState.Over, this.curwin);
- }, true);
- }
- });
- }
- else {
- this.GetSettment(() => {
- GameManager.Instance.ChangeGameState(GameState.Over, this.curwin);
- }, true);
- }
- }
- }
- class RewardWindow extends ui.Window.RewardWindowUI {
- constructor() {
- super();
- RewardWindow.instance = this;
- this.pan.y = Laya.stage.height / 1280 * this.pan.y;
- RewardWindow.btny = this.Btn.y;
- }
- static get Instance() {
- return RewardWindow.instance;
- }
- OnOpen(_rewarddata = null) {
- this.height = Laya.stage.height;
- Laya.stage.on(Laya.Event.RESIZE, this, () => { this.height = Laya.stage.height; });
- this.Btn.y = Laya.stage.height / 1280 * RewardWindow.btny;
- this.curreward = _rewarddata;
- if (this.curreward == null) {
- WindowManager.Instance.ClosePopView(WindowType.RewardWindow);
- return;
- }
- this.skindesc.visible = false;
- this.usebtn.visible = false;
- this.ShowReward(_rewarddata);
- TtSdk.Showbanner();
- }
- OnHide() {
- }
- OnClickClose() {
- WindowManager.Instance.ClosePopView(WindowType.RewardWindow);
- if (this.closeback) {
- this.closeback();
- this.closeback = null;
- }
- }
- ShowReward(_data) {
- this.closebtn.clickHandler = Laya.Handler.create(this, this.OnClickClose);
- this.icon.skin = "icon/" + _data.rewardicon + ".png";
- this.skindesc.visible = true;
- this.skindesc.text = _data.rewardname;
- this.usebtn.visible = true;
- var skinid = _data.rewarditem % 6000;
- this.usebtn.clickHandler = Laya.Handler.create(this, this.OnUseSkin, [skinid], false);
- }
- OnUseSkin(_id) {
- var skinid = _id;
- var curskin = PlayerAccount.CurAccountData.m_skinDic.getValue(_id);
- var agrs = [{ "id": skinid.toString() }];
- NetworkManager.Instance.HttpPostRequest(PROTOCOLS.Equip, agrs, Laya.Handler.create(this, () => {
- PlayerAccount.CurAccountData.UpdateSkinDic();
- this.OnClickClose();
- EventManager.Trigger(EventType.UseSkin, [curskin]);
- }), null);
- }
- }
- RewardWindow.btny = 1;
- class ReviveWindow extends ui.Window.ReviveWindowUI {
- constructor() {
- super();
- this.counttime = 5;
- this.play = true;
- ReviveWindow.instance = this;
- }
- static get Instance() {
- return ReviveWindow.instance;
- }
- InitSize() {
- this.height = Laya.stage.height;
- Laya.stage.on(Laya.Event.RESIZE, this, () => { this.height = Laya.stage.height; });
- this.Btn.y = Laya.stage.height / 1280 * this.Btn.y;
- this.pan.y = Laya.stage.height / 1280 * this.pan.y;
- }
- OnOpen(_win = false) {
- this.InitSize();
- this.RegButton();
- GameManager.alllose++;
- Laya.timer.loop(1000, this, this.OnCountTime);
- TtSdk.RecordEvent("openRelive");
- TtSdk.Showbanner();
- }
- RegButton() {
- this.passbtn.clickHandler = Laya.Handler.create(this, this.OnPass, null, false);
- this.closebtn.clickHandler = Laya.Handler.create(this, this.OnClose, null, false);
- }
- OnHide() {
- Laya.timer.clear(this, this.OnCountTime);
- }
- OnCountTime() {
- if (!this.play)
- return;
- if (this.counttime > 0) {
- this.counttime -= 1;
- }
- else {
- Laya.timer.clear(this, this.OnCountTime);
- this.counttime = 0;
- this.OnClose();
- }
- this.timetex.text = this.counttime.toString();
- }
- OnPass() {
- if (ADHelper.IsAndroid) {
- this.play = false;
- ADHelper.showVideoAd((flag) => {
- if (flag) {
- Player.mainpalyer.Revive();
- GameManager.Instance.ChangeGameState(GameState.Playing);
- }
- else {
- this.play = true;
- }
- });
- }
- else {
- Player.mainpalyer.Revive();
- GameManager.Instance.ChangeGameState(GameState.Playing);
- }
- }
- OnClose() {
- GameManager.Instance.CheckComplete(false);
- }
- }
- class SkinWindow extends ui.Window.SkinWindowUI {
- constructor() {
- super();
- this.curskindatas = [];
- this.rootspeed1 = -0.015;
- this.currotspeed = -0.015;
- this.canwear = true;
- SkinWindow.instance = this;
- }
- static get Instance() {
- return SkinWindow.instance;
- }
- OnOpen(_data = null) {
- this.height = Laya.stage.height;
- this.moneypan.y = Laya.stage.height / 1280 * this.moneypan.y;
- this.homebtn.y = Laya.stage.height / 1280 * this.homebtn.y;
- this.listpan.top = Laya.stage.height / 1280 * this.listpan.top;
- this.cdkbtn.y = Laya.stage.height / 1280 * this.cdkbtn.y;
- this.RegEvent();
- this.moneyclip.text = PlayerAccount.CurAccountData.GetUser(AccountUser.money);
- Laya.timer.once(10, this, () => {
- this.NewShow();
- });
- }
- RegEvent() {
- this.homebtn.clickHandler = Laya.Handler.create(this, this.OnClickClose, null, false);
- this.pfbtn.clickHandler = Laya.Handler.create(this, this.OnClickXGG, null, false);
- this.wqbtn.clickHandler = Laya.Handler.create(this, this.OnClickXJJ, null, false);
- this.twbtn.clickHandler = Laya.Handler.create(this, this.OnClickTW, null, false);
- this.cdkbtn.clickHandler = Laya.Handler.create(this, this.OnOpenCDkView, null, false);
- EventManager.On(EventType.UseSkin, this, this.ReFreshData);
- EventManager.On(EventType.getmoney, this, this.ReFreshData);
- }
- OnClickXGG() {
- this.SetBtnShow(skintype.role);
- this.ShowBoySkin();
- }
- OnClickXJJ() {
- this.SetBtnShow(skintype.weapon);
- this.ShowGirlSkin();
- }
- OnClickTW() {
- this.SetBtnShow(skintype.tw);
- this.ShowTwSkin();
- }
- OnOpenCDkView() {
- WindowManager.Instance.OpenPopView(WindowType.CDKView);
- }
- SetBtnShow(_skintype) {
- for (var i = 0; i < this.skinpan.numChildren; i++) {
- var skin = this.skinpan.getChildAt(i);
- var closeskin = skin.getChildAt(1);
- if (i + 1 == _skintype) {
- closeskin.visible = false;
- }
- else {
- closeskin.visible = true;
- }
- }
- }
- OnHide() {
- if (this.mainrole)
- PoolManager.RecoverSprite3D(this.mainrole);
- Laya.timer.clear(this, this.RotLoop);
- if (this.panCamera) {
- this.panCamera.active = false;
- this.panCamera.removeSelf();
- this.panCamera.destroy();
- }
- if (this.panlight) {
- this.panlight.active = false;
- this.panlight.removeSelf();
- this.panlight.destroy();
- }
- if (this.showpan) {
- this.showpan.active = false;
- this.showpan.removeSelf();
- this.showpan.destroy();
- }
- if (this.panScence) {
- this.panScence.active = false;
- this.panScence.removeSelf();
- this.panScence.destroy();
- }
- EventManager.Off(EventType.UseSkin, this, this.ReFreshData);
- EventManager.Off(EventType.getmoney, this, this.ReFreshData);
- }
- GetSkinDatas(_skintype) {
- var skins = PlayerAccount.CurAccountData.m_skinDic.values;
- var gets = [];
- var locks = [];
- for (var i = 0; i < skins.length; i++) {
- var curskin = skins[i];
- if (curskin.skintype != _skintype)
- continue;
- if (curskin.curskinstate != skinstate.lock) {
- gets.push(curskin);
- }
- else {
- locks.push(curskin);
- }
- }
- return gets.concat(locks);
- }
- NewShow() {
- this.panScence = new Laya.Scene3D();
- this.addChild(this.panScence);
- this.panCamera = new Laya.Camera();
- this.panCamera.orthographic = true;
- this.panScence.addChild(this.panCamera);
- this.panCamera.transform.position = new Laya.Vector3(0, 10, 10);
- this.panCamera.viewport = new Laya.Viewport(0, 0, Laya.stage.width, Laya.stage.height);
- this.panCamera.clearFlag = 2;
- var screensize = Laya.stage.height / 1280;
- this.panCamera.orthographicVerticalSize = 20 * screensize;
- this.panlight = new Laya.DirectionLight();
- this.panScence.addChild(this.panlight);
- this.panlight.intensity = 0.6;
- this.showpan = new Laya.Sprite3D();
- this.panScence.addChild(this.showpan);
- var sfasf = this.patbg.localToGlobal(new Laya.Point(this.pt.x, this.pt.y));
- var viewpos = new Laya.Vector3(sfasf.x, sfasf.y, 0);
- var outworldpos = new Laya.Vector3();
- this.panCamera.convertScreenCoordToOrthographicCoord(viewpos, outworldpos);
- this.showpan.transform.position = new Laya.Vector3(outworldpos.x, outworldpos.y, 0);
- Laya.timer.frameLoop(1, this, this.RotLoop);
- this.skinlist.vScrollBarSkin = "";
- this.skinlist.renderHandler = Laya.Handler.create(this, this.OnRender, null, false);
- this.OnClickXGG();
- }
- RotLoop() {
- if (this.mainrole && this.mainrole.active) {
- this.showpan.transform.rotate(new Laya.Vector3(0, this.currotspeed, 0));
- }
- }
- OnClickClose() {
- GameUtils.TweenButton(this.homebtn, () => {
- WindowManager.Instance.ShowWindow(WindowType.HomeWindow);
- });
- }
- OnRender(_cell, index) {
- var data = _cell.dataSource;
- var icon = _cell.getChildAt(2);
- var selectim = _cell.getChildAt(1);
- selectim.visible = false;
- var getbtn = _cell.getChildAt(5);
- getbtn.visible = false;
- var getbtnbg = _cell.getChildAt(4);
- this.SetGetBtn(getbtnbg, data);
- getbtn.clickHandler = null;
- if (data.curskinstate == skinstate.getnoues) {
- getbtn.visible = true;
- getbtn.clickHandler = Laya.Handler.create(this, this.WearSkin, [data], false);
- }
- else if (data.curskinstate == skinstate.lock) {
- if (data.require_type == 2) {
- getbtn.visible = true;
- getbtn.clickHandler = Laya.Handler.create(this, this.MoneyGet, [data], false);
- }
- else if (data.require_type == 3) {
- getbtn.visible = true;
- getbtn.clickHandler = Laya.Handler.create(this, this.VideoGet, [data], false);
- }
- }
- icon.skin = "icon/" + data.skinicon + ".png";
- var showbtn = _cell.getChildAt(3);
- showbtn.clickHandler = Laya.Handler.create(this, this.ShowRole, [data, index], false);
- }
- SetGetBtn(_btn, _data) {
- var getuseing = _btn.getChildAt(1);
- getuseing.visible = _data.curskinstate == skinstate.useing;
- var getuse = _btn.getChildAt(2);
- getuse.visible = _data.curskinstate == skinstate.getnoues;
- var getvideo = _btn.getChildAt(3);
- getvideo.visible = false;
- var videoclip = getvideo.getChildAt(1);
- var getmoney = _btn.getChildAt(4);
- getmoney.visible = false;
- var moneyclip = getmoney.getChildAt(1);
- var getactiveity = _btn.getChildAt(5);
- getactiveity.visible = false;
- var getsign = _btn.getChildAt(6);
- getsign.visible = false;
- var getstage = _btn.getChildAt(7);
- getstage.visible = false;
- if (_data.curskinstate == skinstate.lock) {
- if (_data.require_type == 2) {
- getmoney.visible = true;
- moneyclip.text = _data.require_num.toString();
- }
- else if (_data.require_type == 3) {
- getvideo.visible = true;
- videoclip.text = this.GetProgress(_data.skinid) + "/" + _data.require_num;
- }
- else if (_data.require_type == 5) {
- getsign.visible = true;
- }
- else if (_data.require_type == 7) {
- getstage.visible = true;
- getstage.text = "通过第" + _data.require_num + "关";
- }
- else {
- getactiveity.visible = true;
- }
- }
- }
- ShowRole(_skin, _cellindex = 0) {
- for (var i = 0; i < this.skinlist.cells.length; i++) {
- var selected = this.skinlist.cells[i].getChildAt(1);
- selected.visible = i == _cellindex;
- }
- if (this.roomfangjianmaterial)
- this.roomfangjianmaterial.albedoTexture = null;
- if (!_skin || this.curskin == _skin) {
- return;
- }
- this.showpan.transform.rotationEuler = new Laya.Vector3(0, 0, 0);
- if (this.curskin != null && this.mainrole) {
- PoolManager.RecoverSprite3D(this.mainrole);
- }
- this.curskin = _skin;
- var asset;
- if (this.curskin.skintype == skintype.role) {
- var curid = this.curskin.skinid <= 6 ? this.curskin.skinid : this.curskin.skinid - 12;
- asset = AssetManager.role.getValue(curid);
- }
- else if (this.curskin.skintype == skintype.weapon) {
- asset = AssetManager.weapon.getValue(this.curskin.skinid - 6);
- }
- else {
- asset = AssetManager.tw.getValue(this.curskin.skinid - 24);
- }
- this.mainrole = PoolManager.GetSprite3D(asset);
- this.showpan.addChild(this.mainrole);
- this.mainrole.transform.localPosition = new Laya.Vector3(0, 0, 0);
- if (this.curskin.skintype != skintype.role) {
- this.mainrole.transform.setWorldLossyScale(new Laya.Vector3(2.5, 2.5, 2.5));
- }
- else {
- this.mainrole.transform.setWorldLossyScale(new Laya.Vector3(1.5, 1.5, 1.5));
- }
- if (_skin.skintype == skintype.tw) {
- this.mainrole.transform.localPositionX = 2;
- this.currotspeed = -0.1;
- }
- else {
- this.currotspeed = 0;
- }
- }
- GetProgress(_id) {
- var ccc = PlayerAccount.CurAccountData.GetUser(AccountUser.progress_themes);
- var progress = ccc[_id] ? ccc[_id] : 0;
- return progress;
- }
- MoneyGet(_skindata) {
- console.log("点击金币购买:" + _skindata.skinname, "1");
- var money = Number(PlayerAccount.CurAccountData.GetUser(AccountUser.money));
- if (money < _skindata.require_num) {
- TtSdk.showToast("金币不足!");
- return;
- }
- var key = PROTOCOLS.Buy;
- var agrs = [{ "id": _skindata.skinid.toString() }];
- NetworkManager.Instance.HttpPostRequest(key, agrs, Laya.Handler.create(this, () => {
- this.ReFreshData();
- console.log("点击金币购买成功:" + _skindata.skinname, "1");
- var reward = new rewarddata(_skindata.skinid + 6000);
- reward.type = 1;
- reward.rewardicon = _skindata.skinicon;
- reward.rewardname = _skindata.skinname;
- reward.rewardnum = 1;
- WindowManager.Instance.OpenPopView(WindowType.RewardWindow, reward);
- }), null);
- }
- VideoGet(_skindata) {
- console.log("商城界面:点击看视频获得皮肤->" + _skindata.skinname, "1");
- if (ADHelper.IsAndroid) {
- ADHelper.showVideoAd((flag) => {
- if (flag) {
- var getkey = PROTOCOLS.fission;
- var agrs = [{ "id": _skindata.skinid.toString() }, { "channel": "video" }, { "t": PlayerAccount.ServerTime.toString() }];
- NetworkManager.Instance.HttpPostRequest(getkey, agrs, Laya.Handler.create(this, () => {
- this.ReFreshData();
- console.log("点击看视频获得皮肤成功:" + _skindata.skinname, "1");
- var curskin = PlayerAccount.CurAccountData.m_skinDic.getValue(_skindata.skinid);
- if (curskin.curskinstate == skinstate.getnoues) {
- var reward = new rewarddata(_skindata.skinid + 6000);
- reward.type = 1;
- reward.rewardicon = _skindata.skinicon;
- reward.rewardname = _skindata.skinname;
- reward.rewardnum = 1;
- WindowManager.Instance.OpenPopView(WindowType.RewardWindow, reward);
- }
- }), Laya.Handler.create(this, () => { }));
- }
- });
- }
- else {
- var getkey = PROTOCOLS.fission;
- var agrs21 = [{ "id": _skindata.skinid.toString() }, { "channel": "video" }, { "t": PlayerAccount.ServerTime.toString() }];
- NetworkManager.Instance.HttpPostRequest(getkey, agrs21, Laya.Handler.create(this, () => {
- this.ReFreshData();
- var curskin = PlayerAccount.CurAccountData.m_skinDic.getValue(_skindata.skinid);
- if (curskin.curskinstate == skinstate.getnoues) {
- var reward = new rewarddata(_skindata.skinid + 6000);
- reward.type = 1;
- reward.rewardicon = _skindata.skinicon;
- reward.rewardname = _skindata.skinname;
- reward.rewardnum = 1;
- WindowManager.Instance.OpenPopView(WindowType.RewardWindow, reward);
- }
- }), Laya.Handler.create(this, () => { }));
- }
- }
- ReFreshData() {
- this.moneyclip.text = PlayerAccount.CurAccountData.GetUser(AccountUser.money);
- PlayerAccount.CurAccountData.UpdateSkinDic();
- this.skinlist.array = this.GetSkinDatas(this.curskintype);
- var equip = PlayerAccount.CurAccountData.GetUser(AccountUser.equip_themes)[this.curskintype];
- var curskin = PlayerAccount.CurAccountData.m_skinDic.getValue(equip);
- console.log(this.curskintype, equip, curskin);
- this.ShowRole(curskin);
- }
- WearSkin(_skin) {
- if (!this.canwear)
- return;
- this.canwear = false;
- console.log("wear:", _skin.skinid);
- var agrs = [{ "id": _skin.skinid.toString() }];
- NetworkManager.Instance.HttpPostRequest(PROTOCOLS.Equip, agrs, Laya.Handler.create(this, (e) => {
- this.ReFreshData();
- var equip = PlayerAccount.CurAccountData.GetUser(AccountUser.equip_themes)[this.curskintype];
- var curskin = PlayerAccount.CurAccountData.m_skinDic.getValue(equip);
- EventManager.Trigger(EventType.UseSkin, [_skin]);
- this.ShowRole(curskin);
- this.canwear = true;
- }), null);
- }
- ShowBoySkin() {
- this.curskintype = skintype.role;
- this.curskindatas = this.GetSkinDatas(skintype.role);
- this.skinlist.array = this.curskindatas;
- var equip = PlayerAccount.CurAccountData.GetUser(AccountUser.equip_themes)[this.curskintype];
- var equipskin = PlayerAccount.CurAccountData.m_skinDic.getValue(equip);
- this.ShowRole(equipskin);
- }
- ShowGirlSkin() {
- this.curskintype = skintype.weapon;
- this.curskindatas = this.GetSkinDatas(skintype.weapon);
- this.skinlist.array = this.curskindatas;
- var equip = PlayerAccount.CurAccountData.GetUser(AccountUser.equip_themes)[this.curskintype];
- var equipskin = PlayerAccount.CurAccountData.m_skinDic.getValue(equip);
- if (equipskin)
- this.ShowRole(equipskin);
- }
- ShowTwSkin() {
- this.curskintype = skintype.tw;
- this.curskindatas = this.GetSkinDatas(skintype.tw);
- this.skinlist.array = this.curskindatas;
- var equip = PlayerAccount.CurAccountData.GetUser(AccountUser.equip_themes)[this.curskintype];
- if (equip == undefined) {
- equip = 25;
- }
- var equipskin = PlayerAccount.CurAccountData.m_skinDic.getValue(equip);
- if (equipskin)
- this.ShowRole(equipskin);
- }
- }
- class TryoutWindow extends ui.Window.TryoutWindowUI {
- constructor() {
- super();
- this.lowskins = [];
- this.highskins = [];
- this.upskins = [];
- TryoutWindow.instance = this;
- }
- static get Instance() {
- return TryoutWindow.instance;
- }
- InitSize() {
- this.height = Laya.stage.height;
- Laya.stage.on(Laya.Event.RESIZE, this, () => { this.height = Laya.stage.height; });
- this.pan.y = Laya.stage.height / 1180 * this.pan.y;
- this.Btn.y = Laya.stage.height / 1280 * this.Btn.y;
- }
- OnOpen(_data = null) {
- this.InitSize();
- this.RegButton();
- this.GetSkinDatas();
- if (this.lowskins.length == 0 && this.highskins.length == 0) {
- this.OnClickClose();
- }
- else {
- TtSdk.Showbanner();
- TtSdk.RecordEvent("enterTry");
- this.upskins = this.GetUpdatas(this.lowskins);
- this.downskin = this.GetDowndatas();
- if (this.upskins.length == 0 && !this.downskin) {
- this.OnClickClose();
- return;
- }
- this.ShowUpSkins();
- this.ShowDownSkin();
- }
- }
- RegButton() {
- this.passbtn.clickHandler = Laya.Handler.create(this, this.OnClickClose, null, false);
- }
- OnHide() {
- }
- OnClickClose() {
- GameManager.Instance.RecordLevelStart();
- GameManager.Instance.ChangeGameState(GameState.Start);
- }
- OnClcikItem(_skin) {
- if (ADHelper.IsAndroid) {
- ADHelper.showVideoAd((flag) => {
- if (flag) {
- this.GetGetVideoAward(_skin);
- }
- });
- }
- else {
- this.GetGetVideoAward(_skin);
- }
- }
- GetGetVideoAward(_skin) {
- EventManager.Trigger(EventType.UseSkin, [_skin]);
- this.OnClickClose();
- }
- ShowUpSkins() {
- this.upskinpan.x += (3 - this.upskins.length) * 99;
- for (var i = 0; i < this.upskinpan.numChildren; i++) {
- var skinpan = this.upskinpan.getChildAt(i);
- if (i < this.upskins.length) {
- var varskin = this.upskins[i];
- var btn = skinpan.getChildAt(1);
- var name = skinpan.getChildAt(2);
- name.text = varskin.skinname;
- var icon = skinpan.getChildAt(3);
- icon.skin = "icon/" + varskin.skinicon + ".png";
- btn.clickHandler = Laya.Handler.create(this, this.OnClcikItem, [varskin], false);
- }
- else {
- skinpan.visible = false;
- }
- }
- }
- ShowDownSkin() {
- this.downskinpan.visible = this.downskin != null;
- if (this.downskinpan.visible) {
- var name = this.downskinpan.getChildAt(0).getChildAt(0);
- name.text = this.downskin.skinname;
- var icon = this.downskinpan.getChildAt(0).getChildAt(1);
- icon.skin = "icon/" + this.downskin.skinicon + ".png";
- this.tribtn2.clickHandler = Laya.Handler.create(this, this.OnClcikItem, [this.downskin], false);
- }
- }
- GetSkinDatas() {
- for (var i = 0; i < PlayerAccount.CurAccountData.m_skinDic.values.length; i++) {
- var skindata = PlayerAccount.CurAccountData.m_skinDic.values[i];
- if (skindata.curskinstate == skinstate.lock && skindata.skintype == skintype.weapon && skindata.require_type != 6) {
- if (skindata.quality == 1) {
- this.lowskins.push(skindata);
- }
- else {
- this.highskins.push(skindata);
- }
- }
- }
- }
- GetUpdatas(_skindatas) {
- var mskins = [];
- var randomindex1 = GameUtils.getRandomInt(0, _skindatas.length - 1);
- var randomskin1 = _skindatas[randomindex1];
- mskins.push(randomskin1);
- _skindatas.splice(randomindex1, 1);
- if (_skindatas.length > 0) {
- var randomindex2 = GameUtils.getRandomInt(0, _skindatas.length - 1);
- var randomskin2 = _skindatas[randomindex2];
- mskins.push(randomskin2);
- _skindatas.splice(randomindex2, 1);
- }
- if (_skindatas.length > 0) {
- var randomindex3 = GameUtils.getRandomInt(0, _skindatas.length - 1);
- var randomskin3 = _skindatas[randomindex3];
- mskins.push(randomskin3);
- _skindatas.splice(randomindex3, 1);
- }
- return mskins;
- }
- GetDowndatas() {
- var mskins;
- if (this.highskins.length > 0) {
- var randomindex1 = GameUtils.getRandomInt(0, this.highskins.length - 1);
- mskins = this.highskins[randomindex1];
- }
- else {
- if (this.lowskins.length > 0) {
- var randomindex3 = GameUtils.getRandomInt(0, this.lowskins.length - 1);
- mskins = this.lowskins[randomindex3];
- }
- }
- return mskins;
- }
- OnSignError(e) {
- console.log(e);
- }
- }
- var SignItemState;
- (function (SignItemState) {
- SignItemState[SignItemState["ready"] = 0] = "ready";
- SignItemState[SignItemState["videoready"] = 1] = "videoready";
- SignItemState[SignItemState["locking"] = 2] = "locking";
- SignItemState[SignItemState["complete"] = 3] = "complete";
- })(SignItemState || (SignItemState = {}));
- class RewardData {
- constructor(_id, _num) {
- this.rewardid = _id;
- this.rewardnum = _num;
- }
- }
- class SignItem {
- get RewardsData() {
- var rewardsdata = this.rewards.split(";");
- if (rewardsdata.length > 1) {
- return new RewardData(Number(6000), Number(1));
- }
- else {
- return new RewardData(Number(this.rewards), Number(this.rewardsNum));
- }
- }
- }
- class SignWindow extends ui.Window.SignWindowUI {
- constructor() {
- super();
- this.SignAwardDic = {};
- this.curSignItems = [];
- this.videoopen = true;
- SignWindow.instance = this;
- }
- static get Instance() {
- return SignWindow.instance;
- }
- OnOpen(_data = null) {
- this.pan.y = Laya.stage.height / 1280 * this.pan.y;
- this.Btn.y = Laya.stage.height / 1280 * this.Btn.y;
- this.curSignItems = this.SignItemsData;
- this.ReFreshSginList();
- this.signBtn.visible = SignWindow.canSgin;
- this.awardbtn.visible = SignWindow.canSgin;
- this.signBtn.clickHandler = Laya.Handler.create(this, this.OOPO, null, false);
- this.closebtn2.clickHandler = Laya.Handler.create(this, this.OnCloseClick);
- this.awardbtn.clickHandler = Laya.Handler.create(this, this.OnClickDouble, null, false);
- this.height = Laya.stage.height;
- this.videobtn.clickHandler = Laya.Handler.create(this, this.OnClcikVideo, null, false);
- TtSdk.Showbanner();
- this.videoopen = PlayerAccount.CurAccountData.videolock;
- this.videopoint.visible = this.videoopen;
- }
- OnCloseClick() {
- WindowManager.Instance.ShowWindow(WindowType.HomeWindow);
- }
- OnClcikVideo() {
- this.videoopen = !this.videoopen;
- this.videopoint.visible = this.videoopen;
- }
- get SignItemsData() {
- var SignItems = [];
- var config = PlayerAccount.CurAccountData.GetConfig(AccountConfig.sign);
- var signday = Number(PlayerAccount.CurAccountData.GetSign(signdata.sign_days));
- var signtime = Number(PlayerAccount.CurAccountData.GetSign(signdata.sign_time));
- var frist = signday < 7;
- var index = frist ? 0 : 7;
- for (var i = index; i < index + 7; i++) {
- this.SignAwardDic[config[i].id] = config[i].rewards;
- }
- for (var key in this.SignAwardDic) {
- var rewardid = this.SignAwardDic[key];
- var reward = PlayerAccount.CurAccountData.GetRewardConfig(rewardid);
- var signitem = new SignItem();
- signitem.desc = reward.group_name;
- signitem.icon = reward.icon;
- signitem.signId = Number(reward.id);
- signitem.rewards = reward.reward_item;
- signitem.rewardsNum = reward.reward_num;
- signitem.weight = reward.reward_weight;
- var daynum = Number(key);
- if (signday + 1 > daynum) {
- signitem.itemState = SignItemState.complete;
- }
- if (signday + 1 < daynum) {
- signitem.itemState = SignItemState.locking;
- }
- if (signday + 1 == daynum) {
- signitem.itemState = SignItemState.ready;
- }
- SignItems.push(signitem);
- }
- return SignItems;
- }
- static get canSgin() {
- let todayZero = new Date(PlayerAccount.ServerTime * 1000);
- todayZero.setHours(0, 0, 0, 0);
- var zeroTime = todayZero.valueOf();
- var signtime = Number(PlayerAccount.CurAccountData.GetSign(signdata.sign_time));
- var signTime = signtime * 1000;
- var can = signTime < zeroTime ? true : false;
- return can;
- }
- ReFreshSginList() {
- this.Btn.visible = SignWindow.canSgin;
- this.closebtn2.visible = !SignWindow.canSgin;
- for (var i = 0; i < this.signlist.numChildren; i++) {
- var sign = this.signlist.getChildAt(i);
- var data = this.curSignItems[i];
- var showbox;
- var showbox0 = sign.getChildAt(0);
- showbox0.visible = false;
- var showbox1 = sign.getChildAt(1);
- showbox1.visible = false;
- var showbox2 = sign.getChildAt(2);
- showbox2.visible = false;
- if (data.itemState == SignItemState.locking) {
- showbox = showbox0;
- }
- else if (data.itemState == SignItemState.ready) {
- showbox = showbox1;
- }
- else {
- showbox = showbox2;
- }
- showbox.visible = true;
- var awardtype = data.RewardsData.rewardid;
- if (awardtype == 1000) {
- var gold = showbox.getChildByName("gold");
- gold.visible = true;
- var clip = gold.getChildAt(1);
- clip.text = data.RewardsData.rewardnum.toString();
- }
- else {
- var car = showbox.getChildByName("car");
- car.visible = true;
- var skinid = awardtype % 6000;
- var caricon = "";
- if (PlayerAccount.CurAccountData.m_skinDic.containKey(skinid)) {
- caricon = PlayerAccount.CurAccountData.m_skinDic.getValue(skinid).skinicon;
- }
- var sprite = car.getChildAt(0);
- if (caricon)
- sprite.skin = "icon/" + caricon + ".png";
- }
- if (data.itemState == SignItemState.ready) {
- this.cursignitem = data;
- }
- }
- }
- OnClickDouble() {
- if (ADHelper.IsAndroid) {
- ADHelper.showVideoAd((flag) => {
- if (flag) {
- this.OnSign(true);
- }
- });
- }
- else {
- this.OnSign(true);
- }
- }
- OOPO() {
- if (this.videoopen) {
- this.OnClickDouble();
- }
- else {
- this.OnSign();
- }
- }
- OnSign(_double = false) {
- if (!SignWindow.canSgin)
- return;
- var curgold = Number(PlayerAccount.CurAccountData.GetUser(AccountUser.money));
- var curvideo = _double ? "0" : "0";
- let param = [{ "video": curvideo }];
- NetworkManager.Instance.HttpPostRequest(PROTOCOLS.Sign, param, Laya.Handler.create(this, (e) => {
- var reward = new rewarddata(this.cursignitem.RewardsData.rewardid);
- reward.type = reward.rewarditem > 1000 ? 1 : 0;
- if (reward.type == 0) {
- this.GetAward(_double, Number(this.cursignitem.rewardsNum), () => {
- this.OnCloseClick();
- });
- return;
- }
- else {
- var skinid = reward.rewarditem % 6000;
- var skin = PlayerAccount.CurAccountData.m_skinDic.getValue(skinid);
- if (skin) {
- reward.rewardicon = skin.skinicon;
- reward.rewardname = this.cursignitem.desc;
- reward.rewardnum = this.cursignitem.RewardsData.rewardnum;
- reward.rewarditem = this.cursignitem.RewardsData.rewardid;
- WindowManager.Instance.OpenPopView(WindowType.RewardWindow, reward);
- }
- }
- this.curSignItems = this.SignItemsData;
- SignWindow.Instance.ReFreshSginList();
- }), Laya.Handler.create(this, this.OnSignError), true);
- }
- OnSignError(e) {
- console.log(e);
- }
- OnHide() {
- }
- GetAward(double, _money, _complete) {
- var moneycount = _money;
- var showmoney = _money;
- if (double) {
- moneycount = _money * 2;
- showmoney = _money * 3;
- }
- let param = [{ "reward_item": "1000" }, { "reward_num": moneycount.toString() }, { "t": PlayerAccount.ServerTime.toString() }];
- NetworkManager.Instance.HttpPostRequest(PROTOCOLS.vd, param, Laya.Handler.create(this, (e) => {
- GameUtils.GetMoney(showmoney, null, Laya.Handler.create(this, () => {
- _complete();
- }));
- }), Laya.Handler.create(this, this.OnSignError), true);
- }
- }
- class drawitem {
- constructor(_id, _icon) {
- this.rewardid = _id;
- this.rewardicon = _icon;
- }
- }
- var rewardtype;
- (function (rewardtype) {
- rewardtype[rewardtype["role"] = 0] = "role";
- rewardtype[rewardtype["weapon"] = 1] = "weapon";
- rewardtype[rewardtype["money"] = 2] = "money";
- rewardtype[rewardtype["egg"] = 3] = "egg";
- })(rewardtype || (rewardtype = {}));
- class CheatWindow extends ui.Window.CheatWindowUI {
- constructor() {
- super();
- this.curooo = false;
- this.currewarddic = new Dictionary();
- this.clickcomplete = false;
- CheatWindow.instance = this;
- CheatWindow.instance.InitSize();
- }
- static get Instance() {
- return CheatWindow.instance;
- }
- InitSize() {
- this.height = Laya.stage.height;
- Laya.stage.on(Laya.Event.RESIZE, this, () => { this.height = Laya.stage.height; });
- this.pan.y = Laya.stage.height / 1280 * this.pan.y;
- this.Btn.y = Laya.stage.height / 1280 * this.Btn.y;
- }
- OnOpen(_ooo = true) {
- this.RegButton();
- this.curooo = _ooo;
- this.tippan.visible = _ooo;
- if (!_ooo)
- this.ani1.play(null, false);
- this.bg.visible = _ooo;
- this.currewarddic = new Dictionary();
- var rewards = PlayerAccount.CurAccountData.GetConfig(AccountConfig.lottery);
- for (var key in rewards) {
- var curconfig = rewards[key];
- var id = Number(key);
- var data = new drawitem(id, curconfig.icon);
- data.name = curconfig.name;
- data.reward_item = curconfig.reward_item;
- data.reward_num = curconfig.reward_num;
- data.weight = curconfig.weight;
- this.currewarddic.add(id + 1, data);
- }
- InputManager.caninput = false;
- this.clickcomplete = false;
- }
- RegButton() {
- this.clickbtn.clickHandler = Laya.Handler.create(this, this.OnClickChect, null, false);
- this.passbtn.clickHandler = Laya.Handler.create(this, this.OnPass, null, false);
- }
- OnClickChect() {
- if (this.clickcomplete)
- return;
- if (Laya.Browser.onPC) {
- this.OnGetGift();
- }
- else {
- ADHelper.showVideoAd((flag) => {
- if (flag) {
- this.OnGetGift();
- }
- });
- }
- }
- OnHide() {
- InputManager.caninput = true;
- }
- OnPass() {
- this.OnEnd();
- }
- OnGetGift() {
- var agrs = [{ "t": PlayerAccount.CurrentAccount.ServerTime.toString() }, { "channel": "video" }];
- NetworkManager.Instance.HttpPostRequest(PROTOCOLS.Lottery, agrs, Laya.Handler.create(this, (data) => {
- this.clickcomplete = true;
- var lottery_id = Number(data.lottery_id);
- var curdata = this.currewarddic.getValue(lottery_id);
- var reward = new rewarddata(curdata.reward_item);
- if (reward.rewarditem == 1000 || reward.rewarditem == 2000) {
- GameUtils.GetMoney(curdata.reward_num, null, Laya.Handler.create(this, () => {
- this.OnEnd();
- }));
- }
- else {
- reward.type = reward.rewarditem == 6000 ? rewardtype.role : rewardtype.weapon;
- reward.rewardicon = curdata.rewardicon;
- reward.rewardname = curdata.name;
- reward.rewardnum = curdata.reward_num;
- reward.rewarditem = curdata.reward_item;
- WindowManager.Instance.OpenPopView(WindowType.RewardWindow, reward);
- RewardWindow.Instance.closeback = () => {
- this.OnEnd();
- };
- }
- }), Laya.Handler.create(this, () => {
- TtSdk.showToast("领取失败");
- }));
- }
- OnEnd() {
- if (this.curooo == false) {
- WindowManager.Instance.ClosePopView(WindowType.CheatWindow);
- }
- else {
- GameManager.Instance.RessetGame();
- }
- }
- }
- class ShareVideoWindow extends ui.Window.ShareVideoWindowUI {
- constructor() {
- super();
- this.first = false;
- ShareVideoWindow.instance = this;
- }
- static get Instance() {
- return ShareVideoWindow.instance;
- }
- OnOpen(_data = null) {
- this.ani1.play(0, false);
- this.first = false;
- var firstsharemes = Laya.LocalStorage.getItem("firstshare");
- if (!firstsharemes) {
- this.first = true;
- this.firstreward = this.GetReward;
- this.icon.skin = "icon/" + this.firstreward.rewardicon + ".png";
- }
- this.firstshare.visible = this.first;
- this.sharetip.visible = !this.first;
- this.sharemoney.visible = !this.first;
- this.sharebtn.clickHandler = Laya.Handler.create(this, this.OnShareVideo, null, false);
- this.closebtn.clickHandler = Laya.Handler.create(this, this.OnClickClose, null, false);
- this.height = Laya.stage.height;
- Laya.stage.on(Laya.Event.RESIZE, this, () => { this.height = Laya.stage.height; });
- }
- OnHide() {
- }
- OnClickClose() {
- WindowManager.Instance.ClosePopView(WindowType.ShareVideoWindow);
- }
- OnShareVideo() {
- if (ADHelper.IsAndroid) {
- TtSdk.Instance.ShareVideo((flag) => {
- if (flag) {
- this.GetVideoReward();
- }
- });
- }
- else {
- this.GetVideoReward();
- }
- }
- GetVideoReward() {
- if (this.first) {
- this.GetSkinReward();
- }
- else {
- this.RewardShareGold();
- }
- }
- RewardShareGold() {
- let param = [{ "reward_item": "1000" }, { "reward_num": "100" }, { "t": PlayerAccount.ServerTime.toString() }];
- NetworkManager.Instance.HttpPostRequest(PROTOCOLS.vd, param, Laya.Handler.create(this, (e) => {
- GameUtils.GetMoney(100);
- this.OnClickClose();
- }), Laya.Handler.create(this, this.OnSignError), true);
- }
- OnSignError(e) {
- console.log(e);
- }
- GetSkinReward() {
- var reward_item = this.firstreward.rewarditem;
- let param = [{ "reward_item": reward_item.toString() }, { "reward_num": this.firstreward.rewardnum.toString() }, { "t": PlayerAccount.ServerTime.toString() }];
- NetworkManager.Instance.HttpPostRequest(PROTOCOLS.vd, param, Laya.Handler.create(this, (e) => {
- Laya.LocalStorage.setItem("firstshare", "1");
- if (this.firstreward.type == rewardtype.money) {
- GameUtils.GetMoney(this.firstreward.rewardnum, null, Laya.Handler.create(this, () => {
- this.OnClickClose();
- }));
- }
- else {
- this.OnClickClose();
- WindowManager.Instance.OpenPopView(WindowType.RewardWindow, this.firstreward);
- }
- }), Laya.Handler.create(this, this.OnSignError), true);
- }
- get GetReward() {
- var getskin = false;
- var rewardskin;
- var videoskins = [];
- var skins = PlayerAccount.CurAccountData.m_skinDic;
- for (var i = 0; i < skins.values.length; i++) {
- var skin = skins.values[i];
- if (skin.curskinstate == skinstate.lock && skin.require_type != 6) {
- videoskins.push(skin);
- }
- }
- if (videoskins.length > 0) {
- getskin = true;
- var random = GameUtils.getRandomInt(0, videoskins.length - 1);
- rewardskin = videoskins[random];
- }
- else {
- return null;
- }
- if (getskin) {
- var skinreward = new rewarddata(6000 + rewardskin.skinid);
- skinreward.rewardicon = rewardskin.skinicon;
- skinreward.rewardname = rewardskin.skinname;
- skinreward.rewardnum = 1;
- skinreward.type = rewardtype.role;
- return skinreward;
- }
- else {
- var goldreward = new rewarddata(1000);
- goldreward.rewardicon = "jb";
- goldreward.rewardname = "金币";
- goldreward.rewardnum = 100;
- goldreward.type = rewardtype.money;
- return goldreward;
- }
- }
- }
- class BaoXiangWindow extends ui.Window.BaoXiangWindowUI {
- constructor() {
- super();
- this.firstbx = false;
- BaoXiangWindow.instance = this;
- BaoXiangWindow.instance.InitSize();
- }
- static get Instance() {
- return BaoXiangWindow.instance;
- }
- InitSize() {
- this.height = Laya.stage.height;
- this.pan.y = Laya.stage.height / 1280 * this.pan.y;
- this.Btn.y = Laya.stage.height / 1280 * this.Btn.y;
- Laya.stage.on(Laya.Event.RESIZE, this, () => { this.height = Laya.stage.height; });
- }
- OnOpen(_data = null) {
- this.visible = false;
- Laya.timer.once(500, this, () => {
- this.visible = true;
- });
- this.RegButton();
- var sfsf = Laya.LocalStorage.getItem("firstbx");
- this.firstbg.visible = false;
- if (!sfsf) {
- this.firstbx = true;
- this.firstbg.visible = true;
- }
- this.curreward = this.GetReward;
- InputManager.Instance.OnTouchOut();
- InputManager.caninput = false;
- if (!this.curreward) {
- this.OnClickClose();
- return;
- }
- if (this.curreward.type != rewardtype.egg) {
- this.icon.skin = "icon/" + this.curreward.rewardicon + ".png";
- this.gettex.text = "开启宝箱";
- }
- else {
- this.icon.skin = "game/egg.png";
- this.gettex.text = "开启彩蛋";
- }
- var desc = this.curreward.type == rewardtype.money ? "金币+" + this.curreward.rewardnum : this.curreward.rewardname;
- this.skindesc.text = desc;
- TtSdk.Showbanner();
- }
- RegButton() {
- this.getbtn.clickHandler = Laya.Handler.create(this, this.GetSkinReward, null, false);
- this.passbtn.clickHandler = Laya.Handler.create(this, this.OnClickClose, null, false);
- }
- OnHide() {
- InputManager.caninput = true;
- }
- get GetReward() {
- var getskin = false;
- var rewardskin;
- var videoskins = [];
- var skins = PlayerAccount.CurAccountData.m_skinDic;
- for (var i = 0; i < skins.values.length; i++) {
- var skin = skins.values[i];
- if (skin.curskinstate == skinstate.lock) {
- videoskins.push(skin);
- }
- }
- if (videoskins.length > 0) {
- getskin = true;
- var random = GameUtils.getRandomInt(0, videoskins.length - 1);
- rewardskin = videoskins[random];
- }
- else {
- return null;
- }
- if (!this.firstbx && Math.random() > 0.35 && TaskManager.GetEgg) {
- var getegg = TaskManager.GetEgg(true);
- var skinreward = new rewarddata(getegg.id);
- skinreward.rewardnum = 1;
- skinreward.type = rewardtype.egg;
- skinreward.rewardname = "神秘彩蛋";
- return skinreward;
- }
- else {
- if (getskin && ((Math.random() > 0.4) || this.firstbx)) {
- var skinreward = new rewarddata(6000 + rewardskin.skinid);
- skinreward.rewardicon = rewardskin.skinicon;
- skinreward.rewardname = rewardskin.skinname;
- skinreward.rewardnum = 1;
- skinreward.type = rewardtype.role;
- return skinreward;
- }
- else {
- var goldreward = new rewarddata(1000);
- goldreward.rewardicon = "jb";
- goldreward.rewardname = "金币";
- goldreward.rewardnum = 100;
- goldreward.type = rewardtype.money;
- return goldreward;
- }
- }
- }
- GetSkinReward() {
- if (this.curreward.type == rewardtype.egg) {
- this.VideoGetEgg();
- }
- else {
- this.VideoGetSkin();
- }
- }
- VideoGetEgg() {
- if (Laya.Browser.onPC) {
- this.OnClickClose();
- var task = TaskManager.taskdic.getValue(this.curreward.rewarditem);
- WindowManager.Instance.OpenPopView(WindowType.TaskContentView, [task, false, false]);
- }
- else {
- ADHelper.showVideoAd((flag) => {
- if (flag) {
- this.OnClickClose();
- var task = TaskManager.taskdic.getValue(this.curreward.rewarditem);
- WindowManager.Instance.OpenPopView(WindowType.TaskContentView, [task, false, false]);
- }
- });
- }
- }
- VideoGetSkin() {
- if (Laya.Browser.onPC) {
- var reward_item = this.curreward.rewarditem;
- let param = [{ "reward_item": reward_item.toString() }, { "reward_num": this.curreward.rewardnum.toString() }, { "t": PlayerAccount.ServerTime.toString() }];
- NetworkManager.Instance.HttpPostRequest(PROTOCOLS.vd, param, Laya.Handler.create(this, (e) => {
- if (this.firstbx)
- Laya.LocalStorage.setItem("firstbx", "1");
- if (this.curreward.type == rewardtype.money) {
- GameUtils.GetMoney(this.curreward.rewardnum, null, Laya.Handler.create(this, () => {
- this.OnClickClose();
- }));
- }
- else {
- WindowManager.Instance.OpenPopView(WindowType.RewardWindow, this.curreward);
- WindowManager.Instance.ClosePopView(WindowType.BaoXiangWindow);
- }
- }), Laya.Handler.create(this, this.OnSignError), true);
- }
- else {
- ADHelper.showVideoAd((flag) => {
- if (flag) {
- var reward_item = this.curreward.rewarditem;
- let param = [{ "reward_item": reward_item.toString() }, { "reward_num": this.curreward.rewardnum.toString() }, { "t": PlayerAccount.ServerTime.toString() }];
- NetworkManager.Instance.HttpPostRequest(PROTOCOLS.vd, param, Laya.Handler.create(this, (e) => {
- if (this.firstbx)
- Laya.LocalStorage.setItem("firstbx", "1");
- if (this.curreward.type == rewardtype.money) {
- GameUtils.GetMoney(this.curreward.rewardnum, null, Laya.Handler.create(this, () => {
- this.OnClickClose();
- }));
- }
- else {
- WindowManager.Instance.OpenPopView(WindowType.RewardWindow, this.curreward);
- WindowManager.Instance.ClosePopView(WindowType.BaoXiangWindow);
- }
- }), Laya.Handler.create(this, this.OnSignError), true);
- }
- });
- }
- }
- OnSignError(e) {
- console.log(e);
- }
- OnClickClose() {
- WindowManager.Instance.ClosePopView(WindowType.BaoXiangWindow);
- Player.mainpalyer.SetWuDi(2000);
- }
- }
- class TaskWindow extends ui.Window.TaskWindowUI {
- constructor() {
- super();
- this.cddatas = [];
- this.completelevels = [];
- TaskWindow.instance = this;
- }
- static get Instance() {
- return TaskWindow.instance;
- }
- InitSize() {
- this.height = Laya.stage.height;
- this.homebtn.y = Laya.stage.height / 1280 * this.homebtn.y;
- this.listpan.top = Laya.stage.height / 1280 * this.listpan.top;
- Laya.stage.on(Laya.Event.RESIZE, this, () => { this.height = Laya.stage.height; });
- }
- OnOpen(_data = null) {
- this.InitSize();
- this.RegButton();
- this.RefreshCDList();
- }
- RegButton() {
- this.homebtn.clickHandler = Laya.Handler.create(this, this.OnBackHome, null, false);
- }
- OnHide() {
- }
- OnBackHome() {
- WindowManager.Instance.ShowWindow(WindowType.HomeWindow);
- }
- static get canshoweffview() {
- var mdatas = [];
- for (var i = 0; i < TaskManager.taskdic.values.length; i++) {
- var mfasa = TaskManager.taskdic.values[i];
- if (mfasa.find == 1) {
- mdatas.push(mfasa);
- }
- }
- return mdatas;
- }
- RefreshCDList() {
- this.cddatas = TaskWindow.canshoweffview;
- this.cdlist.vScrollBarSkin = "";
- this.cdlist.array = this.cddatas;
- this.cdlist.renderHandler = Laya.Handler.create(this, this.OnRender, null, false);
- this.completelevels = this.CheckEggComplete();
- if (this.completelevels.length > 0) {
- this.ShowCompleteTask();
- }
- }
- ShowCompleteTask() {
- var curtask = this.completelevels[0];
- WindowManager.Instance.OpenPopView(WindowType.TaskContentView, [curtask, true, false]);
- this.cddatas = TaskWindow.canshoweffview;
- this.cdlist.array = this.cddatas;
- }
- ReCompleteCheck(_task) {
- var index = this.completelevels.indexOf(_task);
- if (index != -1) {
- this.completelevels.splice(index, 1);
- }
- if (this.completelevels.length > 0) {
- this.ShowCompleteTask();
- }
- }
- CheckEggComplete() {
- var completes = [];
- var curlevel = LevelManager.Instance.curlevel;
- for (var i = 0; i < curlevel.leveltasks.length; i++) {
- var matsk = curlevel.leveltasks[i];
- if (matsk.id == 4 && matsk.state == 1) {
- var getskins = [];
- for (var k = 0; k < PlayerAccount.CurAccountData.m_skinDic.values.length; k++) {
- var mskin = PlayerAccount.CurAccountData.m_skinDic.values[k];
- if (mskin.curskinstate != skinstate.lock && mskin.skintype == skintype.weapon) {
- getskins.push(mskin);
- }
- }
- if (getskins.length >= 8) {
- completes.push(matsk);
- TaskManager.CompleteEgg(matsk);
- }
- }
- else if (matsk.id == 9 && matsk.state == 1) {
- var getskins = [];
- for (var j = 0; j < PlayerAccount.CurAccountData.m_skinDic.values.length; j++) {
- var mskin = PlayerAccount.CurAccountData.m_skinDic.values[j];
- if (mskin.curskinstate != skinstate.lock && mskin.skintype == skintype.role) {
- getskins.push(mskin);
- }
- }
- if (getskins.length >= 4) {
- completes.push(matsk);
- TaskManager.CompleteEgg(matsk);
- }
- }
- }
- return completes;
- }
- OnRender(_cell) {
- var taskdata = _cell.dataSource;
- var bg = _cell.getChildAt(0);
- var egg = bg.getChildAt(0);
- var desc = bg.getChildAt(1);
- desc.visible = false;
- var videobtn = bg.getChildAt(2);
- videobtn.visible = false;
- var readbtn = bg.getChildAt(3);
- readbtn.visible = false;
- var geted = _cell.getChildAt(1);
- geted.visible = false;
- var lockbg = _cell.getChildAt(2);
- lockbg.visible = false;
- if (taskdata.state == taskstate.lock) {
- egg.visible = true;
- lockbg.visible = true;
- videobtn.visible = true;
- videobtn.clickHandler = Laya.Handler.create(this, this.OnClickVideoGet, [taskdata], false);
- }
- else if (taskdata.state == taskstate.open) {
- egg.visible = true;
- lockbg.visible = false;
- readbtn.visible = true;
- readbtn.clickHandler = Laya.Handler.create(this, this.OnReadTask, [taskdata], false);
- }
- else if (taskdata.state == taskstate.complete) {
- desc.visible = true;
- desc.text = "兑换码:" + taskdata.cdk.toString();
- egg.alpha = 0.4;
- }
- else if (taskdata.state == taskstate.geted) {
- desc.visible = true;
- geted.visible = true;
- desc.text = "兑换码:" + taskdata.cdk.toString();
- egg.alpha = 0.4;
- }
- }
- OnReadTask(_data) {
- WindowManager.Instance.OpenPopView(WindowType.TaskContentView, [_data, false, false]);
- }
- OnClickVideoGet(_data) {
- if (_data.state == taskstate.lock) {
- if (Laya.Browser.onPC) {
- _data.state = taskstate.open;
- TaskManager.SetData(_data);
- this.RefreshCDList();
- }
- else {
- ADHelper.showVideoAd((flag) => {
- if (flag) {
- _data.state = taskstate.open;
- TaskManager.SetData(_data);
- this.RefreshCDList();
- }
- });
- }
- }
- }
- }
- class TaskContentView extends ui.Window.TaskContentViewUI {
- constructor() {
- super();
- this.settlement = false;
- TaskContentView.instance = this;
- TaskContentView.instance.InitSize();
- }
- static get Instance() {
- return TaskContentView.instance;
- }
- InitSize() {
- this.height = Laya.stage.height;
- this.mespan.y = Laya.stage.height / 1280 * this.mespan.y;
- Laya.stage.on(Laya.Event.RESIZE, this, () => { this.height = Laya.stage.height; });
- }
- OnOpen(_data = null) {
- InputManager.caninput = false;
- if (_data == null)
- this.OnClickClose();
- this.RegButton();
- this.taskdata = _data[0];
- this.complete = _data[1];
- this.settlement = _data[2];
- this.tips.visible = this.complete;
- this.cdktex.visible = this.complete;
- if (this.complete) {
- this.cdktex.text = "兑换码:" + this.taskdata.cdk;
- this.ani1.play(null, false);
- }
- TaskManager.OpenEgg(this.taskdata);
- LevelManager.Instance.curlevel.GetTask();
- this.title.text = this.taskdata.title;
- this.content.text = this.taskdata.content;
- }
- RegButton() {
- this.closemesview.clickHandler = Laya.Handler.create(this, this.OnClickClose, null, false);
- }
- OnHide() {
- InputManager.caninput = true;
- }
- OnClickClose() {
- WindowManager.Instance.ClosePopView(WindowType.TaskContentView);
- Player.mainpalyer.SetWuDi(2000);
- if (this.complete) {
- if (this.settlement) {
- GameManager.Instance.ReCompleteCheck(this.taskdata);
- }
- else {
- TaskWindow.Instance.ReCompleteCheck(this.taskdata);
- }
- }
- }
- OnShare() {
- TtSdk.Share();
- }
- }
- class CDKView extends ui.Window.CDKViewUI {
- constructor() {
- super();
- CDKView.instance = this;
- CDKView.instance.InitSize();
- }
- static get Instance() {
- return CDKView.instance;
- }
- InitSize() {
- this.height = Laya.stage.height;
- this.pan.y = Laya.stage.height / 1280 * this.pan.y;
- Laya.stage.on(Laya.Event.RESIZE, this, () => { this.height = Laya.stage.height; });
- }
- OnOpen(_data = null) {
- this.RegButton();
- this.inputtext.text = "";
- }
- RegButton() {
- this.closebtn.clickHandler = Laya.Handler.create(this, this.OnClickClose, null, false);
- this.backbtn.clickHandler = Laya.Handler.create(this, this.OnClickClose, null, false);
- this.getbtn.clickHandler = Laya.Handler.create(this, this.OnGetSkin, null, false);
- }
- OnHide() {
- }
- OnClickClose() {
- WindowManager.Instance.ClosePopView(WindowType.CDKView);
- }
- OnGetSkin() {
- console.log(this.inputtext.text);
- var targetcdk = Number(this.inputtext.text);
- var targetskin;
- var skins = PlayerAccount.CurAccountData.m_skinDic.values;
- for (var i = 0; i < skins.length; i++) {
- var curskin = skins[i];
- if (curskin.cdk == targetcdk) {
- targetskin = curskin;
- break;
- }
- }
- if (targetskin == null) {
- TtSdk.showToast("兑换码错误");
- }
- else {
- if (targetskin.curskinstate != skinstate.lock) {
- TtSdk.showToast("已兑换");
- }
- else {
- this.GetSkinAward(targetskin);
- }
- }
- }
- GetSkinAward(_skin) {
- if (_skin.curskinstate != skinstate.lock) {
- TaskManager.GeEgg(_skin.cdk);
- return;
- }
- var reward_item = _skin.skinid + 6000;
- let param = [{ "reward_item": reward_item.toString() }, { "reward_num": "1" }, { "t": PlayerAccount.ServerTime.toString() }];
- NetworkManager.Instance.HttpPostRequest(PROTOCOLS.vd, param, Laya.Handler.create(this, (e) => {
- TaskManager.GeEgg(_skin.cdk);
- WindowManager.Instance.ClosePopView(WindowType.CDKView);
- EventManager.Trigger(EventType.UseSkin);
- var reward = new rewarddata(reward_item);
- reward.type = 1;
- reward.rewardicon = _skin.skinicon;
- reward.rewardname = _skin.skinname;
- reward.rewardnum = 1;
- WindowManager.Instance.OpenPopView(WindowType.RewardWindow, reward);
- }), Laya.Handler.create(this, this.OnSignError), true);
- }
- OnSignError(e) {
- console.log(e);
- }
- }
- class ChestData {
- constructor() {
- this.cheststate = 0;
- this.canvideoopen = false;
- }
- get chesticon() {
- if (this.chesttype == 1000) {
- return "jb";
- }
- else {
- var skin = PlayerAccount.CurAccountData.m_skinDic.getValue(this.chestid);
- return skin.skinicon;
- }
- }
- }
- class ChestWindow extends ui.Window.ChestWindowUI {
- constructor() {
- super();
- this.chestdatas = [];
- this.keynum = 2;
- this.canhome = false;
- this.video = false;
- this.getkey = false;
- this.gamewin = false;
- ChestWindow.instance = this;
- }
- static get Instance() {
- return ChestWindow.instance;
- }
- InitList() {
- var datas = [];
- for (var i = 0; i < 9; i++) {
- var curchest = new ChestData();
- if (i > 5) {
- curchest.canvideoopen = true;
- }
- datas.push(curchest);
- }
- return datas;
- }
- EnterChest() {
- NetworkManager.Instance.HttpPostRequest(PROTOCOLS.entertreasure, null, new Laya.Handler(null, (_data) => {
- var targetChest = new ChestData();
- targetChest.chesttype = 6000;
- targetChest.chestid = _data.theme_id;
- this.InitChest(targetChest);
- }), new Laya.Handler(this, (_data) => {
- console.log("err" + _data);
- }));
- }
- InitChest(_chestdata) {
- this.targetChest = _chestdata;
- this.chestdatas = this.InitList();
- this.chestlist.array = this.chestdatas;
- this.chestlist.renderHandler = Laya.Handler.create(this, this.OnRender, null, false);
- this.getys.visible = false;
- this.getys.clickHandler = Laya.Handler.create(this, this.OnGetKey, null, false);
- this.homebtn.clickHandler = Laya.Handler.create(this, this.OnBackHome, null, false);
- this.RefreshChestDatas();
- }
- OnOpen(_win = false) {
- this.gamewin = _win;
- this.EnterChest();
- this.chestpan.y = Laya.stage.height / 1280 * this.chestpan.y;
- this.height = Laya.stage.height;
- Laya.stage.on(Laya.Event.RESIZE, this, () => { this.height = Laya.stage.height; });
- }
- OnHide() {
- }
- OnRender(_cell, _index) {
- var data = _cell.dataSource;
- var chest = _cell.getChildAt(1);
- chest.visible = data.cheststate == 0;
- var videobg = chest.getChildAt(0);
- videobg.visible = data.canvideoopen;
- var skin = _cell.getChildAt(2);
- skin.visible = data.cheststate == 1 && data.chesttype > 1000;
- if (skin.visible) {
- var icon = skin.getChildAt(0);
- icon.skin = "icon/" + data.chesticon + ".png";
- }
- var gold = _cell.getChildAt(3);
- gold.visible = data.cheststate == 1 && data.chesttype == 1000;
- if (gold.visible) {
- var mgold = gold.getChildAt(1);
- mgold.text = data.chestnum.toString();
- }
- var getbtn = _cell.getChildAt(4);
- if (data.cheststate == 0) {
- if (data.canvideoopen) {
- getbtn.clickHandler = Laya.Handler.create(this, this.VideoOpenTreasure, [false, _index], false);
- }
- else {
- getbtn.clickHandler = Laya.Handler.create(this, this.OpenTreasure, [false, true, _index], false);
- }
- }
- else {
- getbtn.clickHandler = null;
- }
- }
- OnBackHome() {
- GameManager.Instance.RessetGame();
- }
- SetChestData(_index, _data) {
- this.chestdatas[_index] = _data;
- this.RefreshChestDatas();
- }
- get getTarget() {
- for (var i = 0; i < this.chestdatas.length; i++) {
- var curdata = this.chestdatas[i];
- if (curdata.chesttype != 1000 && curdata.chestid == this.targetChest.chestid) {
- return true;
- }
- }
- return false;
- }
- RefreshChestDatas() {
- this.chestlist.array = this.chestdatas;
- this.chestlist.renderHandler = Laya.Handler.create(this, this.OnRender, null, false);
- this.key1.visible = this.keynum > 0;
- this.key2.visible = this.keynum > 1;
- this.key3.visible = this.keynum > 2;
- this.opspr.visible = this.keynum > 0;
- var allopen = true;
- for (var i = 0; i < this.chestdatas.length; i++) {
- if (this.chestdatas[i].cheststate == 0) {
- allopen = false;
- break;
- }
- }
- if (this.canhome == false && this.keynum == 0 || allopen) {
- this.canhome = true;
- }
- this.homebtn.visible = this.canhome;
- this.getys.visible = this.keynum == 0 && !allopen;
- if (this.getys.visible)
- this.getys.clickHandler = Laya.Handler.create(this, this.OnGetKey, null, false);
- }
- OnGetKey() {
- this.getkey = true;
- if (Laya.Browser.onPC) {
- this.keynum = 3;
- this.video = true;
- this.RefreshChestDatas();
- }
- else {
- ADHelper.showVideoAd((flag) => {
- if (flag) {
- this.keynum = 3;
- this.video = true;
- this.RefreshChestDatas();
- }
- });
- }
- }
- VideoOpenTreasure(_usekey, _index) {
- if (Laya.Browser.onPC) {
- this.OpenTreasure(true, _usekey, _index);
- }
- else {
- ADHelper.showVideoAd((flag) => {
- if (flag) {
- this.OpenTreasure(true, _usekey, _index);
- }
- });
- }
- }
- OpenTreasure(_video, _usekey, _index) {
- if (_usekey && this.keynum <= 0) {
- TtSdk.showToast("钥匙用完啦!");
- return;
- }
- if (!_video && _usekey && PlayerAccount.CurAccountData.videonum) {
- this.VideoOpenTreasure(true, _index);
- return;
- }
- var channel = _video && !this.video ? "key:treasure_open" : "video:treasure_open";
- var arges = [{ "t": PlayerAccount.CurrentAccount.ServerTime.toString() }, { "channel": channel }];
- NetworkManager.Instance.HttpPostRequest(PROTOCOLS.opentreasure, arges, new Laya.Handler(null, (_data) => {
- if (_usekey)
- this.keynum -= 1;
- var rewarditem = new ChestData();
- rewarditem.cheststate = 1;
- for (var key in _data.rewards) {
- var item = Number(key);
- if (item == 1000) {
- rewarditem.chesttype = 1000;
- rewarditem.chestnum = Number(_data.rewards[key]);
- }
- else {
- rewarditem.chesttype = 6000;
- rewarditem.chestid = item % 6000;
- }
- }
- this.SetChestData(_index, rewarditem);
- if (item > 1000) {
- var reward = new rewarddata(rewarditem.chestid);
- reward.type = rewardtype.role;
- var skin = PlayerAccount.CurAccountData.m_skinDic.getValue(rewarditem.chestid);
- reward.rewardicon = skin.skinicon;
- reward.rewardname = skin.skinname;
- reward.rewardnum = 1;
- WindowManager.Instance.OpenPopView(WindowType.RewardWindow, reward);
- }
- this.RefreshChestDatas();
- }), new Laya.Handler(this, (_data) => {
- console.log("err" + _data);
- }));
- }
- }
- class TaoZhuangWindow extends ui.Window.TaoZhuangWindowUI {
- constructor() {
- super();
- this.tzpre = 0;
- TaoZhuangWindow.instance = this;
- }
- static get Instance() {
- return TaoZhuangWindow.instance;
- }
- InitSize() {
- this.height = Laya.stage.height;
- Laya.stage.on(Laya.Event.RESIZE, this, () => { this.height = Laya.stage.height; });
- this.pan.y = Laya.stage.height / 1280 * this.pan.y;
- }
- OnOpen(_data = null) {
- this.InitSize();
- this.RegButton();
- this.GetAwardDatas();
- this.ShowPre();
- }
- RegButton() {
- this.getbtn.clickHandler = Laya.Handler.create(this, this.OnGetSkins, null, false);
- this.backbtn.clickHandler = Laya.Handler.create(this, this.OnBack, null, false);
- }
- OnHide() {
- }
- GetAwardDatas() {
- var roleskin = PlayerAccount.CurAccountData.m_skinDic.getValue(22);
- var weaponskin = PlayerAccount.CurAccountData.m_skinDic.getValue(17);
- var rolecan = roleskin && roleskin.curskinstate == skinstate.lock;
- var weaponcan = weaponskin && weaponskin.curskinstate == skinstate.lock;
- if (rolecan) {
- var roleaward = new rewarddata(roleskin.skinid + 6000);
- roleaward.rewardicon = roleskin.skinicon;
- roleaward.rewardname = roleskin.skinname;
- roleaward.type = rewardtype.role;
- roleaward.rewardnum = 1;
- this.roleaward = roleaward;
- }
- if (weaponcan) {
- var weaponaward = new rewarddata(weaponskin.skinid + 6000);
- weaponaward.rewardicon = weaponskin.skinicon;
- weaponaward.rewardname = weaponskin.skinname;
- weaponaward.type = rewardtype.weapon;
- weaponaward.rewardnum = 1;
- this.weaponaward = weaponaward;
- }
- }
- static canshow() {
- var roleskin = PlayerAccount.CurAccountData.m_skinDic.getValue(22);
- var weaponskin = PlayerAccount.CurAccountData.m_skinDic.getValue(17);
- var rolecan = roleskin && roleskin.curskinstate == skinstate.lock;
- var weaponcan = weaponskin && weaponskin.curskinstate == skinstate.lock;
- if (rolecan || weaponcan) {
- return true;
- }
- else {
- return false;
- }
- }
- ShowPre() {
- var curpre = TaoZhuangWindow.GetPre();
- var pre1p = this.pre1.getChildAt(0);
- pre1p.visible = curpre > 0;
- var pre2p = this.pre2.getChildAt(0);
- pre2p.visible = curpre > 1;
- var pre3p = this.pre3.getChildAt(0);
- pre3p.visible = curpre > 2;
- if (curpre >= 3) {
- this.getbtn.mouseEnabled = false;
- this.GetRole();
- }
- }
- OnGetSkins() {
- if (ADHelper.IsAndroid) {
- ADHelper.showVideoAd((flag) => {
- if (flag) {
- this.SetPre(1);
- this.ShowPre();
- }
- });
- }
- else {
- this.SetPre(1);
- this.ShowPre();
- }
- }
- SetPre(_num) {
- var tzpre = Laya.LocalStorage.getItem("tzpre");
- var mtz = 0;
- if (tzpre) {
- mtz = Number(tzpre) + _num;
- Laya.LocalStorage.setItem("tzpre", mtz.toString());
- }
- else {
- mtz = _num;
- Laya.LocalStorage.setItem("tzpre", _num.toString());
- }
- return mtz;
- }
- static GetPre() {
- var tzpre = Laya.LocalStorage.getItem("tzpre");
- if (tzpre) {
- return Number(tzpre);
- }
- else {
- return 0;
- }
- }
- GetRole() {
- var roleskin = PlayerAccount.CurAccountData.m_skinDic.getValue(22);
- var rolecan = roleskin && roleskin.curskinstate == skinstate.lock;
- if (rolecan) {
- this.GetAward(this.roleaward, () => {
- this.GetWeapon();
- });
- }
- else {
- this.GetWeapon();
- }
- }
- GetWeapon() {
- var weaponskin = PlayerAccount.CurAccountData.m_skinDic.getValue(17);
- var weaponcan = weaponskin && weaponskin.curskinstate == skinstate.lock;
- if (weaponcan) {
- this.GetAward(this.weaponaward, () => {
- this.OnBack();
- });
- }
- else {
- this.OnBack();
- }
- }
- GetAward(_reward, cb) {
- var reward_item = _reward.rewarditem;
- let param = [{ "reward_item": reward_item.toString() }, { "reward_num": _reward.rewardnum.toString() }, { "t": PlayerAccount.ServerTime.toString() }];
- NetworkManager.Instance.HttpPostRequest(PROTOCOLS.vd, param, Laya.Handler.create(this, (e) => {
- WindowManager.Instance.OpenPopView(WindowType.RewardWindow, _reward);
- RewardWindow.Instance.closeback = () => {
- cb();
- };
- }), Laya.Handler.create(this, this.OnSignError), true);
- }
- OnSignError(e) {
- console.log(e);
- }
- OnBack() {
- WindowManager.Instance.ShowWindow(WindowType.HomeWindow);
- }
- }
- var WindowType;
- (function (WindowType) {
- WindowType[WindowType["HomeWindow"] = 0] = "HomeWindow";
- WindowType[WindowType["InGameWindow"] = 1] = "InGameWindow";
- WindowType[WindowType["ChestWindow"] = 2] = "ChestWindow";
- WindowType[WindowType["TaoZhuangWindow"] = 3] = "TaoZhuangWindow";
- WindowType[WindowType["BaoXiangWindow"] = 4] = "BaoXiangWindow";
- WindowType[WindowType["CDKView"] = 5] = "CDKView";
- WindowType[WindowType["TaskContentView"] = 6] = "TaskContentView";
- WindowType[WindowType["TaskWindow"] = 7] = "TaskWindow";
- WindowType[WindowType["CheatWindow"] = 8] = "CheatWindow";
- WindowType[WindowType["SettlementWindow"] = 9] = "SettlementWindow";
- WindowType[WindowType["SkinWindow"] = 10] = "SkinWindow";
- WindowType[WindowType["ResurrectionWindow"] = 11] = "ResurrectionWindow";
- WindowType[WindowType["PlaneGiftWindow"] = 12] = "PlaneGiftWindow";
- WindowType[WindowType["SignWindow"] = 13] = "SignWindow";
- WindowType[WindowType["LotteryWindow"] = 14] = "LotteryWindow";
- WindowType[WindowType["TryOutWindow"] = 15] = "TryOutWindow";
- WindowType[WindowType["RewardWindow"] = 16] = "RewardWindow";
- WindowType[WindowType["ShareVideoWindow"] = 17] = "ShareVideoWindow";
- })(WindowType || (WindowType = {}));
- class WindowManager {
- constructor() {
- this.ViewDic = [];
- this.popViewDic = [];
- this.viewCont = new Laya.Sprite;
- this.popCont = new Laya.Sprite;
- WindowManager.WindowManagerInstance = this;
- this.Init();
- }
- static get Instance() {
- if (WindowManager.WindowManagerInstance) {
- return WindowManager.WindowManagerInstance;
- }
- else {
- return new WindowManager();
- }
- }
- Init() {
- this.ViewDic[WindowType.HomeWindow] = HomeWindow;
- this.ViewDic[WindowType.InGameWindow] = InGameWindow;
- this.ViewDic[WindowType.SettlementWindow] = SettlementWindow;
- this.ViewDic[WindowType.ResurrectionWindow] = ReviveWindow;
- this.ViewDic[WindowType.SkinWindow] = SkinWindow;
- this.ViewDic[WindowType.RewardWindow] = RewardWindow;
- this.ViewDic[WindowType.TryOutWindow] = TryoutWindow;
- this.ViewDic[WindowType.SignWindow] = SignWindow;
- this.ViewDic[WindowType.ShareVideoWindow] = ShareVideoWindow;
- this.ViewDic[WindowType.CheatWindow] = CheatWindow;
- this.ViewDic[WindowType.BaoXiangWindow] = BaoXiangWindow;
- this.ViewDic[WindowType.TaskWindow] = TaskWindow;
- this.ViewDic[WindowType.TaskContentView] = TaskContentView;
- this.ViewDic[WindowType.CDKView] = CDKView;
- this.ViewDic[WindowType.ChestWindow] = ChestWindow;
- this.ViewDic[WindowType.TaoZhuangWindow] = TaoZhuangWindow;
- Laya.stage.addChild(this.viewCont);
- Laya.stage.addChild(this.popCont);
- }
- ShowWindow(_type, _data = null) {
- if (this.curOpenedView != null) {
- this.curOpenedView.OnHide();
- this.curOpenedView.destroy();
- this.curOpenedView.removeSelf();
- }
- TtSdk.Clear();
- this.ClearPopViews();
- console.log(WindowType[_type]);
- this.curOpenedView = new this.ViewDic[_type];
- this.curOpenedView.name = WindowType[_type];
- this.viewCont.addChild(this.curOpenedView);
- this.curOpenedView.OnOpen(_data);
- }
- OpenPopView(viewType, data = null) {
- var popView;
- if (this.popViewDic[viewType]) {
- popView = this.popViewDic[viewType];
- if (popView.visible)
- return;
- this.popCont.setChildIndex(popView, this.popCont.numChildren - 1);
- popView.visible = true;
- }
- else {
- popView = new this.ViewDic[viewType];
- this.popCont.addChild(popView);
- this.popViewDic[viewType] = popView;
- }
- TtSdk.Clear();
- popView.OnOpen(data);
- }
- ClosePopView(viewType) {
- var popView = this.popViewDic[viewType];
- if (popView == null || !popView.visible)
- return;
- popView.OnHide();
- TtSdk.Clear();
- popView.visible = false;
- }
- CloseCurrentWindow() {
- this.curOpenedView.OnHide();
- this.curOpenedView.destroy();
- this.curOpenedView.removeSelf();
- }
- ClearPopViews() {
- this.ClosePopView(WindowType.PlaneGiftWindow);
- this.ClosePopView(WindowType.ShareVideoWindow);
- }
- }
- var Vector3$f = Laya.Vector3;
- class Barrier extends Building {
- constructor() {
- super(...arguments);
- this.cut = false;
- }
- OnInit() {
- if (this.mdata.buildid != 7) {
- this.mcollider = this.cursprite.getChildAt(2).getComponent(Laya.PhysicsCollider);
- this.mcollider.collisionGroup = ColliderLay.obstacle;
- this.mcollider.enabled = true;
- this.downsprite = this.cursprite.getChildAt(0);
- this.upsprite = this.cursprite.getChildAt(1);
- }
- else {
- this.mcollider = this.cursprite.getChildAt(1).getComponent(Laya.PhysicsCollider);
- this.mcollider.collisionGroup = ColliderLay.obstacle;
- this.mcollider1 = this.cursprite.getChildAt(2).getComponent(Laya.PhysicsCollider);
- this.mcollider1.collisionGroup = ColliderLay.obstacle;
- this.mcollider1.enabled = true;
- this.downsprite = this.cursprite.getChildAt(1);
- this.downsprite1 = this.cursprite.getChildAt(2);
- this.upsprite = this.cursprite.getChildAt(0);
- this.mcollider.enabled = true;
- }
- if (this.mdata.buildid == 6) {
- this.mcollider.collisionGroup = ColliderLay.grass;
- }
- for (var i = 0; i < this.cursprite.numChildren; i++) {
- var curspr = this.cursprite.getChildAt(i);
- curspr.active = true;
- }
- this.OnReg();
- }
- OnReg() {
- EventManager.On(EventType.Cut, this, this.OnCut);
- }
- OnClear() {
- EventManager.Off(EventType.Cut, this, this.OnCut);
- if (this.uprig)
- this.uprig.Clear();
- if (this.downrig)
- this.downrig.Clear();
- if (this.copysprite) {
- for (var i = 0; i < this.copysprite.numChildren; i++) {
- var curspr = this.copysprite.getChildAt(i);
- curspr.active = true;
- }
- PoolManager.RecoverSprite3D(this.copysprite, true);
- }
- if (this.cuteffect)
- PoolManager.RecoverSprite3D(this.cuteffect);
- }
- OnCut(_collider) {
- if (this.cut)
- return;
- if (this.mcollider == _collider || (this.mcollider1 && this.mcollider1 == _collider)) {
- this.BeCut(_collider);
- }
- }
- BeCut(_collider) {
- if (this.cut)
- return;
- this.cut = true;
- this.die = true;
- this.mcollider.enabled = false;
- TtSdk.Shake();
- if (this.mdata.buildid == 4) {
- var boomrange = 5;
- var boomcount = 0;
- for (var i = 0; i < LevelManager.Instance.curlevel.gameroles.length; i++) {
- var currole = LevelManager.Instance.curlevel.gameroles[i];
- if (currole == Player.mainpalyer)
- continue;
- var dis = Vector3$f.distance(this.cursprite.transform.position, currole.cursprite.transform.position);
- if (dis < boomrange) {
- currole.BeBoom();
- boomcount++;
- }
- if (boomcount > 2) {
- LevelManager.Instance.curlevel.allboomree = true;
- }
- }
- for (var i = 0; i < LevelManager.Instance.curlevel.builds.length; i++) {
- var curbuild = LevelManager.Instance.curlevel.builds[i];
- if (curbuild == this)
- continue;
- var dis = Vector3$f.distance(this.cursprite.transform.position, curbuild.cursprite.transform.position);
- if (dis < boomrange) {
- if (curbuild.mdata.type == 0) {
- var curbarr = curbuild;
- if (!curbarr.cut)
- curbarr.BeCut(null);
- }
- else if (curbuild.mdata.type == 1) {
- var curstand = curbuild;
- curstand.BeCut();
- }
- }
- }
- }
- var cuteffid = 4;
- if (this.mdata.buildid == 4) {
- cuteffid = 2;
- AudioControl.PlayVoice(VoiceType.boom);
- }
- else if (this.mdata.buildid == 2) {
- cuteffid = 5;
- AudioControl.PlayVoice(VoiceType.cut);
- }
- else if (this.mdata.buildid == 6) {
- AudioControl.PlayVoice(VoiceType.cutgrass);
- }
- else {
- AudioControl.PlayVoice(VoiceType.cut);
- }
- if (this.mdata.buildid == 8) {
- WindowManager.Instance.OpenPopView(WindowType.BaoXiangWindow);
- }
- var cutasset = AssetManager.effect.getValue(cuteffid);
- this.cuteffect = PoolManager.GetSprite3D(cutasset);
- SceneManager.mainscene.addChild(this.cuteffect);
- if (this.mdata.buildid != 2) {
- this.cuteffect.transform.position = this.upsprite.transform.position.clone();
- }
- else {
- this.cuteffect.transform.position = this.cursprite.transform.position.clone();
- }
- this.copysprite = PoolManager.GetSprite3D(AssetManager.BuildAsset(buildtype.barrier, this.mdata.buildid));
- SceneManager.mainscene.addChild(this.copysprite);
- this.copysprite.transform.position = this.cursprite.transform.position.clone();
- this.copysprite.transform.rotationEuler = this.cursprite.transform.rotationEuler.clone();
- if (this.mdata.buildid == 7) {
- var up = this.copysprite.getChildAt(0);
- up.active = false;
- var ccid = _collider == this.mcollider1 ? 1 : 2;
- var gas = this.copysprite.getChildAt(ccid);
- gas.active = false;
- }
- else {
- var dieupsprite = this.copysprite.getChildAt(1);
- dieupsprite.active = false;
- var diedownspr = this.copysprite.getChildAt(0);
- diedownspr.active = true;
- var downrig = new RigObj(this.copysprite, null, 1, 1.2);
- downrig.minhight = 0;
- var downforce = this.mdata.buildid == 6 ? 0 : 0.5;
- downrig.AddForce(new Laya.Vector3(0, 1, downforce), 0.3);
- var sffcollider = this.copysprite.getChildAt(2).getComponent(Laya.PhysicsCollider);
- sffcollider.enabled = false;
- }
- if (_collider != null && _collider == this.mcollider1) {
- this.downsprite1.active = false;
- }
- else {
- this.downsprite.active = false;
- }
- this.uprig = new RigObj(this.cursprite, () => {
- if (downrig)
- downrig.Clear();
- this.copysprite.active = false;
- this.cursprite.active = false;
- }, 1.5, 1.5);
- this.uprig.minhight = 1;
- this.uprig.AddForce(new Laya.Vector3(0, 1, 0.4), 1);
- }
- }
- class StandBuild extends Building {
- constructor() {
- super(...arguments);
- this.cut = false;
- }
- OnInit() {
- this.mcollider = this.cursprite.getChildAt(2).getComponent(Laya.PhysicsCollider);
- this.mcollider.collisionGroup = ColliderLay.obstacle;
- this.downsprite = this.cursprite.getChildAt(0);
- this.upsprite = this.cursprite.getChildAt(1);
- this.standnode = this.cursprite.getChildAt(3);
- var standpos = this.standnode.transform.position.clone();
- var pos = new Laya.Vector4(standpos.x, standpos.y, standpos.z, this.standnode.transform.rotationEuler.y);
- var shooterdata = new MonsterData(this.mdata.monsterid, pos);
- shooterdata.boos = this.mdata.boos;
- this.mshooter = Shooter.Create(shooterdata);
- this.mshooter.SkinShow(1, 6);
- this.OnReg();
- }
- OnReg() {
- EventManager.On(EventType.Cut, this, this.OnCut);
- if (this.uprig)
- this.uprig.Clear();
- if (this.downrig)
- this.downrig.Clear();
- if (this.copysprite)
- PoolManager.RecoverSprite3D(this.copysprite);
- }
- OnClear() {
- EventManager.Off(EventType.Cut, this, this.OnCut);
- if (this.copysprite)
- this.copysprite.destroy();
- if (!this.cut)
- this.mshooter.Clear();
- if (this.cuteffect)
- PoolManager.RecoverSprite3D(this.cuteffect);
- }
- OnCut(_collider) {
- if (this.mcollider != _collider || this.cut)
- return;
- this.BeCut();
- LevelManager.Instance.curlevel.gameroles.push(this.mshooter);
- this.mshooter.FallLand(this.cursprite.transform.position.y);
- }
- BeCut() {
- this.cut = true;
- TtSdk.Shake();
- AudioControl.PlayVoice(VoiceType.cut);
- var cutasset = AssetManager.effect.getValue(4);
- this.cuteffect = PoolManager.GetSprite3D(cutasset);
- SceneManager.mainscene.addChild(this.cuteffect);
- this.cuteffect.transform.position = this.upsprite.transform.position.clone();
- this.copysprite = PoolManager.GetSprite3D(AssetManager.BuildAsset(buildtype.stand, this.mdata.buildid));
- SceneManager.mainscene.addChild(this.copysprite);
- this.copysprite.transform.position = this.cursprite.transform.position.clone();
- this.copysprite.transform.rotationEuler = this.cursprite.transform.rotationEuler.clone();
- var dieupsprite = this.copysprite.getChildAt(1);
- dieupsprite.active = false;
- this.downrig = new RigObj(this.copysprite, null, 1);
- this.downrig.minhight = 1;
- this.downrig.AddForce(new Laya.Vector3(0, 1, 0.1), 0.5);
- this.downsprite.active = false;
- this.uprig = new RigObj(this.cursprite, () => {
- this.Clear();
- }, 1.5, 1.5);
- this.uprig.minhight = 1;
- this.uprig.AddForce(new Laya.Vector3(0, 1, 0.4), 0.5);
- }
- }
- class GameManager {
- constructor() {
- this.curgamestate = GameState.None;
- this.play_id = 0;
- this.gamecount = 0;
- this.goldnum = 0;
- this.begin = false;
- this.completelevels = [];
- GameManager.instance = this;
- console.log("游戏初始化...");
- this.GameInit();
- }
- static get Instance() {
- return GameManager.instance;
- }
- static GetBuild(data) {
- var mbuild = new GameManager.builddic[data.type];
- mbuild.Init(data);
- mbuild.clear = false;
- return mbuild;
- }
- GameInit() {
- GameManager.builddic[buildtype.barrier] = Barrier;
- GameManager.builddic[buildtype.stand] = StandBuild;
- GameManager.builddic[buildtype.road] = Barrier;
- new TaskManager();
- new MonsterDataManager();
- new LevelManager();
- new InputManager();
- this.RegEvent();
- this.ChangeGameState(GameState.Ready);
- }
- RegEvent() {
- EventManager.GameOn(GameState.Ready, this, this.GameReady);
- EventManager.GameOn(GameState.Idle, this, this.GameIdle);
- EventManager.GameOn(GameState.Start, this, this.OnGameStart);
- EventManager.GameOn(GameState.Playing, this, this.GamePlaying);
- EventManager.GameOn(GameState.Die, this, this.GameDie);
- EventManager.GameOn(GameState.Lose, this, this.GameLose);
- EventManager.GameOn(GameState.Win, this, this.GameWin);
- EventManager.GameOn(GameState.Over, this, this.GameOver);
- EventManager.On(EventType.GameIdle, this, this.OnGameIdle);
- }
- ChangeGameState(_state, args = null) {
- if (_state == this.curgamestate)
- return;
- this.curgamestate = _state;
- console.log("GameState:", GameState[_state]);
- EventManager.GameTrigger(_state, args);
- }
- OnGameIdle() {
- this.ChangeGameState(GameState.Idle);
- }
- GameIdle() {
- }
- GameReady() {
- LevelManager.Instance.ReadyLevel();
- WindowManager.Instance.ShowWindow(WindowType.HomeWindow);
- this.ChangeGameState(GameState.Idle);
- this.begin = false;
- if (HomeWindow.sign && GameManager.Instance.gamecount > 0 && SignWindow.canSgin) {
- HomeWindow.sign = false;
- WindowManager.Instance.ShowWindow(WindowType.SignWindow);
- return;
- }
- var skin = !HomeWindow.sign || !SignWindow.canSgin;
- if (skin && HomeWindow.skin && GameManager.Instance.gamecount > 0) {
- HomeWindow.skin = false;
- WindowManager.Instance.ShowWindow(WindowType.SkinWindow);
- return;
- }
- if (GameManager.Instance.gamecount > 1 && GameManager.Instance.gamecount % 3 == 0 && TaoZhuangWindow.canshow) {
- WindowManager.Instance.ShowWindow(WindowType.TaoZhuangWindow);
- }
- }
- BeginGame() {
- if (this.curgamestate == GameState.Idle && !this.begin) {
- this.begin = true;
- var agrs = [{ "t": PlayerAccount.CurrentAccount.ServerTime.toString() }];
- NetworkManager.Instance.HttpPostRequest(PROTOCOLS.game, agrs, new Laya.Handler(null, (_data) => {
- GameManager.Instance.play_id = _data.play_id;
- this.OnGameBegin();
- }), new Laya.Handler(this, (_data) => {
- this.begin = false;
- console.log("err" + _data);
- }));
- }
- }
- OnGameBegin() {
- TtSdk.Instance.RecordStart();
- if (LevelManager.Instance.curlevel.leveldata.missiondata.trial) {
- WindowManager.Instance.ShowWindow(WindowType.TryOutWindow);
- }
- else {
- this.RecordLevelStart();
- this.ChangeGameState(GameState.Start);
- }
- }
- OnGameStart() {
- this.curlevel = LevelManager.Instance.curlevel;
- this.gamecount++;
- this.goldnum = 0;
- console.log("打开游戏中界面...");
- this.ChangeGameState(GameState.Playing);
- }
- GamePlaying() {
- AudioControl.PlayBgm(BgmType.bgm);
- WindowManager.Instance.ShowWindow(WindowType.InGameWindow);
- }
- GameDie() {
- WindowManager.Instance.ClearPopViews();
- this.ChangeGameState(GameState.Lose);
- }
- GameLose() {
- this.curwin = false;
- console.log("打开结算界面(游戏失败)");
- WindowManager.Instance.ShowWindow(WindowType.ResurrectionWindow);
- this.RecropLevelEnd(false);
- }
- GameWin() {
- this.curwin = true;
- console.log("打开结算界面(游戏胜利)");
- GameManager.alllose = 0;
- this.CheckComplete(true);
- this.RecropLevelEnd(true);
- LevelManager.teststage++;
- }
- CheckComplete(_win) {
- this.completelevels = this.CheckLevelTask();
- if (this.completelevels.length == 0) {
- WindowManager.Instance.ShowWindow(WindowType.SettlementWindow, _win);
- }
- else {
- this.ShowCompleteTask();
- }
- }
- ShowCompleteTask() {
- var curtask = this.completelevels[0];
- WindowManager.Instance.OpenPopView(WindowType.TaskContentView, [curtask, true, true]);
- }
- ReCompleteCheck(_task) {
- var index = this.completelevels.indexOf(_task);
- if (index != -1) {
- this.completelevels.splice(index, 1);
- }
- if (this.completelevels.length > 0) {
- this.ShowCompleteTask();
- }
- else {
- WindowManager.Instance.ShowWindow(WindowType.SettlementWindow, true);
- }
- }
- GameOver(_win) {
- AudioControl.ClearAudio();
- if (_win) {
- WindowManager.Instance.ShowWindow(WindowType.ChestWindow, true);
- }
- else {
- this.RessetGame();
- }
- }
- RessetGame() {
- if (this.curlevel)
- this.curlevel.Clear();
- this.ChangeGameState(GameState.Ready);
- }
- RecordLevelStart() {
- if (!Laya.Browser.onWeiXin)
- return;
- this.curlevel = LevelManager.Instance.curlevel;
- var stageid = this.curlevel.levelid.toString();
- var stagename = this.curlevel.levelname;
- var useid = PlayerAccount.CurAccountData.UseId;
- }
- RecropLevelEnd(_win) {
- if (!Laya.Browser.onWeiXin)
- return;
- var stageid = this.curlevel.levelid.toString();
- var useid = PlayerAccount.CurAccountData.UseId;
- var stagename = LevelManager.Instance.curlevel.levelname;
- if (_win) ;
- else {
- var equipid = PlayerAccount.CurAccountData.GetUser(AccountUser.equip_themes)[1];
- }
- }
- CheckLevelTask() {
- var completelevel = [];
- for (var i = 0; i < this.curlevel.leveltasks.length; i++) {
- var matsk = this.curlevel.leveltasks[i];
- if (matsk.id == 1 && matsk.state == 1) {
- if (this.curlevel.allccclear) {
- completelevel.push(matsk);
- TaskManager.CompleteEgg(matsk);
- }
- }
- else if (matsk.id == 2 && matsk.state == 1) {
- if (this.curlevel.alllenemynoneclear && this.curwin) {
- completelevel.push(matsk);
- TaskManager.CompleteEgg(matsk);
- }
- }
- else if (matsk.id == 3 && matsk.state == 1) {
- if (Player.mainpalyer.allfall) {
- completelevel.push(matsk);
- TaskManager.CompleteEgg(matsk);
- }
- }
- else if (matsk.id == 4 && matsk.state == 1) {
- var getskins = [];
- for (var j = 0; j < PlayerAccount.CurAccountData.m_skinDic.values.length; j++) {
- var mskin = PlayerAccount.CurAccountData.m_skinDic.values[j];
- if (mskin.curskinstate != skinstate.lock && mskin.skintype == skintype.weapon) {
- getskins.push(mskin);
- }
- }
- if (getskins.length >= 8) {
- completelevel.push(matsk);
- TaskManager.CompleteEgg(matsk);
- }
- }
- else if (matsk.id == 5 && matsk.state == 1) {
- if (GameManager.alllose > 2) {
- completelevel.push(matsk);
- TaskManager.CompleteEgg(matsk);
- }
- }
- else if (matsk.id == 6 && matsk.state == 1) {
- if (this.curlevel.allboomree) {
- completelevel.push(matsk);
- TaskManager.CompleteEgg(matsk);
- }
- }
- else if (matsk.id == 7 && matsk.state == 1) {
- if (Player.mainpalyer.allstand && this.curwin) {
- completelevel.push(matsk);
- TaskManager.CompleteEgg(matsk);
- }
- }
- else if (matsk.id == 8 && matsk.state == 1) {
- if (this.curlevel.allbuildnoclear && this.curwin) {
- completelevel.push(matsk);
- TaskManager.CompleteEgg(matsk);
- }
- }
- else if (matsk.id == 9 && matsk.state == 1) {
- var getskins = [];
- for (var k = 0; k < PlayerAccount.CurAccountData.m_skinDic.values.length; k++) {
- var mskin = PlayerAccount.CurAccountData.m_skinDic.values[k];
- if (mskin.curskinstate != skinstate.lock && mskin.skintype == skintype.role) {
- getskins.push(mskin);
- }
- }
- if (getskins.length >= 4) {
- completelevel.push(matsk);
- TaskManager.CompleteEgg(matsk);
- }
- }
- }
- return completelevel;
- }
- }
- GameManager.builddic = [];
- GameManager.alllose = 0;
- var Vector3$g = Laya.Vector3;
- class SceneManager {
- constructor(_scene) {
- this.frist = true;
- SceneManager.instance = this;
- SceneManager.mainscene = _scene;
- SceneManager.endsprite = _scene.getChildByName("end");
- SceneManager.endsprite.active = false;
- var endcollider = SceneManager.endsprite.getComponent(Laya.PhysicsCollider);
- endcollider.collisionGroup = ColliderLay.end;
- SceneManager.mapparent = new Laya.Node();
- SceneManager.mapparent.name = "mapparent";
- SceneManager.mainscene.addChild(SceneManager.mapparent);
- SceneManager.maincamera = _scene.getChildByName("Main Camera");
- SceneManager.maincamera.addComponent(CameraManager);
- SceneManager.maincamera.enableHDR = false;
- SceneManager.maincamera.clearColor = new Laya.Vector4(130 / 255, 201 / 255, 254 / 255, 1);
- SceneManager.camerastartpos = SceneManager.maincamera.transform.position.clone();
- SceneManager.camerastartrot = SceneManager.maincamera.transform.rotation.clone();
- SceneManager.mainlight = _scene.getChildByName("Directional Light");
- console.log("场景开始初始化...");
- EventManager.On(EventType.LevelCreateComplete, this, this.OnLevelCreate);
- new GameManager();
- }
- static get Instance() {
- return SceneManager.instance;
- }
- OnLevelCreate() {
- if (this.frist) {
- this.frist = false;
- this.FirstEnter();
- }
- EventManager.Trigger(EventType.GameIdle);
- }
- FirstEnter() {
- SceneManager.mainscene.visible = true;
- console.log("场景首次打开...");
- for (var i = 0; i < AssetManager.effect.values.length; i++) {
- var cureffect = AssetManager.effect.values[i];
- SceneManager.mainscene.addChild(cureffect);
- cureffect.transform.position = new Vector3$g(0, 0, 5000);
- cureffect.active = true;
- }
- Laya.timer.once(3500, this, () => {
- for (var i = 0; i < AssetManager.effect.values.length; i++) {
- var cureffect = AssetManager.effect.values[i];
- cureffect.removeSelf();
- cureffect.transform.position = new Vector3$g(0, 0, 0);
- cureffect.active = false;
- }
- });
- }
- }
- SceneManager.camerastartpos = new Vector3$g();
- SceneManager.camerastartrot = new Laya.Quaternion();
- var Vector3$h = Laya.Vector3;
- class GameUtils {
- static ScaleVector3(v3, f) {
- return new Vector3$h(v3.x * f, v3.y * f, v3.z * f);
- }
- static getConverseVector3(_vector3) {
- return new Vector3$h(-_vector3.x, -_vector3.y, -_vector3.z);
- }
- static angleToEangle(_angle) {
- return _angle * Math.PI / 180;
- }
- static absEangle(_angle) {
- var x = _angle.x;
- if (x == -0) {
- x = 0;
- }
- var y = _angle.y;
- if (y == -0) {
- y = 0;
- }
- var z = _angle.z;
- if (z == -0) {
- z = 0;
- }
- return new Vector3$h(x, y, z);
- }
- static debugVector3(_vector3) {
- console.log(_vector3.x + " " + _vector3.y + " " + _vector3.z);
- }
- static getRandomInt(left, right) {
- if (left > right) {
- return 0;
- }
- var size = right - left + 1;
- var curNumber = Math.random() * size + left;
- return Math.floor(curNumber);
- }
- static getRandomfloat(left, right) {
- if (left >= right) {
- return 0;
- }
- var size = right - left;
- var curNumber = Math.random() * size + left;
- return curNumber;
- }
- static Vector2Length(_pos1, _pos2) {
- var offestx = _pos1.x - _pos2.x;
- var offestz = _pos1.y - _pos2.y;
- var v1 = Math.pow(offestx, 2);
- var v2 = Math.pow(offestz, 2);
- var dis = Math.sqrt(v1 + v2);
- return dis;
- }
- static Vector32Length(_pos1, _pos2) {
- var offestx = _pos1.x - _pos2.x;
- var offestz = _pos1.z - _pos2.z;
- var v1 = Math.pow(offestx, 2);
- var v2 = Math.pow(offestz, 2);
- var dis = Math.sqrt(v1 + v2);
- return dis;
- }
- static Vector3Angle(_dir1, _dir2) {
- var v = Vector3$h.dot(_dir1, _dir2);
- var av = Vector3$h.scalarLength(_dir1);
- var bv = Vector3$h.scalarLength(_dir2);
- var vv = av * bv;
- var cosa = v / vv;
- var angle = Math.acos(cosa) * 180 / Math.PI;
- return angle;
- }
- static Angle(ma, mb) {
- var v1 = (ma.x * mb.x) + (ma.y * mb.y) + (ma.z * mb.z);
- var ma_val = Math.sqrt(ma.x * ma.x + ma.y * ma.y + ma.z * ma.z);
- var mb_val = Math.sqrt(mb.x * mb.x + mb.y * mb.y + mb.z * mb.z);
- var cosM = v1 / (ma_val * mb_val);
- var angleAMB = Math.acos(cosM) * 180 / Math.PI;
- return angleAMB;
- }
- static SetColliderLay(_node, _lay) {
- var childNumber = _node.numChildren;
- var PhysicsCollider = _node.getComponent(Laya.PhysicsCollider);
- if (PhysicsCollider) {
- PhysicsCollider.collisionGroup = _lay;
- PhysicsCollider.friction = 1;
- PhysicsCollider.restitution = 0;
- }
- for (var i = 0; i < childNumber; i++) {
- var eChildNumber = _node.getChildAt(i).numChildren;
- if (eChildNumber > 0) {
- this.SetColliderLay(_node.getChildAt(i), _lay);
- }
- var PhysicsCollider = _node.getChildAt(i).getComponent(Laya.PhysicsCollider);
- if (PhysicsCollider) {
- PhysicsCollider.collisionGroup = _lay;
- PhysicsCollider.friction = 1;
- PhysicsCollider.restitution = 0;
- }
- }
- }
- static TweenButton(_btn, _complete) {
- _btn.mouseEnabled = false;
- if (_btn.anchorX != 0.5) {
- _btn.anchorX = 0.5;
- _btn.anchorY = 0.5;
- _btn.x += _btn.width / 2;
- _btn.y += _btn.height / 2;
- }
- Laya.Tween.to(_btn, { scaleX: 1.2, scaleY: 1.2 }, 150, Laya.Ease.quadOut, Laya.Handler.create(this, () => {
- Laya.Tween.to(_btn, { scaleX: 1, scaleY: 1 }, 100, Laya.Ease.quadIn, Laya.Handler.create(this, () => {
- _btn.mouseEnabled = true;
- _complete();
- }));
- }));
- }
- static TweenMove(targetTransform, TargetPos, duration, _completeHandle = null, ease = null, lookPos = null) {
- var curPos = targetTransform.position;
- var tween = Laya.Tween.to(curPos, { x: TargetPos.x, y: TargetPos.y, z: TargetPos.z, update: new Laya.Handler(this, function () {
- if (lookPos)
- targetTransform.lookAt(lookPos, new Laya.Vector3(0, 1, 0));
- targetTransform.position = curPos;
- }) }, duration * 1000, ease, Laya.Handler.create(this, function () {
- tween.clear();
- if (_completeHandle != null) {
- _completeHandle.run();
- }
- }));
- return tween;
- }
- static TweenERot(targetTransform, TargetRot, duration, _completeHandle = null, ease = null) {
- var curPos = targetTransform.rotationEuler;
- var tween = Laya.Tween.to(curPos, { x: TargetRot.x, y: TargetRot.y, z: TargetRot.z, update: new Laya.Handler(this, function () {
- targetTransform.rotationEuler = curPos;
- }) }, duration * 1000, ease, Laya.Handler.create(this, function () {
- tween.clear();
- if (_completeHandle != null) {
- _completeHandle.run();
- }
- }));
- return tween;
- }
- static TweenProgress(_progress, _fromValue, _tovalue, _duration, _completeHandle = null) {
- _progress.value = _fromValue;
- var tween = Laya.Tween.to(_progress, { value: _tovalue }, _duration * 1000, null, _completeHandle);
- return tween;
- }
- static lerp(form, to, t) {
- if (t <= 0) {
- return form;
- }
- else if (t >= 1) {
- return to;
- }
- var a = t * to + (1 - t) * form;
- return a;
- }
- static DelayToDo(_delayDuration, _doFunction) {
- Laya.timer.once(_delayDuration * 1000, this, _doFunction);
- }
- static ArrayContainsItem(_array, _item) {
- let index = _array.indexOf(_item);
- if (index != -1) {
- return true;
- }
- return false;
- }
- static PathangleLength(pts) {
- var le = 0;
- for (var i = 0; i < pts.length - 1; i++) {
- var dis = Vector3$h.distance(pts[i], pts[i + 1]);
- le += dis;
- }
- return le;
- }
- static TweenText(message, _hight, _completeHandle = null, _duration = 1000) {
- var mes = new Laya.Text();
- mes.width = message.size.x;
- mes.height = message.size.y;
- mes.align = "center";
- mes.valign = "middle";
- mes.font = "Microsoft YaHei";
- mes.fontSize = message.fontSize;
- mes.pivotX = mes.width / 2;
- mes.pivotY = mes.height / 2;
- mes.color = "#5ad122";
- mes.bold = true;
- mes.stroke = 5;
- mes.strokeColor = "#ffffff";
- if (message.color) {
- message.color = message.color;
- }
- mes.text = message.message;
- mes.zOrder = 1;
- Laya.stage.addChildAt(mes, Laya.stage.numChildren - 1);
- mes.pos(message.pos.x, message.pos.y);
- var tween = Laya.Tween.to(mes, { y: mes.y - _hight, update: new Laya.Handler(this, function () {
- }) }, _duration, Laya.Ease.expoInOut, Laya.Handler.create(this, function () {
- tween.clear();
- mes.destroy();
- if (_completeHandle) {
- _completeHandle.run();
- }
- }));
- Laya.Tween.to(mes, { alpha: 0.4 }, _duration, Laya.Ease.backInOut);
- return mes;
- }
- static TweenGold(_vector3, _topos) {
- var viewpos = new Laya.Vector4();
- SceneManager.maincamera.worldToViewportPoint(_vector3, viewpos);
- var goldsprite = new Laya.Image;
- goldsprite.width = 51;
- goldsprite.height = 53;
- goldsprite.pivotX = goldsprite.width / 2;
- goldsprite.pivotY = goldsprite.height / 2;
- Laya.stage.addChild(goldsprite);
- goldsprite.x = viewpos.x;
- goldsprite.y = viewpos.y;
- goldsprite.skin = "game/zhujiemian-1-7.png";
- Laya.Tween.to(goldsprite, {
- x: _topos.x, y: _topos.y, alpha: 0.4
- }, 1000, null, Laya.Handler.create(this, () => {
- if (goldsprite)
- goldsprite.destroy();
- }), null, false);
- }
- static GetMoney(_num, _pos = null, _completeHandle = null) {
- if (_num == 0)
- return;
- var mbox = new Laya.Box;
- mbox.width = 400;
- mbox.height = 100;
- mbox.pivotX = mbox.width / 2;
- mbox.pivotY = mbox.height / 2;
- if (_pos == null) {
- _pos = new Laya.Vector2(Laya.stage.width / 2, Laya.stage.height / 2);
- }
- mbox.pos(_pos.x, _pos.y);
- var mimage = new Laya.Image;
- mimage.skin = "game/jiesuan-1-6.png";
- mimage.width = 81;
- mimage.height = 87;
- mimage.left = 50;
- mimage.y = 10;
- mbox.addChild(mimage);
- var mtext = new Laya.Text;
- mtext.width = 300;
- mtext.height = 50;
- mtext.align = "left";
- mtext.valign = "middle";
- mtext.font = "Microsoft YaHei";
- mtext.fontSize = 45;
- mtext.color = "#FFFFFF";
- mtext.bold = true;
- mtext.font = "Microsoft YaHei";
- mtext.text = "金币 +" + _num;
- mtext.x = 150;
- mtext.y = 25;
- mbox.addChild(mtext);
- Laya.stage.addChild(mbox);
- var curtween = Laya.Tween.to(mbox, { y: mbox.y - 200 }, 1500, Laya.Ease.expoInOut, Laya.Handler.create(this, () => {
- curtween.clear();
- mbox.destroy();
- if (_completeHandle) {
- _completeHandle.run();
- }
- }), 100);
- return mbox;
- }
- static DirToAngle(_dir) {
- var dir = new Vector3$h(Math.round(_dir.x * 10) / 10, Math.round(_dir.y * 10) / 10, Math.round(_dir.z * 10) / 10);
- if (dir.x == -0) {
- dir = new Vector3$h(0, dir.y, dir.z);
- }
- if (dir.y == -0) {
- dir = new Vector3$h(dir.x, 0, dir.z);
- }
- if (dir.z == -0) {
- dir = new Vector3$h(dir.x, dir.y, 0);
- }
- var reangle = Math.atan(dir.y / dir.z) * 180 / Math.PI;
- if (dir.z < 0)
- reangle += 180;
- reangle -= 90;
- var hangle = reangle * Math.PI / 180;
- return hangle;
- }
- static YNAngleToVe(_dir) {
- var hangle = this.DirToAngle(_dir);
- var dirx = Math.cos(hangle);
- var diry = Math.sin(hangle);
- return new Vector3$h(0, diry, dirx);
- }
- static DirRotYToDir(_dir, _angle) {
- var outdir = new Vector3$h();
- return outdir;
- }
- }
- class SkinData {
- constructor(_id, _type) {
- this.skinid = _id;
- this.skintype = _type;
- this.GetSkinState(this.skintype);
- }
- GetSkinState(_skintype) {
- var usetheme = PlayerAccount.CurAccountData.GetUser(AccountUser.equip_themes)[_skintype];
- var useing = usetheme == this.skinid.toString();
- var gettheme = PlayerAccount.CurAccountData.HasTheme(this.skinid);
- if (useing) {
- this.curskinstate = skinstate.useing;
- }
- else if (!useing && gettheme) {
- this.curskinstate = skinstate.getnoues;
- }
- else {
- this.curskinstate = skinstate.lock;
- }
- }
- }
- class VerCheck {
- static get checkgame() {
- var mgame = true;
- if (!VerCheck.game) {
- mgame = false;
- }
- else {
- VerCheck.game = false;
- this.GameInit();
- }
- return mgame;
- }
- static GameInit() {
- console.log("gameinit");
- console.log("Ver", this.mVer);
- }
- }
- VerCheck.mVer = "1.3.3";
- VerCheck.game = true;
- VerCheck.WX = false;
- class AccountData {
- constructor(_token, _appSetting, _user, _userbase, _useInvite = null, _user_stage = null, _user_sign, _user_achievement, _lottery, _user_video) {
- this.city_deny = false;
- this.openid = "";
- this.userId = "";
- this.scene = "";
- this.top_scene = "";
- this.roadconfig = {};
- this.m_RewardDic = {};
- this.m_EntityDic = {};
- this.m_AchievementDic = {};
- this.m_skinDic = new Dictionary();
- this.m_token = _token;
- this.m_app_setting = _appSetting;
- this.m_user = _user;
- this.m_user_base = _userbase;
- this.m_sign = _user_sign;
- this.m_task = _user_achievement;
- this.lottery = _lottery;
- this.m_user_video = _user_video;
- this.userId = this.m_user["user_id"];
- this.openid = this.m_user_base["openid"];
- this.scene = this.m_user_base["scene"];
- this.top_scene = this.m_user_base["top_scene"];
- console.log("user_id:" + this.userId);
- }
- get lotterytime() {
- return Number(this.lottery["day_video_times"]);
- }
- get share() {
- return this.m_app_setting["share"] == "1";
- }
- get sharecontent() {
- return this.m_app_setting["sharecontent"];
- }
- get ShareImage() {
- return this.m_app_setting["ShareImage"];
- }
- get cheattime() {
- return Number(this.m_app_setting["cheattime"]);
- }
- get banner() {
- return this.m_app_setting["banner"] == "1";
- }
- get video() {
- return this.m_app_setting["video"] == "1";
- }
- get checkscence() {
- return this.m_app_setting["checkscence"] == "1";
- }
- get bgm() {
- return this.m_app_setting["bgm"] == "1";
- }
- get newaccount() {
- return this.m_user["game_times"] == "0" && GameManager.Instance.gamecount == 0;
- }
- get ctnfilename() {
- return this.m_app_setting["ctnfilename"];
- }
- get cheat() {
- return this.m_app_setting["cheat"] == "1";
- }
- get shakestage() {
- return this.m_app_setting["shakestage"] && this.m_app_setting["shakestage"] == "1";
- }
- get videlAdUnitId() {
- return this.m_app_setting["videlAdUnitId"];
- }
- get bannerAdUnitId() {
- return this.m_app_setting["bannerAdUnitId"];
- }
- get tri() {
- return this.m_app_setting["tri"] == "1";
- }
- get recommend() {
- return this.m_app_setting["recommend"] == "1";
- }
- get recommendbanner() {
- return this.m_app_setting["recommendbanner"] == "1";
- }
- get chest() {
- return this.m_app_setting["chest"] == "1";
- }
- get egg() {
- return Number(this.m_app_setting["egg"]) > Math.random();
- }
- get cheatback() {
- return this.m_app_setting["cheatback"] == "1";
- }
- get cuteffect() {
- return this.m_app_setting["cuteffect"] == "1";
- }
- get videolock() {
- return false;
- }
- get videonum() {
- return false;
- }
- get UseId() {
- return this.userId;
- }
- GetConfig(_type) {
- var type = AccountConfig[_type];
- return this.m_configs[type];
- }
- GetUser(_type) {
- var type = AccountUser[_type];
- return this.m_user[type];
- }
- get GetVideoTotal() {
- return Number(this.m_user_video["total"]);
- }
- GetSign(_datatype) {
- var type = signdata[_datatype];
- return this.m_sign[type];
- }
- GetRewardConfig(_rewardid) {
- var reward = this.m_RewardDic[_rewardid];
- return reward;
- }
- GetEntity(_id, attr) {
- if (!this.m_EntityDic[_id])
- return null;
- return this.m_EntityDic[_id][entity[attr]];
- }
- GetRewardDic() {
- var config = this.GetConfig(AccountConfig.rewards);
- for (var key in config) {
- this.m_RewardDic[config[key].id] = config[key];
- }
- }
- GetEntityDic() {
- var config = this.GetConfig(AccountConfig.entity);
- for (var key in config) {
- this.m_EntityDic[config[key].entity_id] = config[key];
- }
- }
- GetThemeById(_id) {
- var data = this.GetConfig(AccountConfig.theme);
- if (data) {
- for (let index = 0; index < data.length; index++) {
- const element = data[index];
- if (element.id == _id) {
- return element;
- }
- }
- }
- }
- GetSkinAttr(_id) {
- var config = this.GetConfig(AccountConfig.theme);
- for (var i = 0; i < config.length; i++) {
- if (config[i].id == _id) {
- return config[i];
- }
- }
- }
- GetAchievementData() {
- var data = this.GetConfig(AccountConfig.achievement);
- var dic = {};
- for (var key1 in data) {
- var type1 = data[key1].type;
- if (dic[type1]) {
- continue;
- }
- var array = [];
- for (var key2 in data) {
- var type2 = data[key2].type;
- if (type1 == type2) {
- array.push(data[key2]);
- }
- }
- dic[type1] = array;
- }
- this.m_AchievementDic = dic;
- }
- HasTheme(_id) {
- var has = false;
- var getthemes = this.GetUser(AccountUser.get_themes);
- for (var i = 0; i < getthemes.length; i++) {
- if (getthemes[i] == _id) {
- has = true;
- }
- }
- return has;
- }
- GetSkinDic(_config) {
- var themes = _config.theme;
- for (var i = 0; i < themes.length; i++) {
- var config = themes[i];
- var data = new SkinData(Number(config.id), 0);
- data.skinname = config.name;
- data.skintype = Number(config.type);
- data.achievement_type = Number(config.achievement_type);
- data.quality = Number(config.quality);
- data.require_type = Number(config.require_type);
- data.require_num = Number(config.require_num);
- data.skinicon = config.icon;
- data.prefab = config.prefab;
- data.lev_big = Number(config.lev_big);
- data.prop = Number(config.prop);
- data.cdk = Number(config.code);
- data.shield = Number(config.shield);
- data.GetSkinState(data.skintype);
- if (data.shield == 0) {
- this.m_skinDic.add(Number(config.id), data);
- }
- }
- }
- GetReward(_skintype) {
- var rewardskin;
- var videoskins = [];
- var skins = PlayerAccount.CurAccountData.m_skinDic;
- for (var i = 0; i < skins.values.length; i++) {
- var skin = skins.values[i];
- if (skin.curskinstate == skinstate.lock && skin.require_type != 6 && skin.skintype == _skintype) {
- videoskins.push(skin);
- }
- }
- if (videoskins.length > 0) {
- var random = GameUtils.getRandomInt(0, videoskins.length - 1);
- rewardskin = videoskins[random];
- var skinreward = new rewarddata(6000 + rewardskin.skinid);
- skinreward.rewardicon = rewardskin.skinicon;
- skinreward.rewardname = rewardskin.skinname;
- skinreward.rewardnum = 1;
- skinreward.type = rewardtype.role;
- return skinreward;
- }
- else {
- return null;
- }
- }
- GetSeverConfig(_config) {
- this.m_configs = _config;
- this.GetSkinDic(this.m_configs);
- this.GetRewardDic();
- }
- UpdateSkinDic() {
- this.GetSkinDic(this.m_configs);
- }
- GetGlobe(_key) {
- var globe = this.GetConfig(AccountConfig.global);
- for (var key in globe) {
- var obj = globe[key];
- var kkk = obj["key"];
- if (kkk == _key) {
- var value = obj["value"];
- return value;
- }
- }
- return null;
- }
- }
- class PlayerAccount {
- constructor(_code, _nickname, _avatar, _gender, _country, _province, _city, _device, _shareid, _scence, _ver) {
- this.localTime = Laya.timer.currTimer;
- this.Code = _code;
- this.NickName = _nickname;
- this.Avatar = _avatar;
- this.Gender = _gender;
- this.Country = _country;
- this.Province = _province;
- this.City = _city;
- this.Device = _device;
- this.ShareId = _shareid;
- this.Scene = _scence;
- this.ver = _ver;
- PlayerAccount.instance = this;
- }
- static get CurrentAccount() {
- if (PlayerAccount.instance == null) {
- console.log("生成本地测试账号...");
- return PlayerAccount.TestAccount;
- }
- return PlayerAccount.instance;
- }
- static get TestAccount() {
- var code = Laya.LocalStorage.getItem("localcode");
- if (!code) {
- var time = new Date().getTime().toString();
- var random = GameUtils.getRandomInt(10000, 99999).toString();
- code = "xj_" + time + random;
- Laya.LocalStorage.setItem("localcode", code);
- console.log(time, random);
- console.log("新用户", code);
- }
- else {
- console.log("老用户", code);
- }
- var curaccount = new PlayerAccount(code, null, null, null, null, null, null, null, null, null, VerCheck.mVer);
- return curaccount;
- }
- SetAccountData(data, completecb) {
- var token = data["token"];
- var app_setting = data["app_setting"];
- var user = data["user"];
- var user_base = data["user_base"];
- var user_sign = data["user_sign"];
- var user_achievement = data["user_achievement"];
- var user_lottery = data["user_lottery"];
- var user_video = data["user_video"];
- var city_deny = data["city_deny"];
- if (PlayerAccount.CurAccountData == null) {
- console.log("开始获取config数据");
- PlayerAccount.CurAccountData = new AccountData(token, app_setting, user, user_base, null, null, user_sign, user_achievement, user_lottery, user_video);
- PlayerAccount.CurAccountData.city_deny = city_deny;
- PlayerAccount.day_first = data["day_first"] == 1;
- PlayerAccount.is_new = data["is_new"] ? true : false;
- this.CheckLocalConfig(data.table_version, (_config) => {
- PlayerAccount.CurAccountData.GetSeverConfig(_config);
- if (completecb != null) {
- completecb.runWith(data);
- }
- });
- }
- else {
- if (user) {
- PlayerAccount.CurAccountData.m_user = user;
- }
- if (user_base) {
- PlayerAccount.CurAccountData.m_user_base = user_base;
- }
- if (user_sign) {
- PlayerAccount.CurAccountData.m_sign = user_sign;
- }
- if (user_achievement) {
- PlayerAccount.CurAccountData.m_task = user_achievement;
- }
- if (user_lottery) {
- PlayerAccount.CurAccountData.lottery = user_lottery;
- }
- if (user_video) {
- PlayerAccount.CurAccountData.m_user_video = user_video;
- }
- if (PlayerAccount.CurAccountData.m_configs != null) {
- PlayerAccount.CurAccountData.GetSeverConfig(PlayerAccount.CurAccountData.m_configs);
- }
- }
- }
- CheckLocalConfig(_ver, cb) {
- var curconfig = Laya.LocalStorage.getJSON(PlayerAccount.localcofigkey);
- if (curconfig) {
- if (curconfig.ver == _ver) {
- console.log("sever配置是最新的...", _ver);
- console.log("config接口获取成功");
- cb(curconfig);
- }
- else {
- NetworkManager.Instance.HttpPostRequest(PROTOCOLS.Config, null, Laya.Handler.create(this, (data) => {
- data.configs.ver = _ver;
- Laya.LocalStorage.setJSON(PlayerAccount.localcofigkey, data.configs);
- console.log("sever配置更新完成...", _ver);
- console.log("config接口获取成功");
- cb(data.configs);
- }), Laya.Handler.create(this, (data) => {
- console.log("配置获取失败" + data);
- console.log("config接口获取失败");
- }));
- }
- }
- else {
- NetworkManager.Instance.HttpPostRequest(PROTOCOLS.Config, null, Laya.Handler.create(this, (data) => {
- data.configs.ver = _ver;
- Laya.LocalStorage.setJSON(PlayerAccount.localcofigkey, data.configs);
- console.log("sever保存配置完成...", _ver);
- console.log("config接口获取成功");
- cb(data.configs);
- }), Laya.Handler.create(this, (data) => {
- console.log("配置获取失败" + data);
- console.log("config接口获取失败");
- }));
- }
- }
- get ServerTime() {
- let time = Laya.timer.currTimer;
- let stime = PlayerAccount.ServerTime + Math.ceil((time - this.localTime) / 1000);
- return stime;
- }
- }
- PlayerAccount.localcofigkey = "mconfig";
- PlayerAccount.day_first = false;
- PlayerAccount.is_new = false;
- var Tween = Laya.Tween;
- class LoadWindow extends ui.Window.LoadWindowUI {
- constructor() {
- super();
- this.respaths = [];
- this.prenum = new Laya.Vector2();
- LoadWindow.instance = this;
- Laya.stage.addChild(this);
- this.logo.y = Laya.stage.height / 1280 * this.logo.y;
- this.logo1.y = Laya.stage.height / 1280 * this.logo1.y;
- this.Open();
- EventManager.On(EventType.LevelCreateComplete, this, this.OnHomeInit);
- }
- static get Instance() {
- return LoadWindow.instance;
- }
- Open(_data = null) {
- console.log("Landing...");
- this.LoginWx();
- this.TweenProgress(0, 65, 1, this.ShowProgress);
- TtSdk.RecordEvent("enterLoad");
- this.height = Laya.stage.height;
- Laya.stage.on(Laya.Event.RESIZE, this, () => { this.height = Laya.stage.height; });
- }
- LoginWx() {
- this.LoginLocalSever();
- }
- LoginLocal() {
- var code = Laya.LocalStorage.getItem("ttcode");
- if (!code) {
- var time = new Date().getTime().toString();
- var random = GameUtils.getRandomInt(10000, 99999).toString();
- code = "xj_" + time + random;
- Laya.LocalStorage.setItem("ttcode", code);
- console.log(time, random);
- console.log("新用户", code);
- }
- else {
- console.log("老用户", code);
- }
- new PlayerAccount(code, "", "", 0, "", "", "", "", "", "", VerCheck.mVer);
- NetworkManager.Instance.login(null, Laya.Handler.create(this, this.OnLoginLocalComplete), Laya.Handler.create(this, this.OnLoginError));
- }
- LoadSbp() {
- this.LoadScene();
- }
- LoginLocalSever(res = null) {
- console.log("开始本地登录");
- NetworkManager.Instance.login(null, Laya.Handler.create(this, this.OnLoginLocalComplete), Laya.Handler.create(this, this.OnLoginError));
- }
- OnLoginLocalComplete() {
- console.log("本地服务器登录完成...");
- ADHelper.initAd();
- this.LoadScene();
- }
- OnLoginError(e) {
- console.log(e);
- this.LoginWx();
- }
- CompleteProgress() {
- this.TweenProgress(this.prenum.x, 100, 0.3, this.LoadEnd);
- }
- ShowProgress() {
- this.TweenProgress(this.prenum.x, 95, 50);
- }
- Hide() {
- Laya.loader.clearRes("res/atlas/load.atlas");
- Laya.loader.clearRes("res/atlas/load.png");
- this.destroy();
- }
- LoadScene() {
- Laya.Scene3D.load(AssetPath.mainscene, Laya.Handler.create(this, (scene) => {
- this.mainscene = scene;
- this.mainscene.visible = false;
- Laya.stage.addChildAt(this.mainscene, 1);
- console.log("场景加载完成...");
- this.LoadResources();
- }));
- }
- LoadResources() {
- var respath = [];
- respath = respath.concat(AssetPath.prefab);
- Laya.loader.create(respath, Laya.Handler.create(this, () => {
- var roleasset = Laya.loader.getRes(AssetPath.prefab[0]);
- for (var i = 0; i < roleasset.numChildren; i++) {
- var curroleasset = roleasset.getChildAt(i);
- curroleasset.active = false;
- AssetManager.role.add(i + 1, curroleasset);
- }
- Laya.loader.clearRes(AssetPath.prefab[0]);
- var girlasset = Laya.loader.getRes(AssetPath.prefab[1]);
- for (var i = 0; i < girlasset.numChildren; i++) {
- var curgirlasset = girlasset.getChildAt(i);
- curgirlasset.active = false;
- AssetManager.girl.add(i + 1, curgirlasset);
- }
- Laya.loader.clearRes(AssetPath.prefab[1]);
- var enemyasset = Laya.loader.getRes(AssetPath.prefab[2]);
- for (var i = 0; i < enemyasset.numChildren; i++) {
- var curenemyasset = enemyasset.getChildAt(i);
- curenemyasset.active = false;
- AssetManager.enemy.add(i + 1, curenemyasset);
- }
- Laya.loader.clearRes(AssetPath.prefab[2]);
- var obstacleasset = Laya.loader.getRes(AssetPath.prefab[3]);
- for (var i = 0; i < obstacleasset.numChildren; i++) {
- var curobsasset = obstacleasset.getChildAt(i);
- curobsasset.active = false;
- AssetManager.obstacle.add(i + 1, curobsasset);
- }
- Laya.loader.clearRes(AssetPath.prefab[3]);
- var bulletasset = Laya.loader.getRes(AssetPath.prefab[4]);
- for (var i = 0; i < bulletasset.numChildren; i++) {
- var curbullet = bulletasset.getChildAt(i);
- curbullet.active = false;
- AssetManager.bullet.add(i + 1, curbullet);
- }
- Laya.loader.clearRes(AssetPath.prefab[4]);
- var effectasset = Laya.loader.getRes(AssetPath.prefab[5]);
- for (var i = 0; i < effectasset.numChildren; i++) {
- var cureffect = effectasset.getChildAt(i);
- cureffect.active = false;
- AssetManager.effect.add(i + 1, cureffect);
- }
- Laya.loader.clearRes(AssetPath.prefab[5]);
- var standasset = Laya.loader.getRes(AssetPath.prefab[6]);
- for (var i = 0; i < standasset.numChildren; i++) {
- var curstand = standasset.getChildAt(i);
- curstand.active = false;
- AssetManager.standbuild.add(i + 1, curstand);
- }
- Laya.loader.clearRes(AssetPath.prefab[6]);
- var roadasset = Laya.loader.getRes(AssetPath.prefab[7]);
- for (var i = 0; i < roadasset.numChildren; i++) {
- var curroad = roadasset.getChildAt(i);
- curroad.active = false;
- AssetManager.road.add(i + 1, curroad);
- }
- Laya.loader.clearRes(AssetPath.prefab[7]);
- var weaponasset = Laya.loader.getRes(AssetPath.prefab[8]);
- for (var i = 0; i < weaponasset.numChildren; i++) {
- var curweapon = weaponasset.getChildAt(i);
- curweapon.active = false;
- AssetManager.weapon.add(i + 1, curweapon);
- }
- Laya.loader.clearRes(AssetPath.prefab[8]);
- var twasset = Laya.loader.getRes(AssetPath.prefab[9]);
- for (var i = 0; i < twasset.numChildren; i++) {
- var curtw = twasset.getChildAt(i);
- curtw.active = false;
- AssetManager.tw.add(i + 1, curtw);
- }
- Laya.loader.clearRes(AssetPath.prefab[9]);
- var handasset = Laya.loader.getRes(AssetPath.prefab[10]);
- handasset.active = false;
- AssetManager.hand = handasset;
- Laya.loader.clearRes(AssetPath.prefab[10]);
- console.log("游戏资源加载完成...");
- this.CompleteProgress();
- }));
- }
- LoadEnd() {
- console.log("加载完成...");
- this.ProgressTween.clear();
- new SceneManager(this.mainscene);
- }
- OnHomeInit() {
- EventManager.Off(EventType.LevelCreateComplete, this, this.OnHomeInit);
- this.Hide();
- }
- TweenProgress(_start, _end, _duration, _complete = null) {
- if (this.ProgressTween)
- this.ProgressTween.clear();
- this.prenum = new Laya.Vector2(_start, 0);
- this.ProgressTween = Tween.to(this.prenum, { x: _end, update: new Laya.Handler(this, () => {
- this.preclip.value = Math.floor(this.prenum.x).toString();
- }) }, _duration * 1000, null, Laya.Handler.create(this, _complete), null, true, true);
- }
- }
- class Main {
- constructor() {
- if (window["Laya3D"])
- Laya3D.init(GameConfig.width, GameConfig.height);
- else
- Laya.init(GameConfig.width, GameConfig.height, Laya["WebGL"]);
- Laya["Physics"] && Laya["Physics"].enable();
- Laya["DebugPanel"] && Laya["DebugPanel"].enable();
- Laya.stage.scaleMode = GameConfig.scaleMode;
- Laya.stage.screenMode = GameConfig.screenMode;
- Laya.stage.alignV = GameConfig.alignV;
- Laya.stage.alignH = GameConfig.alignH;
- Laya.URL.exportSceneToJson = GameConfig.exportSceneToJson;
- if (GameConfig.debug || Laya.Utils.getQueryString("debug") == "true")
- Laya.enableDebugPanel();
- if (GameConfig.physicsDebug && Laya["PhysicsDebugDraw"])
- Laya["PhysicsDebugDraw"].enable();
- if (GameConfig.stat)
- Laya.Stat.show();
- console.log("Ver", VerCheck.mVer);
- if (!Laya.Browser.onPC) {
- VerCheck.WX = true;
- }
- Laya.ResourceVersion.enable("version.json", Laya.Handler.create(this, this.onVersionLoaded), Laya.ResourceVersion.FILENAME_VERSION);
- }
- onVersionLoaded() {
- Laya.AtlasInfoManager.enable("fileconfig.json", Laya.Handler.create(this, this.onConfigLoaded));
- }
- onConfigLoaded() {
- new LoadWindow();
- }
- }
- new Main();
- }());
- //# sourceMappingURL=bundle.js.map
|