laya.debugtool.js 349 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016101710181019102010211022102310241025102610271028102910301031103210331034103510361037103810391040104110421043104410451046104710481049105010511052105310541055105610571058105910601061106210631064106510661067106810691070107110721073107410751076107710781079108010811082108310841085108610871088108910901091109210931094109510961097109810991100110111021103110411051106110711081109111011111112111311141115111611171118111911201121112211231124112511261127112811291130113111321133113411351136113711381139114011411142114311441145114611471148114911501151115211531154115511561157115811591160116111621163116411651166116711681169117011711172117311741175117611771178117911801181118211831184118511861187118811891190119111921193119411951196119711981199120012011202120312041205120612071208120912101211121212131214121512161217121812191220122112221223122412251226122712281229123012311232123312341235123612371238123912401241124212431244124512461247124812491250125112521253125412551256125712581259126012611262126312641265126612671268126912701271127212731274127512761277127812791280128112821283128412851286128712881289129012911292129312941295129612971298129913001301130213031304130513061307130813091310131113121313131413151316131713181319132013211322132313241325132613271328132913301331133213331334133513361337133813391340134113421343134413451346134713481349135013511352135313541355135613571358135913601361136213631364136513661367136813691370137113721373137413751376137713781379138013811382138313841385138613871388138913901391139213931394139513961397139813991400140114021403140414051406140714081409141014111412141314141415141614171418141914201421142214231424142514261427142814291430143114321433143414351436143714381439144014411442144314441445144614471448144914501451145214531454145514561457145814591460146114621463146414651466146714681469147014711472147314741475147614771478147914801481148214831484148514861487148814891490149114921493149414951496149714981499150015011502150315041505150615071508150915101511151215131514151515161517151815191520152115221523152415251526152715281529153015311532153315341535153615371538153915401541154215431544154515461547154815491550155115521553155415551556155715581559156015611562156315641565156615671568156915701571157215731574157515761577157815791580158115821583158415851586158715881589159015911592159315941595159615971598159916001601160216031604160516061607160816091610161116121613161416151616161716181619162016211622162316241625162616271628162916301631163216331634163516361637163816391640164116421643164416451646164716481649165016511652165316541655165616571658165916601661166216631664166516661667166816691670167116721673167416751676167716781679168016811682168316841685168616871688168916901691169216931694169516961697169816991700170117021703170417051706170717081709171017111712171317141715171617171718171917201721172217231724172517261727172817291730173117321733173417351736173717381739174017411742174317441745174617471748174917501751175217531754175517561757175817591760176117621763176417651766176717681769177017711772177317741775177617771778177917801781178217831784178517861787178817891790179117921793179417951796179717981799180018011802180318041805180618071808180918101811181218131814181518161817181818191820182118221823182418251826182718281829183018311832183318341835183618371838183918401841184218431844184518461847184818491850185118521853185418551856185718581859186018611862186318641865186618671868186918701871187218731874187518761877187818791880188118821883188418851886188718881889189018911892189318941895189618971898189919001901190219031904190519061907190819091910191119121913191419151916191719181919192019211922192319241925192619271928192919301931193219331934193519361937193819391940194119421943194419451946194719481949195019511952195319541955195619571958195919601961196219631964196519661967196819691970197119721973197419751976197719781979198019811982198319841985198619871988198919901991199219931994199519961997199819992000200120022003200420052006200720082009201020112012201320142015201620172018201920202021202220232024202520262027202820292030203120322033203420352036203720382039204020412042204320442045204620472048204920502051205220532054205520562057205820592060206120622063206420652066206720682069207020712072207320742075207620772078207920802081208220832084208520862087208820892090209120922093209420952096209720982099210021012102210321042105210621072108210921102111211221132114211521162117211821192120212121222123212421252126212721282129213021312132213321342135213621372138213921402141214221432144214521462147214821492150215121522153215421552156215721582159216021612162216321642165216621672168216921702171217221732174217521762177217821792180218121822183218421852186218721882189219021912192219321942195219621972198219922002201220222032204220522062207220822092210221122122213221422152216221722182219222022212222222322242225222622272228222922302231223222332234223522362237223822392240224122422243224422452246224722482249225022512252225322542255225622572258225922602261226222632264226522662267226822692270227122722273227422752276227722782279228022812282228322842285228622872288228922902291229222932294229522962297229822992300230123022303230423052306230723082309231023112312231323142315231623172318231923202321232223232324232523262327232823292330233123322333233423352336233723382339234023412342234323442345234623472348234923502351235223532354235523562357235823592360236123622363236423652366236723682369237023712372237323742375237623772378237923802381238223832384238523862387238823892390239123922393239423952396239723982399240024012402240324042405240624072408240924102411241224132414241524162417241824192420242124222423242424252426242724282429243024312432243324342435243624372438243924402441244224432444244524462447244824492450245124522453245424552456245724582459246024612462246324642465246624672468246924702471247224732474247524762477247824792480248124822483248424852486248724882489249024912492249324942495249624972498249925002501250225032504250525062507250825092510251125122513251425152516251725182519252025212522252325242525252625272528252925302531253225332534253525362537253825392540254125422543254425452546254725482549255025512552255325542555255625572558255925602561256225632564256525662567256825692570257125722573257425752576257725782579258025812582258325842585258625872588258925902591259225932594259525962597259825992600260126022603260426052606260726082609261026112612261326142615261626172618261926202621262226232624262526262627262826292630263126322633263426352636263726382639264026412642264326442645264626472648264926502651265226532654265526562657265826592660266126622663266426652666266726682669267026712672267326742675267626772678267926802681268226832684268526862687268826892690269126922693269426952696269726982699270027012702270327042705270627072708270927102711271227132714271527162717271827192720272127222723272427252726272727282729273027312732273327342735273627372738273927402741274227432744274527462747274827492750275127522753275427552756275727582759276027612762276327642765276627672768276927702771277227732774277527762777277827792780278127822783278427852786278727882789279027912792279327942795279627972798279928002801280228032804280528062807280828092810281128122813281428152816281728182819282028212822282328242825282628272828282928302831283228332834283528362837283828392840284128422843284428452846284728482849285028512852285328542855285628572858285928602861286228632864286528662867286828692870287128722873287428752876287728782879288028812882288328842885288628872888288928902891289228932894289528962897289828992900290129022903290429052906290729082909291029112912291329142915291629172918291929202921292229232924292529262927292829292930293129322933293429352936293729382939294029412942294329442945294629472948294929502951295229532954295529562957295829592960296129622963296429652966296729682969297029712972297329742975297629772978297929802981298229832984298529862987298829892990299129922993299429952996299729982999300030013002300330043005300630073008300930103011301230133014301530163017301830193020302130223023302430253026302730283029303030313032303330343035303630373038303930403041304230433044304530463047304830493050305130523053305430553056305730583059306030613062306330643065306630673068306930703071307230733074307530763077307830793080308130823083308430853086308730883089309030913092309330943095309630973098309931003101310231033104310531063107310831093110311131123113311431153116311731183119312031213122312331243125312631273128312931303131313231333134313531363137313831393140314131423143314431453146314731483149315031513152315331543155315631573158315931603161316231633164316531663167316831693170317131723173317431753176317731783179318031813182318331843185318631873188318931903191319231933194319531963197319831993200320132023203320432053206320732083209321032113212321332143215321632173218321932203221322232233224322532263227322832293230323132323233323432353236323732383239324032413242324332443245324632473248324932503251325232533254325532563257325832593260326132623263326432653266326732683269327032713272327332743275327632773278327932803281328232833284328532863287328832893290329132923293329432953296329732983299330033013302330333043305330633073308330933103311331233133314331533163317331833193320332133223323332433253326332733283329333033313332333333343335333633373338333933403341334233433344334533463347334833493350335133523353335433553356335733583359336033613362336333643365336633673368336933703371337233733374337533763377337833793380338133823383338433853386338733883389339033913392339333943395339633973398339934003401340234033404340534063407340834093410341134123413341434153416341734183419342034213422342334243425342634273428342934303431343234333434343534363437343834393440344134423443344434453446344734483449345034513452345334543455345634573458345934603461346234633464346534663467346834693470347134723473347434753476347734783479348034813482348334843485348634873488348934903491349234933494349534963497349834993500350135023503350435053506350735083509351035113512351335143515351635173518351935203521352235233524352535263527352835293530353135323533353435353536353735383539354035413542354335443545354635473548354935503551355235533554355535563557355835593560356135623563356435653566356735683569357035713572357335743575357635773578357935803581358235833584358535863587358835893590359135923593359435953596359735983599360036013602360336043605360636073608360936103611361236133614361536163617361836193620362136223623362436253626362736283629363036313632363336343635363636373638363936403641364236433644364536463647364836493650365136523653365436553656365736583659366036613662366336643665366636673668366936703671367236733674367536763677367836793680368136823683368436853686368736883689369036913692369336943695369636973698369937003701370237033704370537063707370837093710371137123713371437153716371737183719372037213722372337243725372637273728372937303731373237333734373537363737373837393740374137423743374437453746374737483749375037513752375337543755375637573758375937603761376237633764376537663767376837693770377137723773377437753776377737783779378037813782378337843785378637873788378937903791379237933794379537963797379837993800380138023803380438053806380738083809381038113812381338143815381638173818381938203821382238233824382538263827382838293830383138323833383438353836383738383839384038413842384338443845384638473848384938503851385238533854385538563857385838593860386138623863386438653866386738683869387038713872387338743875387638773878387938803881388238833884388538863887388838893890389138923893389438953896389738983899390039013902390339043905390639073908390939103911391239133914391539163917391839193920392139223923392439253926392739283929393039313932393339343935393639373938393939403941394239433944394539463947394839493950395139523953395439553956395739583959396039613962396339643965396639673968396939703971397239733974397539763977397839793980398139823983398439853986398739883989399039913992399339943995399639973998399940004001400240034004400540064007400840094010401140124013401440154016401740184019402040214022402340244025402640274028402940304031403240334034403540364037403840394040404140424043404440454046404740484049405040514052405340544055405640574058405940604061406240634064406540664067406840694070407140724073407440754076407740784079408040814082408340844085408640874088408940904091409240934094409540964097409840994100410141024103410441054106410741084109411041114112411341144115411641174118411941204121412241234124412541264127412841294130413141324133413441354136413741384139414041414142414341444145414641474148414941504151415241534154415541564157415841594160416141624163416441654166416741684169417041714172417341744175417641774178417941804181418241834184418541864187418841894190419141924193419441954196419741984199420042014202420342044205420642074208420942104211421242134214421542164217421842194220422142224223422442254226422742284229423042314232423342344235423642374238423942404241424242434244424542464247424842494250425142524253425442554256425742584259426042614262426342644265426642674268426942704271427242734274427542764277427842794280428142824283428442854286428742884289429042914292429342944295429642974298429943004301430243034304430543064307430843094310431143124313431443154316431743184319432043214322432343244325432643274328432943304331433243334334433543364337433843394340434143424343434443454346434743484349435043514352435343544355435643574358435943604361436243634364436543664367436843694370437143724373437443754376437743784379438043814382438343844385438643874388438943904391439243934394439543964397439843994400440144024403440444054406440744084409441044114412441344144415441644174418441944204421442244234424442544264427442844294430443144324433443444354436443744384439444044414442444344444445444644474448444944504451445244534454445544564457445844594460446144624463446444654466446744684469447044714472447344744475447644774478447944804481448244834484448544864487448844894490449144924493449444954496449744984499450045014502450345044505450645074508450945104511451245134514451545164517451845194520452145224523452445254526452745284529453045314532453345344535453645374538453945404541454245434544454545464547454845494550455145524553455445554556455745584559456045614562456345644565456645674568456945704571457245734574457545764577457845794580458145824583458445854586458745884589459045914592459345944595459645974598459946004601460246034604460546064607460846094610461146124613461446154616461746184619462046214622462346244625462646274628462946304631463246334634463546364637463846394640464146424643464446454646464746484649465046514652465346544655465646574658465946604661466246634664466546664667466846694670467146724673467446754676467746784679468046814682468346844685468646874688468946904691469246934694469546964697469846994700470147024703470447054706470747084709471047114712471347144715471647174718471947204721472247234724472547264727472847294730473147324733473447354736473747384739474047414742474347444745474647474748474947504751475247534754475547564757475847594760476147624763476447654766476747684769477047714772477347744775477647774778477947804781478247834784478547864787478847894790479147924793479447954796479747984799480048014802480348044805480648074808480948104811481248134814481548164817481848194820482148224823482448254826482748284829483048314832483348344835483648374838483948404841484248434844484548464847484848494850485148524853485448554856485748584859486048614862486348644865486648674868486948704871487248734874487548764877487848794880488148824883488448854886488748884889489048914892489348944895489648974898489949004901490249034904490549064907490849094910491149124913491449154916491749184919492049214922492349244925492649274928492949304931493249334934493549364937493849394940494149424943494449454946494749484949495049514952495349544955495649574958495949604961496249634964496549664967496849694970497149724973497449754976497749784979498049814982498349844985498649874988498949904991499249934994499549964997499849995000500150025003500450055006500750085009501050115012501350145015501650175018501950205021502250235024502550265027502850295030503150325033503450355036503750385039504050415042504350445045504650475048504950505051505250535054505550565057505850595060506150625063506450655066506750685069507050715072507350745075507650775078507950805081508250835084508550865087508850895090509150925093509450955096509750985099510051015102510351045105510651075108510951105111511251135114511551165117511851195120512151225123512451255126512751285129513051315132513351345135513651375138513951405141514251435144514551465147514851495150515151525153515451555156515751585159516051615162516351645165516651675168516951705171517251735174517551765177517851795180518151825183518451855186518751885189519051915192519351945195519651975198519952005201520252035204520552065207520852095210521152125213521452155216521752185219522052215222522352245225522652275228522952305231523252335234523552365237523852395240524152425243524452455246524752485249525052515252525352545255525652575258525952605261526252635264526552665267526852695270527152725273527452755276527752785279528052815282528352845285528652875288528952905291529252935294529552965297529852995300530153025303530453055306530753085309531053115312531353145315531653175318531953205321532253235324532553265327532853295330533153325333533453355336533753385339534053415342534353445345534653475348534953505351535253535354535553565357535853595360536153625363536453655366536753685369537053715372537353745375537653775378537953805381538253835384538553865387538853895390539153925393539453955396539753985399540054015402540354045405540654075408540954105411541254135414541554165417541854195420542154225423542454255426542754285429543054315432543354345435543654375438543954405441544254435444544554465447544854495450545154525453545454555456545754585459546054615462546354645465546654675468546954705471547254735474547554765477547854795480548154825483548454855486548754885489549054915492549354945495549654975498549955005501550255035504550555065507550855095510551155125513551455155516551755185519552055215522552355245525552655275528552955305531553255335534553555365537553855395540554155425543554455455546554755485549555055515552555355545555555655575558555955605561556255635564556555665567556855695570557155725573557455755576557755785579558055815582558355845585558655875588558955905591559255935594559555965597559855995600560156025603560456055606560756085609561056115612561356145615561656175618561956205621562256235624562556265627562856295630563156325633563456355636563756385639564056415642564356445645564656475648564956505651565256535654565556565657565856595660566156625663566456655666566756685669567056715672567356745675567656775678567956805681568256835684568556865687568856895690569156925693569456955696569756985699570057015702570357045705570657075708570957105711571257135714571557165717571857195720572157225723572457255726572757285729573057315732573357345735573657375738573957405741574257435744574557465747574857495750575157525753575457555756575757585759576057615762576357645765576657675768576957705771577257735774577557765777577857795780578157825783578457855786578757885789579057915792579357945795579657975798579958005801580258035804580558065807580858095810581158125813581458155816581758185819582058215822582358245825582658275828582958305831583258335834583558365837583858395840584158425843584458455846584758485849585058515852585358545855585658575858585958605861586258635864586558665867586858695870587158725873587458755876587758785879588058815882588358845885588658875888588958905891589258935894589558965897589858995900590159025903590459055906590759085909591059115912591359145915591659175918591959205921592259235924592559265927592859295930593159325933593459355936593759385939594059415942594359445945594659475948594959505951595259535954595559565957595859595960596159625963596459655966596759685969597059715972597359745975597659775978597959805981598259835984598559865987598859895990599159925993599459955996599759985999600060016002600360046005600660076008600960106011601260136014601560166017601860196020602160226023602460256026602760286029603060316032603360346035603660376038603960406041604260436044604560466047604860496050605160526053605460556056605760586059606060616062606360646065606660676068606960706071607260736074607560766077607860796080608160826083608460856086608760886089609060916092609360946095609660976098609961006101610261036104610561066107610861096110611161126113611461156116611761186119612061216122612361246125612661276128612961306131613261336134613561366137613861396140614161426143614461456146614761486149615061516152615361546155615661576158615961606161616261636164616561666167616861696170617161726173617461756176617761786179618061816182618361846185618661876188618961906191619261936194619561966197619861996200620162026203620462056206620762086209621062116212621362146215621662176218621962206221622262236224622562266227622862296230623162326233623462356236623762386239624062416242624362446245624662476248624962506251625262536254625562566257625862596260626162626263626462656266626762686269627062716272627362746275627662776278627962806281628262836284628562866287628862896290629162926293629462956296629762986299630063016302630363046305630663076308630963106311631263136314631563166317631863196320632163226323632463256326632763286329633063316332633363346335633663376338633963406341634263436344634563466347634863496350635163526353635463556356635763586359636063616362636363646365636663676368636963706371637263736374637563766377637863796380638163826383638463856386638763886389639063916392639363946395639663976398639964006401640264036404640564066407640864096410641164126413641464156416641764186419642064216422642364246425642664276428642964306431643264336434643564366437643864396440644164426443644464456446644764486449645064516452645364546455645664576458645964606461646264636464646564666467646864696470647164726473647464756476647764786479648064816482648364846485648664876488648964906491649264936494649564966497649864996500650165026503650465056506650765086509651065116512651365146515651665176518651965206521652265236524652565266527652865296530653165326533653465356536653765386539654065416542654365446545654665476548654965506551655265536554655565566557655865596560656165626563656465656566656765686569657065716572657365746575657665776578657965806581658265836584658565866587658865896590659165926593659465956596659765986599660066016602660366046605660666076608660966106611661266136614661566166617661866196620662166226623662466256626662766286629663066316632663366346635663666376638663966406641664266436644664566466647664866496650665166526653665466556656665766586659666066616662666366646665666666676668666966706671667266736674667566766677667866796680668166826683668466856686668766886689669066916692669366946695669666976698669967006701670267036704670567066707670867096710671167126713671467156716671767186719672067216722672367246725672667276728672967306731673267336734673567366737673867396740674167426743674467456746674767486749675067516752675367546755675667576758675967606761676267636764676567666767676867696770677167726773677467756776677767786779678067816782678367846785678667876788678967906791679267936794679567966797679867996800680168026803680468056806680768086809681068116812681368146815681668176818681968206821682268236824682568266827682868296830683168326833683468356836683768386839684068416842684368446845684668476848684968506851685268536854685568566857685868596860686168626863686468656866686768686869687068716872687368746875687668776878687968806881688268836884688568866887688868896890689168926893689468956896689768986899690069016902690369046905690669076908690969106911691269136914691569166917691869196920692169226923692469256926692769286929693069316932693369346935693669376938693969406941694269436944694569466947694869496950695169526953695469556956695769586959696069616962696369646965696669676968696969706971697269736974697569766977697869796980698169826983698469856986698769886989699069916992699369946995699669976998699970007001700270037004700570067007700870097010701170127013701470157016701770187019702070217022702370247025702670277028702970307031703270337034703570367037703870397040704170427043704470457046704770487049705070517052705370547055705670577058705970607061706270637064706570667067706870697070707170727073707470757076707770787079708070817082708370847085708670877088708970907091709270937094709570967097709870997100710171027103710471057106710771087109711071117112711371147115711671177118711971207121712271237124712571267127712871297130713171327133713471357136713771387139714071417142714371447145714671477148714971507151715271537154715571567157715871597160716171627163716471657166716771687169717071717172717371747175717671777178717971807181718271837184718571867187718871897190719171927193719471957196719771987199720072017202720372047205720672077208720972107211721272137214721572167217721872197220722172227223722472257226722772287229723072317232723372347235723672377238723972407241724272437244724572467247724872497250725172527253725472557256725772587259726072617262726372647265726672677268726972707271727272737274727572767277727872797280728172827283728472857286728772887289729072917292729372947295729672977298729973007301730273037304730573067307730873097310731173127313731473157316731773187319732073217322732373247325732673277328732973307331733273337334733573367337733873397340734173427343734473457346734773487349735073517352735373547355735673577358735973607361736273637364736573667367736873697370737173727373737473757376737773787379738073817382738373847385738673877388738973907391739273937394739573967397739873997400740174027403740474057406740774087409741074117412741374147415741674177418741974207421742274237424742574267427742874297430743174327433743474357436743774387439744074417442744374447445744674477448744974507451745274537454745574567457745874597460746174627463746474657466746774687469747074717472747374747475747674777478747974807481748274837484748574867487748874897490749174927493749474957496749774987499750075017502750375047505750675077508750975107511751275137514751575167517751875197520752175227523752475257526752775287529753075317532753375347535753675377538753975407541754275437544754575467547754875497550755175527553755475557556755775587559756075617562756375647565756675677568756975707571757275737574757575767577757875797580758175827583758475857586758775887589759075917592759375947595759675977598759976007601760276037604760576067607760876097610761176127613761476157616761776187619762076217622762376247625762676277628762976307631763276337634763576367637763876397640764176427643764476457646764776487649765076517652765376547655765676577658765976607661766276637664766576667667766876697670767176727673767476757676767776787679768076817682768376847685768676877688768976907691769276937694769576967697769876997700770177027703770477057706770777087709771077117712771377147715771677177718771977207721772277237724772577267727772877297730773177327733773477357736773777387739774077417742774377447745774677477748774977507751775277537754775577567757775877597760776177627763776477657766776777687769777077717772777377747775777677777778777977807781778277837784778577867787778877897790779177927793779477957796779777987799780078017802780378047805780678077808780978107811781278137814781578167817781878197820782178227823782478257826782778287829783078317832783378347835783678377838783978407841784278437844784578467847784878497850785178527853785478557856785778587859786078617862786378647865786678677868786978707871787278737874787578767877787878797880788178827883788478857886788778887889789078917892789378947895789678977898789979007901790279037904790579067907790879097910791179127913791479157916791779187919792079217922792379247925792679277928792979307931793279337934793579367937793879397940794179427943794479457946794779487949795079517952795379547955795679577958795979607961796279637964796579667967796879697970797179727973797479757976797779787979798079817982798379847985798679877988
  1. (function (exports, Laya) {
  2. 'use strict';
  3. class StringTool {
  4. constructor() {
  5. }
  6. static toUpCase(str) {
  7. return str.toUpperCase();
  8. }
  9. static toLowCase(str) {
  10. return str.toLowerCase();
  11. }
  12. static toUpHead(str) {
  13. var rst;
  14. if (str.length <= 1)
  15. return str.toUpperCase();
  16. rst = str.charAt(0).toUpperCase() + str.substr(1);
  17. return rst;
  18. }
  19. static toLowHead(str) {
  20. var rst;
  21. if (str.length <= 1)
  22. return str.toLowerCase();
  23. rst = str.charAt(0).toLowerCase() + str.substr(1);
  24. return rst;
  25. }
  26. static packageToFolderPath(packageName) {
  27. var rst;
  28. rst = packageName.replace(".", "/");
  29. return rst;
  30. }
  31. static insert(str, iStr, index) {
  32. return str.substring(0, index) + iStr + str.substr(index);
  33. }
  34. static insertAfter(str, iStr, tarStr, isLast = false) {
  35. var i;
  36. if (isLast) {
  37. i = str.lastIndexOf(tarStr);
  38. }
  39. else {
  40. i = str.indexOf(tarStr);
  41. }
  42. if (i >= 0) {
  43. return StringTool.insert(str, iStr, i + tarStr.length);
  44. }
  45. return str;
  46. }
  47. static insertBefore(str, iStr, tarStr, isLast = false) {
  48. var i;
  49. if (isLast) {
  50. i = str.lastIndexOf(tarStr);
  51. }
  52. else {
  53. i = str.indexOf(tarStr);
  54. }
  55. if (i >= 0) {
  56. return StringTool.insert(str, iStr, i);
  57. }
  58. return str;
  59. }
  60. static insertParamToFun(funStr, params) {
  61. var oldParam;
  62. oldParam = StringTool.getParamArr(funStr);
  63. var inserStr;
  64. inserStr = params.join(",");
  65. if (oldParam.length > 0) {
  66. inserStr = "," + inserStr;
  67. }
  68. return StringTool.insertBefore(funStr, inserStr, ")", true);
  69. }
  70. static trim(str, vList = null) {
  71. if (!vList) {
  72. vList = [" ", "\r", "\n", "\t", String.fromCharCode(65279)];
  73. }
  74. var rst;
  75. var i;
  76. var len;
  77. rst = str;
  78. len = vList.length;
  79. for (i = 0; i < len; i++) {
  80. rst = StringTool.getReplace(rst, vList[i], "");
  81. }
  82. return rst;
  83. }
  84. static isEmpty(str) {
  85. if (str.length < 1)
  86. return true;
  87. return StringTool.emptyStrDic.hasOwnProperty(str);
  88. }
  89. static trimLeft(str) {
  90. var i;
  91. i = 0;
  92. var len;
  93. len = str.length;
  94. while (StringTool.isEmpty(str.charAt(i)) && i < len) {
  95. i++;
  96. }
  97. if (i < len) {
  98. return str.substr(i);
  99. }
  100. return "";
  101. }
  102. static trimRight(str) {
  103. var i;
  104. i = str.length - 1;
  105. while (StringTool.isEmpty(str.charAt(i)) && i >= 0) {
  106. i--;
  107. }
  108. var rst;
  109. rst = str.substring(0, i);
  110. if (i >= 0) {
  111. return str.substring(0, i + 1);
  112. }
  113. return "";
  114. }
  115. static trimSide(str) {
  116. var rst;
  117. rst = StringTool.trimLeft(str);
  118. rst = StringTool.trimRight(rst);
  119. return rst;
  120. }
  121. static isOkFileName(fileName) {
  122. if (StringTool.trimSide(fileName) == "")
  123. return false;
  124. var i, len;
  125. len = fileName.length;
  126. for (i = 0; i < len; i++) {
  127. if (StringTool.specialChars[fileName.charAt(i)])
  128. return false;
  129. }
  130. return true;
  131. }
  132. static trimButEmpty(str) {
  133. return StringTool.trim(str, ["\r", "\n", "\t"]);
  134. }
  135. static removeEmptyStr(strArr) {
  136. var i;
  137. i = strArr.length - 1;
  138. var str;
  139. for (i = i; i >= 0; i--) {
  140. str = strArr[i];
  141. str = StringTool.trimSide(str);
  142. if (StringTool.isEmpty(str)) {
  143. strArr.splice(i, 1);
  144. }
  145. else {
  146. strArr[i] = str;
  147. }
  148. }
  149. return strArr;
  150. }
  151. static ifNoAddToTail(str, sign) {
  152. if (str.indexOf(sign) >= 0) {
  153. return str;
  154. }
  155. return str + sign;
  156. }
  157. static trimEmptyLine(str) {
  158. var i;
  159. var tLines;
  160. var tLine;
  161. tLines = str.split("\n");
  162. for (i = tLines.length - 1; i >= 0; i--) {
  163. tLine = tLines[i];
  164. if (StringTool.isEmptyLine(tLine)) {
  165. tLines.splice(i, 1);
  166. }
  167. }
  168. return tLines.join("\n");
  169. }
  170. static isEmptyLine(str) {
  171. str = StringTool.trim(str);
  172. if (str == "")
  173. return true;
  174. return false;
  175. }
  176. static removeCommentLine(lines) {
  177. var rst;
  178. rst = [];
  179. var i;
  180. var tLine;
  181. var adptLine;
  182. i = 0;
  183. var len;
  184. var index;
  185. len = lines.length;
  186. while (i < len) {
  187. adptLine = tLine = lines[i];
  188. index = tLine.indexOf("/**");
  189. if (index >= 0) {
  190. adptLine = tLine.substring(0, index - 1);
  191. StringTool.addIfNotEmpty(rst, adptLine);
  192. while (i < len) {
  193. tLine = lines[i];
  194. index = tLine.indexOf("*/");
  195. if (index >= 0) {
  196. adptLine = tLine.substring(index + 2);
  197. StringTool.addIfNotEmpty(rst, adptLine);
  198. break;
  199. }
  200. i++;
  201. }
  202. }
  203. else if (tLine.indexOf("//") >= 0) {
  204. if (StringTool.trim(tLine).indexOf("//") == 0) ;
  205. else {
  206. StringTool.addIfNotEmpty(rst, adptLine);
  207. }
  208. }
  209. else {
  210. StringTool.addIfNotEmpty(rst, adptLine);
  211. }
  212. i++;
  213. }
  214. return rst;
  215. }
  216. static addIfNotEmpty(arr, str) {
  217. if (!str)
  218. return;
  219. var tStr;
  220. tStr = StringTool.trim(str);
  221. if (tStr != "") {
  222. arr.push(str);
  223. }
  224. }
  225. static trimExt(str, vars) {
  226. var rst;
  227. rst = StringTool.trim(str);
  228. var i;
  229. var len;
  230. len = vars.length;
  231. for (i = 0; i < len; i++) {
  232. rst = StringTool.getReplace(rst, vars[i], "");
  233. }
  234. return rst;
  235. }
  236. static getBetween(str, left, right, ifMax = false) {
  237. if (!str)
  238. return "";
  239. if (!left)
  240. return "";
  241. if (!right)
  242. return "";
  243. var lId;
  244. var rId;
  245. lId = str.indexOf(left);
  246. if (lId < 0)
  247. return "";
  248. if (ifMax) {
  249. rId = str.lastIndexOf(right);
  250. if (rId < lId)
  251. return "";
  252. }
  253. else {
  254. rId = str.indexOf(right, lId + 1);
  255. }
  256. if (rId < 0)
  257. return "";
  258. return str.substring(lId + left.length, rId);
  259. }
  260. static getSplitLine(line, split = " ") {
  261. return line.split(split);
  262. }
  263. static getLeft(str, sign) {
  264. var i;
  265. i = str.indexOf(sign);
  266. return str.substr(0, i);
  267. }
  268. static getRight(str, sign) {
  269. var i;
  270. i = str.indexOf(sign);
  271. return str.substr(i + 1);
  272. }
  273. static delelteItem(arr) {
  274. while (arr.length > 0) {
  275. if (arr[0] == "") {
  276. arr.shift();
  277. }
  278. else {
  279. break;
  280. }
  281. }
  282. }
  283. static getWords(line) {
  284. var rst = StringTool.getSplitLine(line);
  285. StringTool.delelteItem(rst);
  286. return rst;
  287. }
  288. static getLinesI(startLine, endLine, lines) {
  289. var i;
  290. var rst = [];
  291. for (i = startLine; i <= endLine; i++) {
  292. rst.push(lines[i]);
  293. }
  294. return rst;
  295. }
  296. static structfy(str, inWidth = 4, removeEmpty = true) {
  297. if (removeEmpty) {
  298. str = StringTool.trimEmptyLine(str);
  299. }
  300. var lines;
  301. var tIn;
  302. tIn = 0;
  303. var tInStr;
  304. tInStr = StringTool.getEmptyStr(0);
  305. lines = str.split("\n");
  306. var i;
  307. var len;
  308. var tLineStr;
  309. len = lines.length;
  310. for (i = 0; i < len; i++) {
  311. tLineStr = lines[i];
  312. tLineStr = StringTool.trimLeft(tLineStr);
  313. tLineStr = StringTool.trimRight(tLineStr);
  314. tIn += StringTool.getPariCount(tLineStr);
  315. if (tLineStr.indexOf("}") >= 0) {
  316. tInStr = StringTool.getEmptyStr(tIn * inWidth);
  317. }
  318. tLineStr = tInStr + tLineStr;
  319. lines[i] = tLineStr;
  320. tInStr = StringTool.getEmptyStr(tIn * inWidth);
  321. }
  322. return lines.join("\n");
  323. }
  324. static getEmptyStr(width) {
  325. if (!StringTool.emptyDic.hasOwnProperty(width)) {
  326. var i;
  327. var len;
  328. len = width;
  329. var rst;
  330. rst = "";
  331. for (i = 0; i < len; i++) {
  332. rst += " ";
  333. }
  334. StringTool.emptyDic[width] = rst;
  335. }
  336. return StringTool.emptyDic[width];
  337. }
  338. static getPariCount(str, inChar = "{", outChar = "}") {
  339. var varDic;
  340. varDic = {};
  341. varDic[inChar] = 1;
  342. varDic[outChar] = -1;
  343. var i;
  344. var len;
  345. var tChar;
  346. len = str.length;
  347. var rst;
  348. rst = 0;
  349. for (i = 0; i < len; i++) {
  350. tChar = str.charAt(i);
  351. if (varDic.hasOwnProperty(tChar)) {
  352. rst += varDic[tChar];
  353. }
  354. }
  355. return rst;
  356. }
  357. static readInt(str, startI = 0) {
  358. var rst;
  359. rst = 0;
  360. var tC;
  361. var i;
  362. var isBegin;
  363. isBegin = false;
  364. var len;
  365. len = str.length;
  366. for (i = startI; i < len; i++) {
  367. tC = str.charAt(i);
  368. if (Number(tC) > 0 || tC == "0") {
  369. rst = 10 * rst + Number(tC);
  370. if (rst > 0)
  371. isBegin = true;
  372. }
  373. else {
  374. if (isBegin)
  375. return rst;
  376. }
  377. }
  378. return rst;
  379. }
  380. static getReplace(str, oStr, nStr) {
  381. if (!str)
  382. return "";
  383. var rst;
  384. rst = str.replace(new RegExp(oStr, "g"), nStr);
  385. return rst;
  386. }
  387. static getWordCount(str, findWord) {
  388. var rg = new RegExp(findWord, "g");
  389. return str.match(rg).length;
  390. }
  391. static getResolvePath(path, basePath) {
  392. if (StringTool.isAbsPath(path)) {
  393. return path;
  394. }
  395. var tSign;
  396. tSign = "\\";
  397. if (basePath.indexOf("/") >= 0) {
  398. tSign = "/";
  399. }
  400. if (basePath.charAt(basePath.length - 1) == tSign) {
  401. basePath = basePath.substr(0, basePath.length - 1);
  402. }
  403. var parentSign;
  404. parentSign = ".." + tSign;
  405. var tISign;
  406. tISign = "." + tSign;
  407. var pCount;
  408. pCount = StringTool.getWordCount(path, parentSign);
  409. path = StringTool.getReplace(path, parentSign, "");
  410. path = StringTool.getReplace(path, tISign, "");
  411. var i;
  412. var len;
  413. len = pCount;
  414. for (i = 0; i < len; i++) {
  415. basePath = StringTool.removeLastSign(path, tSign);
  416. }
  417. return basePath + tSign + path;
  418. }
  419. static isAbsPath(path) {
  420. if (path.indexOf(":") >= 0)
  421. return true;
  422. return false;
  423. }
  424. static removeLastSign(str, sign) {
  425. var iPos;
  426. iPos = str.lastIndexOf(sign);
  427. str = str.substring(0, iPos);
  428. return str;
  429. }
  430. static getParamArr(str) {
  431. var paramStr;
  432. paramStr = StringTool.getBetween(str, "(", ")", true);
  433. if (StringTool.trim(paramStr).length < 1)
  434. return [];
  435. return paramStr.split(",");
  436. }
  437. static copyStr(str) {
  438. return str.substring(0);
  439. }
  440. static ArrayToString(arr) {
  441. var rst;
  442. rst = "[{items}]".replace(new RegExp("\\{items\\}", "g"), StringTool.getArrayItems(arr));
  443. return rst;
  444. }
  445. static getArrayItems(arr) {
  446. var rst;
  447. if (arr.length < 1)
  448. return "";
  449. rst = StringTool.parseItem(arr[0]);
  450. var i;
  451. var len;
  452. len = arr.length;
  453. for (i = 1; i < len; i++) {
  454. rst += "," + StringTool.parseItem(arr[i]);
  455. }
  456. return rst;
  457. }
  458. static parseItem(item) {
  459. return "";
  460. }
  461. static initAlphaSign() {
  462. if (StringTool.alphaSigns)
  463. return;
  464. StringTool.alphaSigns = {};
  465. StringTool.addSign("a", "z", StringTool.alphaSigns);
  466. StringTool.addSign("A", "Z", StringTool.alphaSigns);
  467. StringTool.addSign("0", "9", StringTool.alphaSigns);
  468. }
  469. static addSign(ss, e, tar) {
  470. var i;
  471. var len;
  472. var s;
  473. s = ss.charCodeAt(0);
  474. len = e.charCodeAt(0);
  475. for (i = s; i <= len; i++) {
  476. tar[String.fromCharCode(i)] = true;
  477. console.log("add :" + String.fromCharCode(i));
  478. }
  479. }
  480. static isPureAlphaNum(str) {
  481. StringTool.initAlphaSign();
  482. if (!str)
  483. return true;
  484. var i, len;
  485. len = str.length;
  486. for (i = 0; i < len; i++) {
  487. if (!StringTool.alphaSigns[str.charAt(i)])
  488. return false;
  489. }
  490. return true;
  491. }
  492. }
  493. StringTool.emptyStrDic = {
  494. " ": true,
  495. "\r": true,
  496. "\n": true,
  497. "\t": true
  498. };
  499. StringTool.specialChars = { "*": true, "&": true, "%": true, "#": true, "?": true };
  500. StringTool.emptyDic = {};
  501. StringTool.alphaSigns = null;
  502. class ObjectTools {
  503. constructor() {
  504. }
  505. static getFlatKey(tKey, aKey) {
  506. if (tKey == "")
  507. return aKey;
  508. return tKey + ObjectTools.sign + aKey;
  509. }
  510. static flatObj(obj, rst = null, tKey = "") {
  511. rst = rst ? rst : {};
  512. var key;
  513. var tValue;
  514. for (key in obj) {
  515. if (obj[key] instanceof Object) {
  516. ObjectTools.flatObj(obj[key], rst, ObjectTools.getFlatKey(tKey, key));
  517. }
  518. else {
  519. tValue = obj[key];
  520. rst[ObjectTools.getFlatKey(tKey, key)] = obj[key];
  521. }
  522. }
  523. return rst;
  524. }
  525. static recoverObj(obj) {
  526. var rst = {};
  527. var tKey;
  528. for (tKey in obj) {
  529. ObjectTools.setKeyValue(rst, tKey, obj[tKey]);
  530. }
  531. return rst;
  532. }
  533. static differ(objA, objB) {
  534. var tKey;
  535. objA = ObjectTools.flatObj(objA);
  536. objB = ObjectTools.flatObj(objB);
  537. var rst = {};
  538. for (tKey in objA) {
  539. if (!objB.hasOwnProperty(tKey)) {
  540. rst[tKey] = "被删除";
  541. }
  542. }
  543. for (tKey in objB) {
  544. if (objB[tKey] != objA[tKey]) {
  545. rst[tKey] = { "pre": objA[tKey], "now": objB[tKey] };
  546. }
  547. }
  548. return rst;
  549. }
  550. static traceDifferObj(obj) {
  551. var key;
  552. var tO;
  553. for (key in obj) {
  554. if (obj[key] instanceof String) {
  555. console.log(key + ":", obj[key]);
  556. }
  557. else {
  558. tO = obj[key];
  559. console.log(key + ":", "now:", tO["now"], "pre:", tO["pre"]);
  560. }
  561. }
  562. }
  563. static setKeyValue(obj, flatKey, value) {
  564. if (flatKey.indexOf(ObjectTools.sign) >= 0) {
  565. var keys = flatKey.split(ObjectTools.sign);
  566. var tKey;
  567. while (keys.length > 1) {
  568. tKey = keys.shift();
  569. if (!obj[tKey]) {
  570. obj[tKey] = {};
  571. console.log("addKeyObj:", tKey);
  572. }
  573. obj = obj[tKey];
  574. if (!obj) {
  575. console.log("wrong flatKey:", flatKey);
  576. return;
  577. }
  578. }
  579. obj[keys.shift()] = value;
  580. }
  581. else {
  582. obj[flatKey] = value;
  583. }
  584. }
  585. static clearObj(obj) {
  586. var key;
  587. for (key in obj) {
  588. delete obj[key];
  589. }
  590. }
  591. static copyObjFast(obj) {
  592. var jsStr;
  593. jsStr = ObjectTools.getJsonString(obj);
  594. return ObjectTools.getObj(jsStr);
  595. }
  596. static copyObj(obj) {
  597. if (obj instanceof Array)
  598. return ObjectTools.copyArr(obj);
  599. var rst = {};
  600. var key;
  601. for (key in obj) {
  602. if (obj[key] === null || obj[key] === undefined) {
  603. rst[key] = obj[key];
  604. }
  605. else if (obj[key] instanceof Array) {
  606. rst[key] = ObjectTools.copyArr(obj[key]);
  607. }
  608. else if (obj[key] instanceof Object) {
  609. rst[key] = ObjectTools.copyObj(obj[key]);
  610. }
  611. else {
  612. rst[key] = obj[key];
  613. }
  614. }
  615. return rst;
  616. }
  617. static copyArr(arr) {
  618. var rst;
  619. rst = [];
  620. var i, len;
  621. len = arr.length;
  622. for (i = 0; i < len; i++) {
  623. rst.push(ObjectTools.copyObj(arr[i]));
  624. }
  625. return rst;
  626. }
  627. static concatArr(src, a) {
  628. if (!a)
  629. return src;
  630. if (!src)
  631. return a;
  632. var i, len = a.length;
  633. for (i = 0; i < len; i++) {
  634. src.push(a[i]);
  635. }
  636. return src;
  637. }
  638. static insertArrToArr(src, insertArr, pos = 0) {
  639. if (pos < 0)
  640. pos = 0;
  641. if (pos > src.length)
  642. pos = src.length;
  643. var preLen = src.length;
  644. var i, len;
  645. src.length += insertArr.length;
  646. var moveLen;
  647. moveLen = insertArr.length;
  648. for (i = src.length - 1; i >= pos; i--) {
  649. src[i] = src[i - moveLen];
  650. }
  651. len = insertArr.length;
  652. for (i = 0; i < len; i++) {
  653. src[pos + i] = insertArr[i];
  654. }
  655. return src;
  656. }
  657. static clearArr(arr) {
  658. if (!arr)
  659. return arr;
  660. arr.length = 0;
  661. return arr;
  662. }
  663. static removeFromArr(arr, item) {
  664. var i, len;
  665. len = arr.length;
  666. for (i = 0; i < len; i++) {
  667. if (arr[i] == item) {
  668. arr[i].splice(i, 1);
  669. return;
  670. }
  671. }
  672. }
  673. static setValueArr(src, v) {
  674. src || (src = []);
  675. src.length = 0;
  676. return ObjectTools.concatArr(src, v);
  677. }
  678. static getFrom(rst, src, count) {
  679. var i;
  680. for (i = 0; i < count; i++) {
  681. rst.push(src[i]);
  682. }
  683. return rst;
  684. }
  685. static getFromR(rst, src, count) {
  686. var i;
  687. for (i = 0; i < count; i++) {
  688. rst.push(src.pop());
  689. }
  690. return rst;
  691. }
  692. static enableDisplayTree(dis) {
  693. while (dis) {
  694. dis.mouseEnabled = true;
  695. dis = dis.parent;
  696. }
  697. }
  698. static getJsonString(obj) {
  699. var rst;
  700. rst = JSON.stringify(obj);
  701. return rst;
  702. }
  703. static getObj(jsonStr) {
  704. var rst;
  705. rst = JSON.parse(jsonStr);
  706. return rst;
  707. }
  708. static getKeyArr(obj) {
  709. var rst;
  710. var key;
  711. rst = [];
  712. for (key in obj) {
  713. rst.push(key);
  714. }
  715. return rst;
  716. }
  717. static getObjValues(dataList, key) {
  718. var rst;
  719. var i, len;
  720. len = dataList.length;
  721. rst = [];
  722. for (i = 0; i < len; i++) {
  723. rst.push(dataList[i][key]);
  724. }
  725. return rst;
  726. }
  727. static hasKeys(obj, keys) {
  728. var i, len;
  729. len = keys.length;
  730. for (i = 0; i < len; i++) {
  731. if (!obj.hasOwnProperty(keys[i]))
  732. return false;
  733. }
  734. return true;
  735. }
  736. static copyValueByArr(tar, src, keys) {
  737. var i, len = keys.length;
  738. for (i = 0; i < len; i++) {
  739. if (!(src[keys[i]] === null))
  740. tar[keys[i]] = src[keys[i]];
  741. }
  742. }
  743. static getNoSameArr(arr) {
  744. var i, len;
  745. var rst;
  746. rst = [];
  747. var tItem;
  748. len = arr.length;
  749. for (i = 0; i < len; i++) {
  750. tItem = arr[i];
  751. if (rst.indexOf(tItem) < 0) {
  752. rst.push(tItem);
  753. }
  754. }
  755. return rst;
  756. }
  757. static insertValue(tar, src) {
  758. var key;
  759. for (key in src) {
  760. tar[key] = src[key];
  761. }
  762. }
  763. static replaceValue(obj, replaceO) {
  764. var key;
  765. for (key in obj) {
  766. if (replaceO.hasOwnProperty(obj[key])) {
  767. obj[key] = replaceO[obj[key]];
  768. }
  769. if (obj[key] instanceof Object) {
  770. ObjectTools.replaceValue(obj[key], replaceO);
  771. }
  772. }
  773. }
  774. static setKeyValues(items, key, value) {
  775. var i, len;
  776. len = items.length;
  777. for (i = 0; i < len; i++) {
  778. items[i][key] = value;
  779. }
  780. }
  781. static findItemPos(items, sign, value) {
  782. var i, len;
  783. len = items.length;
  784. for (i = 0; i < len; i++) {
  785. if (items[i][sign] == value) {
  786. return i;
  787. }
  788. }
  789. return -1;
  790. }
  791. static setObjValue(obj, key, value) {
  792. obj[key] = value;
  793. return obj;
  794. }
  795. static setAutoTypeValue(obj, key, value) {
  796. if (obj.hasOwnProperty(key)) {
  797. if (ObjectTools.isNumber(obj[key])) {
  798. obj[key] = parseFloat(value);
  799. }
  800. else {
  801. obj[key] = value;
  802. }
  803. }
  804. else {
  805. obj[key] = value;
  806. }
  807. return obj;
  808. }
  809. static getAutoValue(value) {
  810. var tFloat = parseFloat(value);
  811. if (typeof (value) == "string") {
  812. if (tFloat + "" === StringTool.trimSide(value))
  813. return tFloat;
  814. }
  815. return value;
  816. }
  817. static isNumber(value) {
  818. return (parseFloat(value) == value);
  819. }
  820. static isNaNS(value) {
  821. return (value.toString() == "NaN");
  822. }
  823. static isNaN(value) {
  824. if (typeof (value) == "number")
  825. return false;
  826. if (typeof (value) == "string") {
  827. if (parseFloat(value).toString() != "NaN") {
  828. return false;
  829. }
  830. }
  831. return true;
  832. }
  833. static getStrTypedValue(value) {
  834. if (value == "false") {
  835. return false;
  836. }
  837. else if (value == "true") {
  838. return true;
  839. }
  840. else if (value == "null") {
  841. return null;
  842. }
  843. else if (value == "undefined") {
  844. return null;
  845. }
  846. else {
  847. return ObjectTools.getAutoValue(value);
  848. }
  849. }
  850. static createKeyValueDic(dataList, keySign) {
  851. var rst;
  852. rst = {};
  853. var i, len;
  854. len = dataList.length;
  855. var tItem;
  856. var tKey;
  857. for (i = 0; i < len; i++) {
  858. tItem = dataList[i];
  859. tKey = tItem[keySign];
  860. rst[tKey] = tItem;
  861. }
  862. return rst;
  863. }
  864. }
  865. ObjectTools.sign = "_";
  866. class ClassTool {
  867. constructor() {
  868. }
  869. static defineProperty(obj, name, des) {
  870. Object.defineProperty(obj, name, des);
  871. }
  872. static getOwnPropertyDescriptor(obj, name) {
  873. var rst;
  874. rst = Object.getOwnPropertyDescriptor(obj, name);
  875. return rst;
  876. }
  877. static getOwnPropertyDescriptors(obj) {
  878. var rst;
  879. rst = Object.getOwnPropertyDescriptors(obj);
  880. return rst;
  881. }
  882. static getOwnPropertyNames(obj) {
  883. var rst;
  884. rst = Object.getOwnPropertyNames(obj);
  885. return rst;
  886. }
  887. static getObjectGetSetKeys(obj, rst = null) {
  888. if (!rst)
  889. rst = [];
  890. var keys;
  891. keys = ClassTool.getOwnPropertyNames(obj);
  892. var key;
  893. for (key in keys) {
  894. key = keys[key];
  895. if (key.indexOf("_$get_") >= 0) {
  896. key = key.replace("_$get_", "");
  897. rst.push(key);
  898. }
  899. }
  900. if (obj["__proto__"]) {
  901. ClassTool.getObjectGetSetKeys(obj["__proto__"], rst);
  902. }
  903. return rst;
  904. }
  905. static getObjectDisplayAbleKeys(obj, rst = null) {
  906. if (!rst)
  907. rst = [];
  908. for (let key in obj) {
  909. let tValue = obj[key];
  910. let tType = typeof (tValue);
  911. if (key.charAt(0) == "_" || !this.displayTypes[tType])
  912. continue;
  913. rst.push(key);
  914. }
  915. let temp = obj;
  916. while (temp) {
  917. let descript = Object.getOwnPropertyDescriptors(temp);
  918. for (let element in descript) {
  919. let tValue = descript[element];
  920. if (!tValue.get)
  921. continue;
  922. rst.push(element);
  923. }
  924. temp = Object.getPrototypeOf(temp);
  925. }
  926. ClassTool.getObjectGetSetKeys(obj, rst);
  927. rst = ObjectTools.getNoSameArr(rst);
  928. return rst;
  929. }
  930. static getClassName(tar) {
  931. if (tar instanceof Function)
  932. return tar.name;
  933. return tar["constructor"].name;
  934. }
  935. static getNodeClassAndName(tar) {
  936. if (!tar)
  937. return "null";
  938. var rst;
  939. if (tar.name) {
  940. rst = ClassTool.getClassName(tar) + "(" + tar.name + ")";
  941. }
  942. else {
  943. rst = ClassTool.getClassName(tar);
  944. }
  945. return rst;
  946. }
  947. static getClassNameByClz(clz) {
  948. return clz["name"];
  949. }
  950. static getClassByName(className) {
  951. var rst;
  952. rst = window["eval"](className);
  953. return rst;
  954. }
  955. static createObjByName(className) {
  956. var clz;
  957. clz = ClassTool.getClassByName(className);
  958. return new clz();
  959. }
  960. }
  961. ClassTool.displayTypes = { "boolean": true, "number": true, "string": true };
  962. class TraceTool {
  963. constructor() {
  964. }
  965. static closeAllLog() {
  966. var logFun;
  967. logFun = TraceTool.emptyLog;
  968. Laya.Browser.window.console.log = logFun;
  969. }
  970. static emptyLog() {
  971. }
  972. static traceObj(obj) {
  973. TraceTool.tempArr.length = 0;
  974. var key;
  975. for (key in obj) {
  976. TraceTool.tempArr.push(key + ":" + obj[key]);
  977. }
  978. var rst;
  979. rst = TraceTool.tempArr.join("\n");
  980. console.log(rst);
  981. return rst;
  982. }
  983. static traceObjR(obj) {
  984. TraceTool.tempArr.length = 0;
  985. var key;
  986. for (key in obj) {
  987. TraceTool.tempArr.push(obj[key] + ":" + key);
  988. }
  989. var rst;
  990. rst = TraceTool.tempArr.join("\n");
  991. console.log(rst);
  992. return rst;
  993. }
  994. static traceSize(tar) {
  995. TraceTool._debugtrace("Size: x:" + tar.x + " y:" + tar.y + " w:" + tar.width + " h:" + tar.height + " scaleX:" + tar.scaleX + " scaleY:" + tar.scaleY);
  996. }
  997. static traceSplit(msg) {
  998. console.log("---------------------" + msg + "---------------------------");
  999. }
  1000. static group(gName) {
  1001. console.group(gName);
  1002. }
  1003. static groupEnd() {
  1004. console.groupEnd();
  1005. }
  1006. static getCallStack(life = 1, s = 1) {
  1007. var caller;
  1008. caller = TraceTool.getCallStack;
  1009. caller = caller.caller.caller;
  1010. var msg;
  1011. msg = "";
  1012. while (caller && life > 0) {
  1013. if (s <= 0) {
  1014. msg += caller + "<-";
  1015. life--;
  1016. }
  1017. caller = caller.caller;
  1018. s--;
  1019. }
  1020. return msg;
  1021. }
  1022. static getCallLoc(index = 2) {
  1023. var loc;
  1024. try {
  1025. TraceTool.Erroer.i++;
  1026. }
  1027. catch (e) {
  1028. var arr;
  1029. arr = this.e.stack.replace(/Error\n/).split(/\n/);
  1030. if (arr[index]) {
  1031. loc = arr[index].replace(/^\s+|\s+$/, "");
  1032. }
  1033. else {
  1034. loc = "unknow";
  1035. }
  1036. }
  1037. return loc;
  1038. }
  1039. static traceCallStack() {
  1040. var loc;
  1041. try {
  1042. TraceTool.Erroer.i++;
  1043. }
  1044. catch (e) {
  1045. loc = this.e.stack;
  1046. }
  1047. console.log(loc);
  1048. return loc;
  1049. }
  1050. static getPlaceHolder(len) {
  1051. if (!TraceTool.holderDic.hasOwnProperty(len)) {
  1052. var rst;
  1053. rst = "";
  1054. var i;
  1055. for (i = 0; i < len; i++) {
  1056. rst += "-";
  1057. }
  1058. TraceTool.holderDic[len] = rst;
  1059. }
  1060. return TraceTool.holderDic[len];
  1061. }
  1062. static traceTree(tar, depth = 0, isFirst = true) {
  1063. if (isFirst) {
  1064. console.log("traceTree");
  1065. }
  1066. if (!tar)
  1067. return;
  1068. var i;
  1069. var len;
  1070. if (tar.numChildren < 1) {
  1071. console.log(tar);
  1072. return;
  1073. }
  1074. TraceTool.group(tar);
  1075. len = tar.numChildren;
  1076. depth++;
  1077. for (i = 0; i < len; i++) {
  1078. TraceTool.traceTree(tar.getChildAt(i), depth, false);
  1079. }
  1080. TraceTool.groupEnd();
  1081. }
  1082. static getClassName(tar) {
  1083. return tar["constructor"].name;
  1084. }
  1085. static traceSpriteInfo(tar, showBounds = true, showSize = true, showTree = true) {
  1086. if (!(tar instanceof Laya.Sprite)) {
  1087. console.log("not Sprite");
  1088. return;
  1089. }
  1090. if (!tar) {
  1091. console.log("null Sprite");
  1092. return;
  1093. }
  1094. TraceTool.traceSplit("traceSpriteInfo");
  1095. TraceTool._debugtrace(TraceTool.getClassName(tar) + ":" + tar.name);
  1096. if (showTree) {
  1097. TraceTool.traceTree(tar);
  1098. }
  1099. else {
  1100. console.log(tar);
  1101. }
  1102. if (showSize) {
  1103. TraceTool.traceSize(tar);
  1104. }
  1105. if (showBounds) {
  1106. console.log("bounds:" + tar.getBounds());
  1107. }
  1108. }
  1109. }
  1110. TraceTool.tempArr = [];
  1111. TraceTool.Erroer = null;
  1112. TraceTool.holderDic = {};
  1113. class CountTool {
  1114. constructor() {
  1115. this.data = {};
  1116. this.preO = {};
  1117. this.changeO = {};
  1118. }
  1119. reset() {
  1120. this.data = {};
  1121. this.count = 0;
  1122. }
  1123. add(name, num = 1) {
  1124. this.count++;
  1125. if (!this.data.hasOwnProperty(name)) {
  1126. this.data[name] = 0;
  1127. }
  1128. this.data[name] = this.data[name] + num;
  1129. }
  1130. getKeyCount(key) {
  1131. if (!this.data.hasOwnProperty(key)) {
  1132. this.data[key] = 0;
  1133. }
  1134. return this.data[key];
  1135. }
  1136. getKeyChange(key) {
  1137. if (!this.changeO[key])
  1138. return 0;
  1139. return this.changeO[key];
  1140. }
  1141. record() {
  1142. var key;
  1143. for (key in this.changeO) {
  1144. this.changeO[key] = 0;
  1145. }
  1146. for (key in this.data) {
  1147. if (!this.preO[key])
  1148. this.preO[key] = 0;
  1149. this.changeO[key] = this.data[key] - this.preO[key];
  1150. this.preO[key] = this.data[key];
  1151. }
  1152. }
  1153. getCount(dataO) {
  1154. var rst = 0;
  1155. var key;
  1156. for (key in dataO) {
  1157. rst += dataO[key];
  1158. }
  1159. return rst;
  1160. }
  1161. traceSelf(dataO = null) {
  1162. if (!dataO)
  1163. dataO = this.data;
  1164. var tCount;
  1165. tCount = this.getCount(dataO);
  1166. console.log("total:" + tCount);
  1167. return "total:" + tCount + "\n" + TraceTool.traceObj(dataO);
  1168. }
  1169. traceSelfR(dataO = null) {
  1170. if (!dataO)
  1171. dataO = this.data;
  1172. var tCount;
  1173. tCount = this.getCount(dataO);
  1174. console.log("total:" + tCount);
  1175. return "total:" + tCount + "\n" + TraceTool.traceObjR(dataO);
  1176. }
  1177. }
  1178. class RecInfo {
  1179. constructor() {
  1180. this.oX = 0;
  1181. this.oY = 0;
  1182. this.hX = 1;
  1183. this.hY = 0;
  1184. this.vX = 0;
  1185. this.vY = 1;
  1186. }
  1187. get x() {
  1188. return this.oX;
  1189. }
  1190. get y() {
  1191. return this.oY;
  1192. }
  1193. get width() {
  1194. return Math.sqrt((this.hX - this.oX) * (this.hX - this.oX) + (this.hY - this.oY) * (this.hY - this.oY));
  1195. }
  1196. get height() {
  1197. return Math.sqrt((this.vX - this.oX) * (this.vX - this.oX) + (this.vY - this.oY) * (this.vY - this.oY));
  1198. }
  1199. get rotation() {
  1200. return this.rotationRad / Math.PI * 180;
  1201. }
  1202. get rotationRad() {
  1203. var dx = this.hX - this.oX;
  1204. var dy = this.hY - this.oY;
  1205. return Math.atan2(dy, dx);
  1206. }
  1207. get rotationV() {
  1208. return this.rotationRadV / Math.PI * 180;
  1209. }
  1210. get rotationRadV() {
  1211. var dx = this.vX - this.oX;
  1212. var dy = this.vY - this.oY;
  1213. return Math.atan2(dy, dx);
  1214. }
  1215. initByPoints(oPoint, ePoint, vPoint) {
  1216. this.oX = oPoint.x;
  1217. this.oY = oPoint.y;
  1218. this.hX = ePoint.x;
  1219. this.hY = ePoint.y;
  1220. this.vX = vPoint.x;
  1221. this.vY = vPoint.y;
  1222. }
  1223. static createByPoints(oPoint, ePoint, vPoint) {
  1224. var rst;
  1225. rst = new RecInfo();
  1226. rst.initByPoints(oPoint, ePoint, vPoint);
  1227. return rst;
  1228. }
  1229. static getGlobalPoints(sprite, x, y) {
  1230. return sprite.localToGlobal(new Laya.Point(x, y));
  1231. }
  1232. static getGlobalRecInfo(sprite, x0 = 0, y0 = 0, x1 = 1, y1 = 0, x2 = 0, y2 = 1) {
  1233. return RecInfo.createByPoints(RecInfo.getGlobalPoints(sprite, x0, y0), RecInfo.getGlobalPoints(sprite, x1, y1), RecInfo.getGlobalPoints(sprite, x2, y2));
  1234. }
  1235. }
  1236. class SimpleResizer {
  1237. constructor() {
  1238. }
  1239. static setResizeAble(clickItem, tar, minWidth = 150, minHeight = 150) {
  1240. clickItem.on(Laya.Event.MOUSE_DOWN, null, SimpleResizer.onMouseDown, [tar, minWidth, minHeight]);
  1241. }
  1242. static onMouseDown(tar, minWidth, minHeight, e) {
  1243. SimpleResizer.clearEvents();
  1244. if (!tar)
  1245. return;
  1246. SimpleResizer.preMousePoint.setTo(Laya.Laya.stage.mouseX, Laya.Laya.stage.mouseY);
  1247. SimpleResizer.preTarSize.setTo(tar.width, tar.height);
  1248. SimpleResizer.preScale.setTo(1, 1);
  1249. var rTar;
  1250. rTar = tar;
  1251. while (rTar && rTar != Laya.Laya.stage) {
  1252. SimpleResizer.preScale.x *= rTar.scaleX;
  1253. SimpleResizer.preScale.y *= rTar.scaleY;
  1254. rTar = rTar.parent;
  1255. }
  1256. Laya.Laya.stage.on(Laya.Event.MOUSE_UP, null, SimpleResizer.onMouseMoveEnd);
  1257. Laya.Laya.timer.loop(100, null, SimpleResizer.onMouseMoving, [tar, minWidth, minHeight]);
  1258. }
  1259. static onMouseMoving(tar, minWidth, minHeight, e) {
  1260. var tWidth = (Laya.Laya.stage.mouseX - SimpleResizer.preMousePoint.x) / SimpleResizer.preScale.x + SimpleResizer.preTarSize.x;
  1261. var tHeight = (Laya.Laya.stage.mouseY - SimpleResizer.preMousePoint.y) / SimpleResizer.preScale.y + SimpleResizer.preTarSize.y;
  1262. tar.width = tWidth > minWidth ? tWidth : minWidth;
  1263. tar.height = tHeight > minHeight ? tHeight : minHeight;
  1264. }
  1265. static onMouseMoveEnd(e) {
  1266. SimpleResizer.clearEvents();
  1267. }
  1268. static clearEvents() {
  1269. Laya.Laya.timer.clear(null, SimpleResizer.onMouseMoving);
  1270. Laya.Laya.stage.off(Laya.Event.MOUSE_UP, null, SimpleResizer.onMouseMoveEnd);
  1271. }
  1272. }
  1273. SimpleResizer.preMousePoint = new Laya.Point();
  1274. SimpleResizer.preTarSize = new Laya.Point();
  1275. SimpleResizer.preScale = new Laya.Point();
  1276. class DisControlTool {
  1277. constructor() {
  1278. }
  1279. static getObjectsUnderPoint(sprite, x, y, rst = null, filterFun = null) {
  1280. rst = rst ? rst : [];
  1281. if (filterFun != null && !filterFun(sprite))
  1282. return rst;
  1283. if (sprite.getBounds().contains(x, y)) {
  1284. rst.push(sprite);
  1285. var tempP = new Laya.Point();
  1286. tempP.setTo(x, y);
  1287. tempP = sprite.fromParentPoint(tempP);
  1288. x = tempP.x;
  1289. y = tempP.y;
  1290. for (var i = sprite._children.length - 1; i > -1; i--) {
  1291. var child = sprite._children[i];
  1292. if (child instanceof Laya.Sprite)
  1293. DisControlTool.getObjectsUnderPoint(child, x, y, rst, filterFun);
  1294. }
  1295. }
  1296. return rst;
  1297. }
  1298. static getObjectsUnderGlobalPoint(sprite, filterFun = null) {
  1299. var point = new Laya.Point();
  1300. point.setTo(Laya.Laya.stage.mouseX, Laya.Laya.stage.mouseY);
  1301. if (sprite.parent)
  1302. point = sprite.parent.globalToLocal(point);
  1303. return DisControlTool.getObjectsUnderPoint(sprite, point.x, point.y, null, filterFun);
  1304. }
  1305. static findFirstObjectsUnderGlobalPoint() {
  1306. var disList;
  1307. disList = DisControlTool.getObjectsUnderGlobalPoint(Laya.Laya.stage);
  1308. if (!disList)
  1309. return null;
  1310. var i, len;
  1311. var tDis;
  1312. len = disList.length;
  1313. for (i = len - 1; i >= 0; i--) {
  1314. tDis = disList[i];
  1315. if (tDis && tDis.numChildren < 1) {
  1316. return tDis;
  1317. }
  1318. }
  1319. return tDis;
  1320. }
  1321. static visibleAndEnableObjFun(tar) {
  1322. return tar.visible && tar.mouseEnabled;
  1323. }
  1324. static visibleObjFun(tar) {
  1325. return tar.visible;
  1326. }
  1327. static getMousePoint(sprite) {
  1328. var point = new Laya.Point();
  1329. point.setTo(Laya.Laya.stage.mouseX, Laya.Laya.stage.mouseY);
  1330. point = sprite.globalToLocal(point);
  1331. return point;
  1332. }
  1333. static isChildE(parent, child) {
  1334. if (!parent)
  1335. return false;
  1336. while (child) {
  1337. if (child.parent == parent)
  1338. return true;
  1339. child = child.parent;
  1340. }
  1341. return false;
  1342. }
  1343. static isInTree(pNode, child) {
  1344. return pNode == child || DisControlTool.isChildE(pNode, child);
  1345. }
  1346. static setTop(tar) {
  1347. if (tar && tar.parent) {
  1348. var tParent;
  1349. tParent = tar.parent;
  1350. tParent.setChildIndex(tar, tParent.numChildren - 1);
  1351. }
  1352. }
  1353. static clearItemRelativeInfo(item) {
  1354. var Nan = "NaN";
  1355. item.getLayout().left = Nan;
  1356. item.getLayout().right = Nan;
  1357. item.getLayout().top = Nan;
  1358. item.getLayout().bottom = Nan;
  1359. }
  1360. static swap(tarA, tarB) {
  1361. if (tarA == tarB)
  1362. return;
  1363. var iA;
  1364. iA = tarA.parent.getChildIndex(tarA);
  1365. var iB;
  1366. iB = tarB.parent.getChildIndex(tarB);
  1367. var bP;
  1368. bP = tarB.parent;
  1369. tarA.parent.addChildAt(tarB, iA);
  1370. bP.addChildAt(tarA, iB);
  1371. }
  1372. static insertToTarParent(tarA, tars, after = false) {
  1373. var tIndex;
  1374. var parent;
  1375. if (!tarA)
  1376. return;
  1377. parent = tarA.parent;
  1378. if (!parent)
  1379. return;
  1380. tIndex = parent.getChildIndex(tarA);
  1381. if (after)
  1382. tIndex++;
  1383. DisControlTool.insertToParent(parent, tars, tIndex);
  1384. }
  1385. static insertToParent(parent, tars, index = -1) {
  1386. if (!parent)
  1387. return;
  1388. if (index < 0)
  1389. index = parent.numChildren;
  1390. var i, len;
  1391. len = tars.length;
  1392. for (i = 0; i < len; i++) {
  1393. DisControlTool.transParent(tars[i], parent);
  1394. parent.addChildAt(tars[i], index);
  1395. }
  1396. }
  1397. static transParent(tar, newParent) {
  1398. if (!tar || !newParent)
  1399. return;
  1400. if (!tar.parent)
  1401. return;
  1402. var preParent;
  1403. preParent = tar.parent;
  1404. var pos;
  1405. pos = new Laya.Point(tar.x, tar.y);
  1406. pos = preParent.localToGlobal(pos);
  1407. pos = newParent.globalToLocal(pos);
  1408. tar.pos(pos.x, pos.y);
  1409. }
  1410. static transPoint(nowParent, tarParent, point) {
  1411. point = nowParent.localToGlobal(point);
  1412. point = tarParent.globalToLocal(point);
  1413. return point;
  1414. }
  1415. static removeItems(itemList) {
  1416. var i, len;
  1417. len = itemList.length;
  1418. for (i = 0; i < len; i++) {
  1419. itemList[i].removeSelf();
  1420. }
  1421. }
  1422. static addItems(itemList, parent) {
  1423. var i, len;
  1424. len = itemList.length;
  1425. for (i = 0; i < len; i++) {
  1426. parent.addChild(itemList[i]);
  1427. }
  1428. }
  1429. static getAllChild(tar) {
  1430. if (!tar)
  1431. return [];
  1432. var i;
  1433. var len;
  1434. var rst = [];
  1435. len = tar.numChildren;
  1436. for (i = 0; i < len; i++) {
  1437. rst.push(tar.getChildAt(i));
  1438. }
  1439. return rst;
  1440. }
  1441. static upDis(child) {
  1442. if (child && child.parent) {
  1443. var tParent;
  1444. tParent = child.parent;
  1445. var newIndex;
  1446. newIndex = tParent.getChildIndex(child) + 1;
  1447. if (newIndex >= tParent.numChildren) {
  1448. newIndex = tParent.numChildren - 1;
  1449. }
  1450. console.log("setChildIndex:" + newIndex);
  1451. tParent.setChildIndex(child, newIndex);
  1452. }
  1453. }
  1454. static downDis(child) {
  1455. if (child && child.parent) {
  1456. var tParent;
  1457. tParent = child.parent;
  1458. var newIndex;
  1459. newIndex = tParent.getChildIndex(child) - 1;
  1460. if (newIndex < 0)
  1461. newIndex = 0;
  1462. console.log("setChildIndex:" + newIndex);
  1463. tParent.setChildIndex(child, newIndex);
  1464. }
  1465. }
  1466. static setResizeAbleEx(node) {
  1467. var clickItem;
  1468. clickItem = node.getChildByName("resizeBtn");
  1469. if (clickItem) {
  1470. SimpleResizer.setResizeAble(clickItem, node);
  1471. }
  1472. }
  1473. static setResizeAble(node) {
  1474. node.on(Laya.Event.CLICK, null, DisControlTool.resizeHandler, [node]);
  1475. }
  1476. static setDragingItem(dragBar, tar) {
  1477. dragBar.on(Laya.Event.MOUSE_DOWN, null, DisControlTool.dragingHandler, [tar]);
  1478. tar.on(Laya.Event.DRAG_END, null, DisControlTool.dragingEnd, [tar]);
  1479. }
  1480. static dragingHandler(tar) {
  1481. if (tar) {
  1482. tar.startDrag();
  1483. }
  1484. }
  1485. static dragingEnd(tar) {
  1486. DisControlTool.intFyDisPos(tar);
  1487. console.log(tar.x, tar.y);
  1488. }
  1489. static showToStage(dis, offX = 0, offY = 0) {
  1490. var rec = dis.getBounds();
  1491. dis.x = Laya.Laya.stage.mouseX + offX;
  1492. dis.y = Laya.Laya.stage.mouseY + offY;
  1493. if (dis.x + rec.width > Laya.Laya.stage.width) {
  1494. dis.x -= rec.width + offX;
  1495. }
  1496. if (dis.y + rec.height > Laya.Laya.stage.height) {
  1497. dis.y -= rec.height + offY;
  1498. }
  1499. DisControlTool.intFyDisPos(dis);
  1500. }
  1501. static intFyDisPos(dis) {
  1502. if (!dis)
  1503. return;
  1504. dis.x = Math.round(dis.x);
  1505. dis.y = Math.round(dis.y);
  1506. }
  1507. static showOnly(disList, showItem) {
  1508. var i, len;
  1509. len = disList.length;
  1510. for (i = 0; i < len; i++) {
  1511. disList[i].visible = disList[i] == showItem;
  1512. }
  1513. }
  1514. static showOnlyByIndex(disList, index) {
  1515. DisControlTool.showOnly(disList, disList[index]);
  1516. }
  1517. static addOnly(disList, showItem, parent) {
  1518. var i, len;
  1519. len = disList.length;
  1520. for (i = 0; i < len; i++) {
  1521. if (disList[i] != showItem) {
  1522. disList[i].removeSelf();
  1523. }
  1524. else {
  1525. parent.addChild(disList[i]);
  1526. }
  1527. }
  1528. }
  1529. static addOnlyByIndex(disList, index, parent) {
  1530. DisControlTool.addOnly(disList, disList[index], parent);
  1531. }
  1532. }
  1533. DisControlTool.tempP = new Laya.Point();
  1534. class Rect extends Laya.Sprite {
  1535. constructor() {
  1536. super();
  1537. this.recWidth = 10;
  1538. this.drawMe();
  1539. }
  1540. drawMe() {
  1541. var g;
  1542. g = this.graphics;
  1543. g.clear();
  1544. g.drawRect(0, 0, this.recWidth, this.recWidth, "#22ff22");
  1545. this.size(this.recWidth, this.recWidth);
  1546. }
  1547. posTo(x, y) {
  1548. this.x = x - this.recWidth * 0.5;
  1549. this.y = y - this.recWidth * 0.5;
  1550. }
  1551. }
  1552. class ValueChanger {
  1553. constructor() {
  1554. this.preValue = 0;
  1555. }
  1556. get value() {
  1557. if (this.target) {
  1558. this._tValue = this.target[this.key];
  1559. }
  1560. return this._tValue;
  1561. }
  1562. set value(nValue) {
  1563. this._tValue = nValue;
  1564. if (this.target) {
  1565. this.target[this.key] = nValue;
  1566. }
  1567. }
  1568. get dValue() {
  1569. return this.value - this.preValue;
  1570. }
  1571. get scaleValue() {
  1572. return this.value / this.preValue;
  1573. }
  1574. record() {
  1575. this.preValue = this.value;
  1576. }
  1577. showValueByAdd(addValue) {
  1578. this.value = this.preValue + addValue;
  1579. }
  1580. showValueByScale(scale) {
  1581. this.value = this.preValue * scale;
  1582. }
  1583. recover() {
  1584. this.value = this.preValue;
  1585. }
  1586. dispose() {
  1587. this.target = null;
  1588. }
  1589. static create(target, key) {
  1590. var rst;
  1591. rst = new ValueChanger();
  1592. rst.target = target;
  1593. rst.key = key;
  1594. return rst;
  1595. }
  1596. }
  1597. class ArrowLine extends Laya.Sprite {
  1598. constructor(sign = "X") {
  1599. super();
  1600. this.lineLen = 160;
  1601. this.arrowLen = 10;
  1602. this.lenControl = new Rect();
  1603. this.rotationControl = new Rect();
  1604. this.sign = "Y";
  1605. this.lenChanger = ValueChanger.create(this, "lineLen");
  1606. this.lenControlXChanger = ValueChanger.create(this.lenControl, "x");
  1607. this._isMoving = false;
  1608. this.sign = sign;
  1609. this.addChild(this.lenControl);
  1610. this.addChild(this.rotationControl);
  1611. this.lenControl.on(Laya.Event.MOUSE_DOWN, this, this.controlMouseDown);
  1612. this.drawMe();
  1613. }
  1614. drawMe() {
  1615. var g;
  1616. g = this.graphics;
  1617. g.clear();
  1618. g.drawLine(0, 0, this.lineLen, 0, "#ffff00");
  1619. g.drawLine(this.lineLen, 0, this.lineLen - this.arrowLen, -this.arrowLen, "#ff0000");
  1620. g.drawLine(this.lineLen, 0, this.lineLen - this.arrowLen, this.arrowLen, "#ff0000");
  1621. g.fillText(this.sign, 50, -5, "", "#ff0000", "left");
  1622. if (this._isMoving && this._targetChanger) {
  1623. g.fillText(this._targetChanger.key + ":" + this._targetChanger.value.toFixed(2), this.lineLen - 15, -25, "", "#ffff00", "center");
  1624. }
  1625. this.lenControl.posTo(this.lineLen - 15, 0);
  1626. this.rotationControl.posTo(this.lineLen + 10, 0);
  1627. this.size(this.arrowLen, this.lineLen);
  1628. }
  1629. set targetChanger(changer) {
  1630. if (this._targetChanger) {
  1631. this._targetChanger.dispose();
  1632. }
  1633. this._targetChanger = changer;
  1634. }
  1635. get targetChanger() {
  1636. return this._targetChanger;
  1637. }
  1638. clearMoveEvents() {
  1639. Laya.Laya.stage.off(Laya.Event.MOUSE_MOVE, this, this.stageMouseMove);
  1640. Laya.Laya.stage.off(Laya.Event.MOUSE_UP, this, this.stageMouseUp);
  1641. }
  1642. controlMouseDown(e) {
  1643. this.clearMoveEvents();
  1644. this.lenControlXChanger.record();
  1645. this.lenChanger.record();
  1646. if (this.targetChanger) {
  1647. this.targetChanger.record();
  1648. }
  1649. this._isMoving = true;
  1650. Laya.Laya.stage.on(Laya.Event.MOUSE_MOVE, this, this.stageMouseMove);
  1651. Laya.Laya.stage.on(Laya.Event.MOUSE_UP, this, this.stageMouseUp);
  1652. }
  1653. stageMouseMove(e) {
  1654. this.lenControlXChanger.value = this.mouseX;
  1655. this.lenChanger.showValueByScale(this.lenControlXChanger.scaleValue);
  1656. if (this.targetChanger) {
  1657. this.targetChanger.showValueByScale(this.lenControlXChanger.scaleValue);
  1658. }
  1659. this.drawMe();
  1660. }
  1661. stageMouseUp(e) {
  1662. this._isMoving = false;
  1663. this.noticeChange();
  1664. this.clearMoveEvents();
  1665. this.lenControlXChanger.recover();
  1666. this.lenChanger.recover();
  1667. this.drawMe();
  1668. }
  1669. noticeChange() {
  1670. var dLen;
  1671. dLen = this.lenChanger.dValue;
  1672. console.log("lenChange:", dLen);
  1673. }
  1674. }
  1675. class Axis extends Laya.Sprite {
  1676. constructor() {
  1677. super();
  1678. this.xAxis = new ArrowLine("X");
  1679. this.yAxis = new ArrowLine("Y");
  1680. this.controlBox = new Rect();
  1681. this._lenType = [["width", "height"],
  1682. ["scaleX", "scaleY"]];
  1683. this._type = 1;
  1684. this._point = new Laya.Point();
  1685. this.oPoint = new Laya.Point();
  1686. this.myRotationChanger = ValueChanger.create(this, "rotation");
  1687. this.targetRotationChanger = ValueChanger.create(null, "rotation");
  1688. this.stageMouseRotationChanger = new ValueChanger();
  1689. this.mouseEnabled = true;
  1690. this.size(1, 1);
  1691. this.initMe();
  1692. this.xAxis.rotationControl.on(Laya.Event.MOUSE_DOWN, this, this.controlMouseDown);
  1693. this.yAxis.rotationControl.on(Laya.Event.MOUSE_DOWN, this, this.controlMouseDown);
  1694. this.controlBox.on(Laya.Event.MOUSE_DOWN, this, this.controlBoxMouseDown);
  1695. this.on(Laya.Event.DRAG_MOVE, this, this.dragging);
  1696. }
  1697. set target(tar) {
  1698. this._target = tar;
  1699. this.updateChanges();
  1700. }
  1701. updateChanges() {
  1702. if (this._target) {
  1703. var params;
  1704. params = this._lenType[this._type];
  1705. this.xAxis.targetChanger = ValueChanger.create(this._target, params[0]);
  1706. this.yAxis.targetChanger = ValueChanger.create(this._target, params[1]);
  1707. }
  1708. }
  1709. set type(lenType) {
  1710. this._type = lenType;
  1711. this.updateChanges();
  1712. }
  1713. get type() {
  1714. return this._type;
  1715. }
  1716. switchType() {
  1717. this._type++;
  1718. this._type = this._type % this._lenType.length;
  1719. this.type = this._type;
  1720. }
  1721. controlBoxMouseDown(e) {
  1722. this.startDrag();
  1723. }
  1724. dragging() {
  1725. if (this._target) {
  1726. this._point.setTo(this.x, this.y);
  1727. DisControlTool.transPoint(this.parent, this._target.parent, this._point);
  1728. this._target.pos(this._point.x, this._point.y);
  1729. }
  1730. }
  1731. get target() {
  1732. return this._target;
  1733. }
  1734. initMe() {
  1735. this.addChild(this.xAxis);
  1736. this.addChild(this.yAxis);
  1737. this.yAxis.rotation = 90;
  1738. this.addChild(this.controlBox);
  1739. this.controlBox.posTo(0, 0);
  1740. }
  1741. clearMoveEvents() {
  1742. Laya.Laya.stage.off(Laya.Event.MOUSE_MOVE, this, this.stageMouseMove);
  1743. Laya.Laya.stage.off(Laya.Event.MOUSE_UP, this, this.stageMouseUp);
  1744. }
  1745. controlMouseDown(e) {
  1746. this.targetRotationChanger.target = this.target;
  1747. this.clearMoveEvents();
  1748. this.oPoint.setTo(0, 0);
  1749. this.myRotationChanger.record();
  1750. this.oPoint = this.localToGlobal(this.oPoint);
  1751. this.stageMouseRotationChanger.value = this.getStageMouseRatation();
  1752. this.stageMouseRotationChanger.record();
  1753. this.targetRotationChanger.record();
  1754. Laya.Laya.stage.on(Laya.Event.MOUSE_MOVE, this, this.stageMouseMove);
  1755. Laya.Laya.stage.on(Laya.Event.MOUSE_UP, this, this.stageMouseUp);
  1756. }
  1757. getStageMouseRatation() {
  1758. return Laya.MathUtil.getRotation(this.oPoint.x, this.oPoint.y, Laya.Laya.stage.mouseX, Laya.Laya.stage.mouseY);
  1759. }
  1760. stageMouseMove(e) {
  1761. this.stageMouseRotationChanger.value = this.getStageMouseRatation();
  1762. var dRotation;
  1763. dRotation = -this.stageMouseRotationChanger.dValue;
  1764. if (this.target) {
  1765. this.targetRotationChanger.showValueByAdd(dRotation);
  1766. }
  1767. else {
  1768. this.myRotationChanger.showValueByAdd(dRotation);
  1769. }
  1770. }
  1771. stageMouseUp(e) {
  1772. this.noticeChange();
  1773. this.clearMoveEvents();
  1774. }
  1775. noticeChange() {
  1776. console.log("rotate:", -this.stageMouseRotationChanger.dValue);
  1777. }
  1778. }
  1779. class DisController {
  1780. constructor() {
  1781. DisController.init();
  1782. this.arrowAxis = new Axis();
  1783. this.arrowAxis.mouseEnabled = true;
  1784. }
  1785. static init() {
  1786. if (DisController._container) {
  1787. DisControlTool.setTop(DisController._container);
  1788. return;
  1789. }
  1790. DisController._container = new Laya.Sprite();
  1791. DisController._container.mouseEnabled = true;
  1792. Laya.Laya.stage.addChild(DisController._container);
  1793. }
  1794. set target(target) {
  1795. this._target = target;
  1796. if (target) {
  1797. DisController._container.addChild(this.arrowAxis);
  1798. Laya.Laya.timer.loop(100, this, this.updateMe);
  1799. }
  1800. else {
  1801. this.arrowAxis.removeSelf();
  1802. Laya.Laya.timer.clear(this, this.updateMe);
  1803. }
  1804. this.arrowAxis.target = target;
  1805. this.updateMe();
  1806. }
  1807. get target() {
  1808. return this._target;
  1809. }
  1810. set type(lenType) {
  1811. this.arrowAxis.type = lenType;
  1812. }
  1813. get type() {
  1814. return this.arrowAxis.type;
  1815. }
  1816. switchType() {
  1817. this.arrowAxis.switchType();
  1818. }
  1819. updateMe() {
  1820. if (!this._target)
  1821. return;
  1822. this.recInfo = RecInfo.getGlobalRecInfo(this._target, 0, 0, 1, 0, 0, 1);
  1823. console.log("rotation:", this.recInfo.rotation);
  1824. console.log("pos:", this.recInfo.x, this.recInfo.y);
  1825. console.log("scale:", this.recInfo.width, this.recInfo.height);
  1826. this.arrowAxis.x = this.recInfo.x;
  1827. this.arrowAxis.y = this.recInfo.y;
  1828. this.arrowAxis.rotation = this.recInfo.rotation;
  1829. this.arrowAxis.yAxis.rotation = this.recInfo.rotationV - this.recInfo.rotation;
  1830. }
  1831. static get I() {
  1832. if (!DisController._instance) {
  1833. DisController._instance = new DisController();
  1834. }
  1835. return DisController._instance;
  1836. }
  1837. static set I(value) {
  1838. DisController._instance = value;
  1839. }
  1840. }
  1841. class DTrace {
  1842. constructor() {
  1843. }
  1844. static getArgArr(arg) {
  1845. var rst;
  1846. rst = [];
  1847. var i, len = arg.length;
  1848. for (i = 0; i < len; i++) {
  1849. rst.push(arg[i]);
  1850. }
  1851. return rst;
  1852. }
  1853. static dTrace(...arg) {
  1854. arg = DTrace.getArgArr(arg);
  1855. arg.push(TraceTool.getCallLoc(2));
  1856. console.log.apply(console, arg);
  1857. var str;
  1858. str = arg.join(" ");
  1859. }
  1860. static timeStart(sign) {
  1861. console.time(sign);
  1862. }
  1863. static timeEnd(sign) {
  1864. console.timeEnd(sign);
  1865. }
  1866. static traceTable(data) {
  1867. console.table(data);
  1868. }
  1869. }
  1870. class RunProfile {
  1871. constructor() {
  1872. }
  1873. static run(funName, callLen = 3) {
  1874. var tCount;
  1875. if (!RunProfile.infoDic.hasOwnProperty(funName)) {
  1876. RunProfile.infoDic[funName] = new CountTool();
  1877. }
  1878. tCount = RunProfile.infoDic[funName];
  1879. var msg;
  1880. msg = TraceTool.getCallLoc(callLen) + "\n" + TraceTool.getCallStack(1, callLen - 3);
  1881. tCount.add(msg);
  1882. if (RunProfile._runShowDic[funName]) {
  1883. console.log("Create:" + funName);
  1884. console.log(msg);
  1885. }
  1886. }
  1887. static showClassCreate(funName) {
  1888. RunProfile._runShowDic[funName] = true;
  1889. }
  1890. static hideClassCreate(funName) {
  1891. RunProfile._runShowDic[funName] = false;
  1892. }
  1893. static getRunInfo(funName) {
  1894. var rst;
  1895. rst = RunProfile.infoDic[funName];
  1896. return RunProfile.infoDic[funName];
  1897. }
  1898. static runTest(fun, count, sign = "runTest") {
  1899. DTrace.timeStart(sign);
  1900. var i;
  1901. for (i = 0; i < count; i++) {
  1902. fun();
  1903. }
  1904. DTrace.timeEnd(sign);
  1905. }
  1906. static runTest2(fun, count, sign = "runTest") {
  1907. var preTime;
  1908. preTime = Laya.Browser.now();
  1909. var i;
  1910. for (i = 0; i < count; i++) {
  1911. fun();
  1912. }
  1913. return Laya.Browser.now() - preTime;
  1914. }
  1915. }
  1916. RunProfile.infoDic = {};
  1917. RunProfile._runShowDic = {};
  1918. class WalkTools {
  1919. constructor() {
  1920. }
  1921. static walkTarget(target, fun, _this = null) {
  1922. fun.apply(_this, [target]);
  1923. var i;
  1924. var len;
  1925. var tChild;
  1926. len = target.numChildren;
  1927. for (i = 0; i < len; i++) {
  1928. tChild = target.getChildAt(i);
  1929. WalkTools.walkTarget(tChild, fun, tChild);
  1930. }
  1931. }
  1932. static walkTargetEX(target, fun, _this = null, filterFun = null) {
  1933. if (filterFun != null && !filterFun(target))
  1934. return;
  1935. fun.apply(_this, [target]);
  1936. var i;
  1937. var len;
  1938. var tChild;
  1939. var childs;
  1940. childs = target._children;
  1941. len = childs.length;
  1942. for (i = 0; i < len; i++) {
  1943. tChild = childs[i];
  1944. WalkTools.walkTarget(tChild, fun, tChild);
  1945. }
  1946. }
  1947. static walkChildren(target, fun, _this = null) {
  1948. if (!target || target.numChildren < 1)
  1949. return;
  1950. WalkTools.walkArr(DisControlTool.getAllChild(target), fun, _this);
  1951. }
  1952. static walkArr(arr, fun, _this = null) {
  1953. if (!arr)
  1954. return;
  1955. var i;
  1956. var len;
  1957. len = arr.length;
  1958. for (i = 0; i < len; i++) {
  1959. fun.apply(_this, [arr[i], i]);
  1960. }
  1961. }
  1962. }
  1963. class DebugInfoLayer extends Laya.Sprite {
  1964. constructor() {
  1965. super();
  1966. this.nodeRecInfoLayer = new Laya.Sprite();
  1967. this.lineLayer = new Laya.Sprite();
  1968. this.txtLayer = new Laya.Sprite();
  1969. this.popLayer = new Laya.Sprite();
  1970. this.graphicLayer = new Laya.Sprite();
  1971. this.cacheViewLayer = new Laya.Sprite();
  1972. this.nodeRecInfoLayer.name = "nodeRecInfoLayer";
  1973. this.lineLayer.name = "lineLayer";
  1974. this.txtLayer.name = "txtLayer";
  1975. this.popLayer.name = "popLayer";
  1976. this.graphicLayer.name = "graphicLayer";
  1977. this.cacheViewLayer.name = "cacheViewLayer";
  1978. this.addChild(this.lineLayer);
  1979. this.addChild(this.cacheViewLayer);
  1980. this.addChild(this.nodeRecInfoLayer);
  1981. this.addChild(this.txtLayer);
  1982. this.addChild(this.popLayer);
  1983. this.addChild(this.graphicLayer);
  1984. DebugInfoLayer.I = this;
  1985. this.zOrder = 999;
  1986. Laya.Laya.stage.on(Laya.Event.DOUBLE_CLICK, this, this.setTop);
  1987. }
  1988. static init() {
  1989. if (!DebugInfoLayer.I) {
  1990. new DebugInfoLayer();
  1991. Laya.Laya.stage.addChild(DebugInfoLayer.I);
  1992. }
  1993. }
  1994. setTop() {
  1995. DisControlTool.setTop(this);
  1996. }
  1997. isDebugItem(sprite) {
  1998. return DisControlTool.isInTree(this, sprite);
  1999. }
  2000. }
  2001. class IDTools {
  2002. constructor() {
  2003. this.tID = 1;
  2004. }
  2005. getID() {
  2006. return this.tID++;
  2007. }
  2008. static getAID() {
  2009. return IDTools._ID.getID();
  2010. }
  2011. static idObjE(obj, sign = "default") {
  2012. if (obj[IDTools.idSign])
  2013. return obj;
  2014. if (!sign) {
  2015. sign = "default";
  2016. }
  2017. if (!IDTools._idDic[sign]) {
  2018. IDTools._idDic[sign] = new IDTools();
  2019. }
  2020. obj[IDTools.idSign] = IDTools._idDic[sign].getAID();
  2021. return obj;
  2022. }
  2023. static setObjID(obj, id) {
  2024. obj[IDTools.idSign] = id;
  2025. return obj;
  2026. }
  2027. static idObj(obj) {
  2028. if (obj[IDTools.idSign])
  2029. return obj;
  2030. obj[IDTools.idSign] = IDTools.getAID();
  2031. return obj;
  2032. }
  2033. static getObjID(obj) {
  2034. if (!obj)
  2035. return -1;
  2036. return obj[IDTools.idSign];
  2037. }
  2038. }
  2039. IDTools._ID = new IDTools();
  2040. IDTools._idDic = { "default": new IDTools() };
  2041. IDTools.idSign = "_M_id_";
  2042. class NodeInfosItem extends Laya.Sprite {
  2043. constructor() {
  2044. super();
  2045. this._infoTxt = new Laya.Text();
  2046. this._infoTxt.color = "#ff0000";
  2047. this._infoTxt.bgColor = "#00ff00";
  2048. this._infoTxt.fontSize = 12;
  2049. }
  2050. static init() {
  2051. if (!NodeInfosItem.NodeInfoContainer) {
  2052. DebugInfoLayer.init();
  2053. NodeInfosItem.NodeInfoContainer = DebugInfoLayer.I;
  2054. Laya.Laya.stage.addChild(NodeInfosItem.NodeInfoContainer);
  2055. }
  2056. }
  2057. static getNodeInfoByNode(node) {
  2058. IDTools.idObj(node);
  2059. var key;
  2060. key = IDTools.getObjID(node);
  2061. if (!NodeInfosItem._nodeInfoDic[key]) {
  2062. NodeInfosItem._nodeInfoDic[key] = new NodeInfosItem();
  2063. }
  2064. return NodeInfosItem._nodeInfoDic[key];
  2065. }
  2066. static hideAllInfos() {
  2067. var key;
  2068. var tInfo;
  2069. for (key in NodeInfosItem._nodeInfoDic) {
  2070. tInfo = NodeInfosItem._nodeInfoDic[key];
  2071. tInfo.removeSelf();
  2072. }
  2073. NodeInfosItem.clearRelations();
  2074. }
  2075. removeSelf() {
  2076. this._infoTxt.removeSelf();
  2077. return super.removeSelf();
  2078. }
  2079. showToUI() {
  2080. NodeInfosItem.NodeInfoContainer.nodeRecInfoLayer.addChild(this);
  2081. this._infoTxt.removeSelf();
  2082. NodeInfosItem.NodeInfoContainer.txtLayer.addChild(this._infoTxt);
  2083. this.findOkPos();
  2084. }
  2085. randomAPos(r) {
  2086. this._infoTxt.x = this.x + Laya.Laya.stage.width * Math.random();
  2087. this._infoTxt.y = this.y + r * Math.random();
  2088. }
  2089. findOkPos() {
  2090. var len;
  2091. len = 20;
  2092. this.randomAPos(len);
  2093. return;
  2094. var count;
  2095. count = 1;
  2096. while (!this.isPosOk()) {
  2097. count++;
  2098. if (count >= 500) {
  2099. len += 10;
  2100. count = 0;
  2101. }
  2102. this.randomAPos(len);
  2103. }
  2104. }
  2105. isPosOk() {
  2106. var tParent;
  2107. tParent = NodeInfosItem.NodeInfoContainer.nodeRecInfoLayer;
  2108. var i, len;
  2109. var cList;
  2110. cList = tParent._children;
  2111. len = cList.length;
  2112. var tChild;
  2113. var mRec;
  2114. mRec = this._infoTxt.getBounds();
  2115. if (mRec.x < 0)
  2116. return false;
  2117. if (mRec.y < 0)
  2118. return false;
  2119. if (mRec.right > Laya.Laya.stage.width)
  2120. return false;
  2121. for (i = 0; i < len; i++) {
  2122. tChild = cList[i];
  2123. if (tChild == this._infoTxt)
  2124. continue;
  2125. if (mRec.intersects(tChild.getBounds()))
  2126. return false;
  2127. }
  2128. return true;
  2129. }
  2130. static showNodeInfo(node) {
  2131. var nodeInfo;
  2132. nodeInfo = NodeInfosItem.getNodeInfoByNode(node);
  2133. nodeInfo.showInfo(node);
  2134. nodeInfo.showToUI();
  2135. }
  2136. static showDisInfos(node) {
  2137. var _node;
  2138. _node = node;
  2139. if (!node)
  2140. return;
  2141. while (node) {
  2142. NodeInfosItem.showNodeInfo(node);
  2143. node = node.parent;
  2144. }
  2145. DisControlTool.setTop(NodeInfosItem.NodeInfoContainer);
  2146. NodeInfosItem.apdtTxtInfoPoss(_node);
  2147. NodeInfosItem.updateRelations();
  2148. }
  2149. static apdtTxtInfoPoss(node) {
  2150. var disList;
  2151. disList = [];
  2152. while (node) {
  2153. disList.push(node);
  2154. node = node.parent;
  2155. }
  2156. var i, len;
  2157. var tInfo;
  2158. var tTxt;
  2159. len = disList.length;
  2160. var xPos;
  2161. xPos = Laya.Laya.stage.width - 150;
  2162. var heightLen;
  2163. heightLen = 100;
  2164. node = disList[0];
  2165. if (node) {
  2166. tInfo = NodeInfosItem.getNodeInfoByNode(node);
  2167. if (tInfo) {
  2168. tTxt = tInfo._infoTxt;
  2169. xPos = Laya.Laya.stage.width - tTxt.width - 10;
  2170. heightLen = tTxt.height + 10;
  2171. }
  2172. }
  2173. disList = disList.reverse();
  2174. for (i = 0; i < len; i++) {
  2175. node = disList[i];
  2176. tInfo = NodeInfosItem.getNodeInfoByNode(node);
  2177. if (tInfo) {
  2178. tTxt = tInfo._infoTxt;
  2179. tTxt.pos(xPos, heightLen * i);
  2180. }
  2181. }
  2182. }
  2183. static clearRelations() {
  2184. var g;
  2185. g = NodeInfosItem.NodeInfoContainer.lineLayer.graphics;
  2186. g.clear();
  2187. }
  2188. static updateRelations() {
  2189. var g;
  2190. g = NodeInfosItem.NodeInfoContainer.lineLayer.graphics;
  2191. g.clear();
  2192. var key;
  2193. var tInfo;
  2194. for (key in NodeInfosItem._nodeInfoDic) {
  2195. tInfo = NodeInfosItem._nodeInfoDic[key];
  2196. if (tInfo.parent) {
  2197. g.drawLine(tInfo.x, tInfo.y, tInfo._infoTxt.x, tInfo._infoTxt.y, "#0000ff");
  2198. }
  2199. }
  2200. }
  2201. static getNodeValue(node, key) {
  2202. var rst;
  2203. NodeInfosItem._nodePoint.setTo(0, 0);
  2204. switch (key) {
  2205. case "x":
  2206. rst = node["x"] + " (g:" + node.localToGlobal(NodeInfosItem._nodePoint).x + ")";
  2207. break;
  2208. case "y":
  2209. rst = node["y"] + " (g:" + node.localToGlobal(NodeInfosItem._nodePoint).y + ")";
  2210. break;
  2211. default:
  2212. rst = node[key];
  2213. }
  2214. return rst;
  2215. }
  2216. showInfo(node) {
  2217. this._tar = node;
  2218. if (!node)
  2219. return;
  2220. NodeInfosItem._txts.length = 0;
  2221. var i, len;
  2222. var tKey;
  2223. len = NodeInfosItem.showValues.length;
  2224. if (node.name) {
  2225. NodeInfosItem._txts.push(ClassTool.getClassName(node) + "(" + node.name + ")");
  2226. }
  2227. else {
  2228. NodeInfosItem._txts.push(ClassTool.getClassName(node));
  2229. }
  2230. for (i = 0; i < len; i++) {
  2231. tKey = NodeInfosItem.showValues[i];
  2232. NodeInfosItem._txts.push(tKey + ":" + NodeInfosItem.getNodeValue(node, tKey));
  2233. }
  2234. this._infoTxt.text = NodeInfosItem._txts.join("\n");
  2235. this.graphics.clear();
  2236. var pointList;
  2237. pointList = node._getBoundPointsM(true);
  2238. if (!pointList || pointList.length < 1)
  2239. return;
  2240. pointList = Laya.GrahamScan.pListToPointList(pointList, true);
  2241. WalkTools.walkArr(pointList, node.localToGlobal, node);
  2242. pointList = Laya.GrahamScan.pointListToPlist(pointList);
  2243. NodeInfosItem._disBoundRec = Laya.Rectangle._getWrapRec(pointList, NodeInfosItem._disBoundRec);
  2244. this.graphics.drawRect(0, 0, NodeInfosItem._disBoundRec.width, NodeInfosItem._disBoundRec.height, null, "#00ffff");
  2245. this.pos(NodeInfosItem._disBoundRec.x, NodeInfosItem._disBoundRec.y);
  2246. }
  2247. fresh() {
  2248. this.showInfo(this._tar);
  2249. }
  2250. clearMe() {
  2251. this._tar = null;
  2252. }
  2253. recover() {
  2254. Laya.Pool.recover("NodeInfosItem", this);
  2255. }
  2256. }
  2257. NodeInfosItem.showValues = ["x", "y", "scaleX", "scaleY", "width", "height", "visible", "mouseEnabled"];
  2258. NodeInfosItem._nodeInfoDic = {};
  2259. NodeInfosItem._disBoundRec = new Laya.Rectangle();
  2260. NodeInfosItem._txts = [];
  2261. NodeInfosItem._nodePoint = new Laya.Point();
  2262. class NodeInfoPanel extends Laya.Sprite {
  2263. constructor() {
  2264. super();
  2265. this._stateDic = {};
  2266. this.isWorkState = false;
  2267. }
  2268. static init() {
  2269. if (!NodeInfoPanel.I) {
  2270. NodeInfoPanel.I = new NodeInfoPanel();
  2271. NodeInfosItem.init();
  2272. }
  2273. }
  2274. showDisInfo(node) {
  2275. this.recoverNodes();
  2276. NodeInfosItem.showDisInfos(node);
  2277. this.showOnly(node);
  2278. this.isWorkState = true;
  2279. }
  2280. showOnly(node) {
  2281. if (!node)
  2282. return;
  2283. this.hideBrothers(node);
  2284. this.showOnly(node.parent);
  2285. }
  2286. recoverNodes() {
  2287. NodeInfosItem.hideAllInfos();
  2288. var key;
  2289. var data;
  2290. var tTar;
  2291. for (key in this._stateDic) {
  2292. data = this._stateDic[key];
  2293. tTar = data["target"];
  2294. if (tTar) {
  2295. try {
  2296. tTar.visible = data.visible;
  2297. }
  2298. catch (e) {
  2299. }
  2300. }
  2301. }
  2302. this.isWorkState = false;
  2303. }
  2304. hideOtherChain(node) {
  2305. if (!node)
  2306. return;
  2307. while (node) {
  2308. this.hideBrothers(node);
  2309. node = node.parent;
  2310. }
  2311. }
  2312. hideChilds(node) {
  2313. if (!node)
  2314. return;
  2315. var i, len;
  2316. var cList;
  2317. cList = node._children;
  2318. len = cList.length;
  2319. var tChild;
  2320. for (i = 0; i < len; i++) {
  2321. tChild = cList[i];
  2322. if (tChild == NodeInfosItem.NodeInfoContainer)
  2323. continue;
  2324. this.saveNodeInfo(tChild);
  2325. tChild.visible = false;
  2326. }
  2327. }
  2328. hideBrothers(node) {
  2329. if (!node)
  2330. return;
  2331. var p;
  2332. p = node.parent;
  2333. if (!p)
  2334. return;
  2335. var i, len;
  2336. var cList;
  2337. cList = p._children;
  2338. len = cList.length;
  2339. var tChild;
  2340. for (i = 0; i < len; i++) {
  2341. tChild = cList[i];
  2342. if (tChild == NodeInfosItem.NodeInfoContainer)
  2343. continue;
  2344. if (tChild != node) {
  2345. this.saveNodeInfo(tChild);
  2346. tChild.visible = false;
  2347. }
  2348. }
  2349. }
  2350. saveNodeInfo(node) {
  2351. IDTools.idObj(node);
  2352. if (this._stateDic.hasOwnProperty(IDTools.getObjID(node)))
  2353. return;
  2354. var data;
  2355. data = {};
  2356. data.target = node;
  2357. data.visible = node.visible;
  2358. this._stateDic[IDTools.getObjID(node)] = data;
  2359. }
  2360. recoverNodeInfo(node) {
  2361. IDTools.idObj(node);
  2362. if (this._stateDic.hasOwnProperty(IDTools.getObjID(node))) {
  2363. var data;
  2364. data = this._stateDic[IDTools.getObjID(node)];
  2365. node["visible"] = data.visible;
  2366. }
  2367. }
  2368. }
  2369. class NodeConsts {
  2370. constructor() {
  2371. }
  2372. }
  2373. NodeConsts.defaultFitlerStr = "x,y,width,height,scaleX,scaleY,alpha,renderCost";
  2374. NodeConsts.RenderCostMaxTime = 3000;
  2375. class RenderAnalyser {
  2376. constructor() {
  2377. this.timeDic = {};
  2378. this.resultDic = {};
  2379. this.countDic = {};
  2380. this.resultCountDic = {};
  2381. this.nodeDic = {};
  2382. this.isWorking = false;
  2383. this.working = true;
  2384. }
  2385. static get I() {
  2386. if (!RenderAnalyser._instance) {
  2387. RenderAnalyser._instance = new RenderAnalyser();
  2388. }
  2389. return RenderAnalyser._instance;
  2390. }
  2391. static set I(value) {
  2392. RenderAnalyser._instance = value;
  2393. }
  2394. render(sprite, time) {
  2395. this.addTime(sprite, time);
  2396. }
  2397. addTime(sprite, time) {
  2398. IDTools.idObj(sprite);
  2399. var key;
  2400. key = IDTools.getObjID(sprite);
  2401. if (!this.timeDic.hasOwnProperty(key)) {
  2402. this.timeDic[key] = 0;
  2403. }
  2404. this.timeDic[key] = this.timeDic[key] + time;
  2405. if (!this.countDic.hasOwnProperty(key)) {
  2406. this.countDic[key] = 0;
  2407. }
  2408. this.countDic[key] = this.countDic[key] + 1;
  2409. this.nodeDic[key] = sprite;
  2410. }
  2411. getTime(sprite) {
  2412. IDTools.idObj(sprite);
  2413. var key;
  2414. key = IDTools.getObjID(sprite);
  2415. if (!this.resultDic[key])
  2416. return 0;
  2417. return this.resultDic[key];
  2418. }
  2419. getCount(sprite) {
  2420. IDTools.idObj(sprite);
  2421. var key;
  2422. key = IDTools.getObjID(sprite);
  2423. return this.resultCountDic[key];
  2424. }
  2425. reset() {
  2426. var key;
  2427. for (key in this.timeDic) {
  2428. this.timeDic[key] = 0;
  2429. this.countDic[key] = 0;
  2430. }
  2431. ObjectTools.clearObj(this.nodeDic);
  2432. }
  2433. updates() {
  2434. ObjectTools.clearObj(this.resultDic);
  2435. ObjectTools.insertValue(this.resultDic, this.timeDic);
  2436. ObjectTools.clearObj(this.resultCountDic);
  2437. ObjectTools.insertValue(this.resultCountDic, this.countDic);
  2438. this.reset();
  2439. }
  2440. set working(v) {
  2441. this.isWorking = v;
  2442. if (v) {
  2443. Laya.Laya.timer.loop(NodeConsts.RenderCostMaxTime, this, this.updates);
  2444. }
  2445. else {
  2446. Laya.Laya.timer.clear(this, this.updates);
  2447. }
  2448. }
  2449. }
  2450. class NodeUtils {
  2451. constructor() {
  2452. }
  2453. static getFilterdTree(sprite, keys) {
  2454. if (!keys)
  2455. keys = NodeUtils.defaultKeys;
  2456. var me;
  2457. me = {};
  2458. var key;
  2459. var i, len;
  2460. len = keys.length;
  2461. for (i = 0; i < len; i++) {
  2462. key = keys[i];
  2463. me[key] = sprite[key];
  2464. }
  2465. var cList;
  2466. var tChild;
  2467. cList = sprite._children;
  2468. len = cList.length;
  2469. var mClist;
  2470. mClist = [];
  2471. for (i = 0; i < len; i++) {
  2472. tChild = cList[i];
  2473. mClist.push(NodeUtils.getFilterdTree(tChild, keys));
  2474. }
  2475. me.childs = mClist;
  2476. return me;
  2477. }
  2478. static getNodeValue(node, key) {
  2479. var rst;
  2480. if (node instanceof Laya.Sprite) {
  2481. var tNode;
  2482. tNode = node;
  2483. switch (key) {
  2484. case "gRec":
  2485. rst = NodeUtils.getGRec(tNode).toString();
  2486. break;
  2487. case "gAlpha":
  2488. rst = NodeUtils.getGAlpha(tNode) + "";
  2489. break;
  2490. case "cmdCount":
  2491. rst = NodeUtils.getNodeCmdCount(tNode) + "";
  2492. break;
  2493. case "cmdAll":
  2494. rst = NodeUtils.getNodeCmdTotalCount(tNode) + "";
  2495. break;
  2496. case "nodeAll":
  2497. rst = "" + NodeUtils.getNodeCount(tNode);
  2498. break;
  2499. case "nodeVisible":
  2500. rst = "" + NodeUtils.getNodeCount(tNode, true);
  2501. break;
  2502. case "nodeRender":
  2503. rst = "" + NodeUtils.getRenderNodeCount(tNode);
  2504. break;
  2505. case "nodeReCache":
  2506. rst = "" + NodeUtils.getReFreshRenderNodeCount(tNode);
  2507. break;
  2508. case "renderCost":
  2509. rst = "" + RenderAnalyser.I.getTime(tNode);
  2510. break;
  2511. case "renderCount":
  2512. rst = "" + RenderAnalyser.I.getCount(tNode);
  2513. break;
  2514. default:
  2515. rst = node[key] + "";
  2516. }
  2517. }
  2518. else {
  2519. rst = node[key] + "";
  2520. }
  2521. return rst;
  2522. }
  2523. static getPropertyDesO(tValue, keys) {
  2524. if (!keys)
  2525. keys = NodeUtils.defaultKeys;
  2526. var rst = {};
  2527. if (typeof (tValue) == 'object') {
  2528. rst.label = "" + ClassTool.getNodeClassAndName(tValue);
  2529. }
  2530. else {
  2531. rst.label = "" + tValue;
  2532. }
  2533. rst.type = "";
  2534. rst.path = tValue;
  2535. rst.childs = [];
  2536. rst.isDirectory = false;
  2537. var key;
  2538. var i, len;
  2539. var tChild;
  2540. if (tValue instanceof Laya.Node) {
  2541. rst.des = ClassTool.getNodeClassAndName(tValue);
  2542. rst.isDirectory = true;
  2543. len = keys.length;
  2544. for (i = 0; i < len; i++) {
  2545. key = keys[i];
  2546. tChild = NodeUtils.getPropertyDesO(tValue[key], keys);
  2547. if (tValue.hasOwnProperty(key)) {
  2548. tChild.label = "" + key + ":" + tChild.des;
  2549. }
  2550. else {
  2551. tChild.label = "" + key + ":" + NodeUtils.getNodeValue(tValue, key);
  2552. }
  2553. rst.childs.push(tChild);
  2554. }
  2555. key = "_children";
  2556. tChild = NodeUtils.getPropertyDesO(tValue[key], keys);
  2557. tChild.label = "" + key + ":" + tChild.des;
  2558. tChild.isChilds = true;
  2559. rst.childs.push(tChild);
  2560. }
  2561. else if (tValue instanceof Array) {
  2562. rst.des = "Array[" + tValue.length + "]";
  2563. rst.isDirectory = true;
  2564. var tList;
  2565. tList = tValue;
  2566. len = tList.length;
  2567. for (i = 0; i < len; i++) {
  2568. tChild = NodeUtils.getPropertyDesO(tList[i], keys);
  2569. tChild.label = "" + i + ":" + tChild.des;
  2570. rst.childs.push(tChild);
  2571. }
  2572. }
  2573. else if (typeof (tValue) == 'object') {
  2574. rst.des = ClassTool.getNodeClassAndName(tValue);
  2575. rst.isDirectory = true;
  2576. for (key in tValue) {
  2577. tChild = NodeUtils.getPropertyDesO(tValue[key], keys);
  2578. tChild.label = "" + key + ":" + tChild.des;
  2579. rst.childs.push(tChild);
  2580. }
  2581. }
  2582. else {
  2583. rst.des = "" + tValue;
  2584. }
  2585. rst.hasChild = rst.childs.length > 0;
  2586. return rst;
  2587. }
  2588. static adptShowKeys(keys) {
  2589. var i, len;
  2590. len = keys.length;
  2591. for (i = len - 1; i >= 0; i--) {
  2592. keys[i] = StringTool.trimSide(keys[i]);
  2593. if (keys[i].length < 1) {
  2594. keys.splice(i, 1);
  2595. }
  2596. }
  2597. return keys;
  2598. }
  2599. static getNodeTreeData(sprite, keys) {
  2600. NodeUtils.adptShowKeys(keys);
  2601. var treeO;
  2602. treeO = NodeUtils.getPropertyDesO(sprite, keys);
  2603. var treeArr;
  2604. treeArr = [];
  2605. NodeUtils.getTreeArr(treeO, treeArr);
  2606. return treeArr;
  2607. }
  2608. static getTreeArr(treeO, arr, add = true) {
  2609. if (add)
  2610. arr.push(treeO);
  2611. var tArr = treeO.childs;
  2612. var i, len = tArr.length;
  2613. for (i = 0; i < len; i++) {
  2614. if (!add) {
  2615. tArr[i].nodeParent = null;
  2616. }
  2617. else {
  2618. tArr[i].nodeParent = treeO;
  2619. }
  2620. if (tArr[i].isDirectory) {
  2621. NodeUtils.getTreeArr(tArr[i], arr);
  2622. }
  2623. else {
  2624. arr.push(tArr[i]);
  2625. }
  2626. }
  2627. }
  2628. static traceStage() {
  2629. console.log(NodeUtils.getFilterdTree(Laya.Laya.stage, null));
  2630. console.log("treeArr:", NodeUtils.getNodeTreeData(Laya.Laya.stage, null));
  2631. }
  2632. static getNodeCount(node, visibleRequire = false) {
  2633. if (visibleRequire) {
  2634. if (!node.visible)
  2635. return 0;
  2636. }
  2637. var rst;
  2638. rst = 1;
  2639. var i, len;
  2640. var cList;
  2641. cList = node._children;
  2642. len = cList.length;
  2643. for (i = 0; i < len; i++) {
  2644. rst += NodeUtils.getNodeCount(cList[i], visibleRequire);
  2645. }
  2646. return rst;
  2647. }
  2648. static getGVisible(node) {
  2649. while (node) {
  2650. if (!node.visible)
  2651. return false;
  2652. node = node.parent;
  2653. }
  2654. return true;
  2655. }
  2656. static getGAlpha(node) {
  2657. var rst;
  2658. rst = 1;
  2659. while (node) {
  2660. rst *= node.alpha;
  2661. node = node.parent;
  2662. }
  2663. return rst;
  2664. }
  2665. static getGPos(node) {
  2666. var point;
  2667. point = new Laya.Point();
  2668. node.localToGlobal(point);
  2669. return point;
  2670. }
  2671. static getGRec(node) {
  2672. var pointList;
  2673. pointList = node._getBoundPointsM(true);
  2674. if (!pointList || pointList.length < 1)
  2675. return Laya.Rectangle.TEMP.setTo(0, 0, 0, 0);
  2676. pointList = Laya.GrahamScan.pListToPointList(pointList, true);
  2677. WalkTools.walkArr(pointList, node.localToGlobal, node);
  2678. pointList = Laya.GrahamScan.pointListToPlist(pointList);
  2679. var _disBoundRec;
  2680. _disBoundRec = Laya.Rectangle._getWrapRec(pointList, _disBoundRec);
  2681. return _disBoundRec;
  2682. }
  2683. static getGGraphicRec(node) {
  2684. var pointList;
  2685. pointList = node.getGraphicBounds()._getBoundPoints();
  2686. if (!pointList || pointList.length < 1)
  2687. return Laya.Rectangle.TEMP.setTo(0, 0, 0, 0);
  2688. pointList = Laya.GrahamScan.pListToPointList(pointList, true);
  2689. WalkTools.walkArr(pointList, node.localToGlobal, node);
  2690. pointList = Laya.GrahamScan.pointListToPlist(pointList);
  2691. var _disBoundRec;
  2692. _disBoundRec = Laya.Rectangle._getWrapRec(pointList, _disBoundRec);
  2693. return _disBoundRec;
  2694. }
  2695. static getNodeCmdCount(node) {
  2696. var rst;
  2697. if (node.graphics) {
  2698. if (node.graphics.cmds) {
  2699. rst = node.graphics.cmds.length;
  2700. }
  2701. else {
  2702. if (node.graphics._one) {
  2703. rst = 1;
  2704. }
  2705. else {
  2706. rst = 0;
  2707. }
  2708. }
  2709. }
  2710. else {
  2711. rst = 0;
  2712. }
  2713. return rst;
  2714. }
  2715. static getNodeCmdTotalCount(node) {
  2716. var rst;
  2717. var i, len;
  2718. var cList;
  2719. cList = node._children;
  2720. len = cList.length;
  2721. rst = NodeUtils.getNodeCmdCount(node);
  2722. for (i = 0; i < len; i++) {
  2723. rst += NodeUtils.getNodeCmdTotalCount(cList[i]);
  2724. }
  2725. return rst;
  2726. }
  2727. static getRenderNodeCount(node) {
  2728. if (node.cacheAs != "none")
  2729. return 1;
  2730. var rst;
  2731. var i, len;
  2732. var cList;
  2733. cList = node._children;
  2734. len = cList.length;
  2735. rst = 1;
  2736. for (i = 0; i < len; i++) {
  2737. rst += NodeUtils.getRenderNodeCount(cList[i]);
  2738. }
  2739. return rst;
  2740. }
  2741. static getReFreshRenderNodeCount(node) {
  2742. var rst;
  2743. var i, len;
  2744. var cList;
  2745. cList = node._children;
  2746. len = cList.length;
  2747. rst = 1;
  2748. for (i = 0; i < len; i++) {
  2749. rst += NodeUtils.getRenderNodeCount(cList[i]);
  2750. }
  2751. return rst;
  2752. }
  2753. static showCachedSpriteRecs() {
  2754. NodeUtils.g = DebugInfoLayer.I.graphicLayer.graphics;
  2755. NodeUtils.g.clear();
  2756. WalkTools.walkTarget(Laya.Laya.stage, NodeUtils.drawCachedBounds, null);
  2757. }
  2758. static drawCachedBounds(sprite) {
  2759. if (sprite.cacheAs == "none")
  2760. return;
  2761. if (DebugInfoLayer.I.isDebugItem(sprite))
  2762. return;
  2763. var rec;
  2764. rec = NodeUtils.getGRec(sprite);
  2765. NodeUtils.g.drawRect(rec.x, rec.y, rec.width, rec.height, null, "#0000ff", 2);
  2766. }
  2767. }
  2768. NodeUtils.defaultKeys = ["x", "y", "width", "height"];
  2769. class DifferTool {
  2770. constructor(sign = "", autoTrace = true) {
  2771. this.autoTrace = true;
  2772. this.sign = "";
  2773. this.sign = sign;
  2774. this.autoTrace = autoTrace;
  2775. }
  2776. update(data, msg = null) {
  2777. if (msg) {
  2778. console.log(msg);
  2779. }
  2780. var tObj = ObjectTools.copyObj(data);
  2781. if (!this.obj)
  2782. this.obj = {};
  2783. var rst;
  2784. rst = ObjectTools.differ(this.obj, tObj);
  2785. this.obj = tObj;
  2786. if (this.autoTrace) {
  2787. console.log(this.sign + " differ:");
  2788. ObjectTools.traceDifferObj(rst);
  2789. }
  2790. return rst;
  2791. }
  2792. static differ(sign, data, msg = null) {
  2793. if (!DifferTool._differO[sign])
  2794. DifferTool._differO[sign] = new DifferTool(sign, true);
  2795. var tDiffer;
  2796. tDiffer = DifferTool._differO[sign];
  2797. return tDiffer.update(data, msg);
  2798. }
  2799. }
  2800. DifferTool._differO = {};
  2801. class FunHook {
  2802. constructor() {
  2803. }
  2804. static hook(obj, funName, preFun = null, aftFun = null) {
  2805. FunHook.hookFuns(obj, funName, [preFun, obj[funName], aftFun], 1);
  2806. }
  2807. static hookAllFun(obj) {
  2808. var key;
  2809. var arr;
  2810. arr = ClassTool.getOwnPropertyNames(obj);
  2811. for (key in arr) {
  2812. key = arr[key];
  2813. if (FunHook.special[key])
  2814. continue;
  2815. console.log("try hook:", key);
  2816. if (obj[key] instanceof Function) {
  2817. console.log("hook:", key);
  2818. FunHook.hookFuns(obj, key, [FunHook.getTraceMsg("call:" + key), obj[key]], 1);
  2819. }
  2820. }
  2821. if (obj["__proto__"]) {
  2822. FunHook.hookAllFun(obj["__proto__"]);
  2823. }
  2824. else {
  2825. console.log("end:", obj);
  2826. }
  2827. }
  2828. static getTraceMsg(msg) {
  2829. var rst;
  2830. rst = function () {
  2831. console.log(msg);
  2832. };
  2833. return rst;
  2834. }
  2835. static hookFuns(obj, funName, funList, rstI = -1) {
  2836. var _preFun = obj[funName];
  2837. var newFun;
  2838. newFun = function (...args) {
  2839. var rst;
  2840. var i;
  2841. var len;
  2842. len = funList.length;
  2843. for (i = 0; i < len; i++) {
  2844. if (!funList[i])
  2845. continue;
  2846. if (i == rstI) {
  2847. rst = funList[i].apply(this, args);
  2848. }
  2849. else {
  2850. funList[i].apply(this, args);
  2851. }
  2852. }
  2853. return rst;
  2854. };
  2855. newFun["pre"] = _preFun;
  2856. obj[funName] = newFun;
  2857. }
  2858. static removeHook(obj, funName) {
  2859. if (obj[funName].pre != null) {
  2860. obj[funName] = obj[funName].pre;
  2861. }
  2862. }
  2863. static debugHere() {
  2864. debugger;
  2865. }
  2866. static traceLoc(level = 0, msg = "") {
  2867. console.log(msg, "fun loc:", TraceTool.getCallLoc(3 + level));
  2868. }
  2869. static getLocFun(level = 0, msg = "") {
  2870. level += 1;
  2871. var rst;
  2872. rst = function () {
  2873. FunHook.traceLoc(level, msg);
  2874. };
  2875. return rst;
  2876. }
  2877. }
  2878. FunHook.special = {
  2879. "length": true,
  2880. "name": true,
  2881. "arguments": true,
  2882. "caller": true,
  2883. "prototype": true,
  2884. "is": true,
  2885. "isExtensible": true,
  2886. "isFrozen": true,
  2887. "isSealed": true,
  2888. "preventExtensions": true,
  2889. "seal": true,
  2890. "apply": true,
  2891. "call": true,
  2892. "bind": true,
  2893. "freeze": true,
  2894. "unobserve": true
  2895. };
  2896. class VarHook {
  2897. constructor() {
  2898. }
  2899. static hookVar(obj, name, setHook = null, getHook = null) {
  2900. if (!setHook)
  2901. setHook = [];
  2902. if (!getHook)
  2903. getHook = [];
  2904. var preO = obj;
  2905. var preValue = obj[name];
  2906. var des;
  2907. des = ClassTool.getOwnPropertyDescriptor(obj, name);
  2908. var ndes = {};
  2909. var mSet = function (value) {
  2910. console.log("var hook set " + name + ":", value);
  2911. preValue = value;
  2912. };
  2913. var mGet = function () {
  2914. console.log("var hook get" + name + ":", preValue);
  2915. return preValue;
  2916. };
  2917. if (des) {
  2918. ndes.set = mSet;
  2919. ndes.get = mGet;
  2920. ndes.enumerable = des.enumerable;
  2921. setHook.push(ndes.set);
  2922. getHook.push(ndes.get);
  2923. FunHook.hookFuns(ndes, "set", setHook);
  2924. FunHook.hookFuns(ndes, "get", getHook, getHook.length - 1);
  2925. ClassTool.defineProperty(obj, name, ndes);
  2926. return;
  2927. }
  2928. while (!des && obj["__proto__"]) {
  2929. obj = obj["__proto__"];
  2930. des = ClassTool.getOwnPropertyDescriptor(obj, name);
  2931. }
  2932. if (des) {
  2933. ndes.set = des.set ? des.set : mSet;
  2934. ndes.get = des.get ? des.get : mGet;
  2935. ndes.enumerable = des.enumerable;
  2936. setHook.push(ndes.set);
  2937. getHook.push(ndes.get);
  2938. FunHook.hookFuns(ndes, "set", setHook);
  2939. FunHook.hookFuns(ndes, "get", getHook, getHook.length - 1);
  2940. ClassTool.defineProperty(preO, name, ndes);
  2941. }
  2942. if (!des) {
  2943. console.log("get des fail add directly");
  2944. ndes.set = mSet;
  2945. ndes.get = mGet;
  2946. setHook.push(ndes.set);
  2947. getHook.push(ndes.get);
  2948. FunHook.hookFuns(ndes, "set", setHook);
  2949. FunHook.hookFuns(ndes, "get", getHook, getHook.length - 1);
  2950. ClassTool.defineProperty(obj, name, ndes);
  2951. }
  2952. }
  2953. static getLocFun(msg = "", level = 0) {
  2954. level += 1;
  2955. var rst;
  2956. rst = function () {
  2957. FunHook.traceLoc(level, msg);
  2958. };
  2959. return rst;
  2960. }
  2961. }
  2962. class Watcher {
  2963. constructor() {
  2964. }
  2965. static watch(obj, name, funs) {
  2966. VarHook.hookVar(obj, name, funs);
  2967. }
  2968. static traceChange(obj, name, sign = "var changed:") {
  2969. VarHook.hookVar(obj, name, [Watcher.getTraceValueFun(name), VarHook.getLocFun(sign)]);
  2970. }
  2971. static debugChange(obj, name) {
  2972. VarHook.hookVar(obj, name, [VarHook.getLocFun("debug loc"), FunHook.debugHere]);
  2973. }
  2974. static differChange(obj, name, sign, msg = "") {
  2975. VarHook.hookVar(obj, name, [Watcher.getDifferFun(obj, name, sign, msg)]);
  2976. }
  2977. static getDifferFun(obj, name, sign, msg = "") {
  2978. var rst;
  2979. rst = function () {
  2980. DifferTool.differ(sign, obj[name], msg);
  2981. };
  2982. return rst;
  2983. }
  2984. static traceValue(value) {
  2985. console.log("value:", value);
  2986. }
  2987. static getTraceValueFun(name) {
  2988. var rst;
  2989. rst = function (value) {
  2990. console.log("set " + name + " :", value);
  2991. };
  2992. return rst;
  2993. }
  2994. }
  2995. class DebugTool {
  2996. constructor() {
  2997. }
  2998. static getMenuShowEvent() {
  2999. if (Laya.Browser.onMobile) {
  3000. return Laya.Event.DOUBLE_CLICK;
  3001. }
  3002. else {
  3003. return Laya.Event.RIGHT_CLICK;
  3004. }
  3005. }
  3006. static initBasicFunctions() {
  3007. if (!DebugTool.debugLayer) {
  3008. DebugInfoLayer.init();
  3009. DebugTool.debugLayer = DebugInfoLayer.I.graphicLayer;
  3010. DebugTool.debugLayer.mouseEnabled = false;
  3011. DebugTool.debugLayer.mouseThrough = true;
  3012. DebugTool.showStatu = true;
  3013. Laya.Laya.stage.on(Laya.Event.KEY_DOWN, null, DebugTool.keyHandler);
  3014. DebugTool.export();
  3015. }
  3016. }
  3017. static dTrace(str) {
  3018. if (DebugTool._traceFun != null) {
  3019. DebugTool._traceFun(str);
  3020. }
  3021. console.log(str);
  3022. }
  3023. static keyHandler(e) {
  3024. var key;
  3025. key = String.fromCharCode(e.keyCode);
  3026. if (!e.altKey)
  3027. return;
  3028. switch (e.keyCode) {
  3029. case 38:
  3030. DebugTool.showParent();
  3031. break;
  3032. case 40:
  3033. DebugTool.showChild();
  3034. break;
  3035. case 37:
  3036. DebugTool.showBrother(DebugTool.target, 1);
  3037. break;
  3038. case 39:
  3039. DebugTool.showBrother(DebugTool.target, -1);
  3040. break;
  3041. }
  3042. DebugTool.dealCMDKey(key);
  3043. }
  3044. static dealCMDKey(key) {
  3045. switch (key) {
  3046. case "上":
  3047. DebugTool.showParent();
  3048. break;
  3049. case "下":
  3050. DebugTool.showChild();
  3051. break;
  3052. case "左":
  3053. DebugTool.showBrother(DebugTool.target, 1);
  3054. break;
  3055. case "右":
  3056. DebugTool.showBrother(DebugTool.target, -1);
  3057. break;
  3058. case "B":
  3059. DebugTool.showAllBrother();
  3060. break;
  3061. case "C":
  3062. DebugTool.showAllChild();
  3063. break;
  3064. case "E":
  3065. DebugTool.traceDisMouseEnable();
  3066. break;
  3067. case "S":
  3068. DebugTool.traceDisSizeChain();
  3069. break;
  3070. case "D":
  3071. DisControlTool.downDis(DebugTool.target);
  3072. break;
  3073. case "U":
  3074. DisControlTool.upDis(DebugTool.target);
  3075. break;
  3076. case "N":
  3077. DebugTool.getNodeInfo();
  3078. break;
  3079. case "M":
  3080. DebugTool.showAllUnderMosue();
  3081. break;
  3082. case "I":
  3083. break;
  3084. case "O":
  3085. break;
  3086. case "L":
  3087. DisController.I.switchType();
  3088. break;
  3089. case "Q":
  3090. DebugTool.showNodeInfo();
  3091. break;
  3092. case "F":
  3093. DebugTool.showToolPanel();
  3094. break;
  3095. case "P":
  3096. DebugTool.showToolFilter();
  3097. break;
  3098. case "V":
  3099. DebugTool.selectNodeUnderMouse();
  3100. break;
  3101. case "A":
  3102. break;
  3103. case "K":
  3104. NodeUtils.traceStage();
  3105. break;
  3106. case "T":
  3107. DebugTool.switchNodeTree();
  3108. break;
  3109. case "R":
  3110. break;
  3111. case "X":
  3112. break;
  3113. case "mCMD":
  3114. DebugTool.traceCMD();
  3115. break;
  3116. case "allCMD":
  3117. DebugTool.traceCMDR();
  3118. break;
  3119. }
  3120. }
  3121. static switchNodeTree() {
  3122. }
  3123. static selectNodeUnderMouse() {
  3124. DebugTool.showDisBound();
  3125. return;
  3126. }
  3127. static showToolPanel() {
  3128. }
  3129. static showToolFilter() {
  3130. }
  3131. static showNodeInfo() {
  3132. if (NodeInfoPanel.I.isWorkState) {
  3133. NodeInfoPanel.I.recoverNodes();
  3134. }
  3135. else {
  3136. NodeInfoPanel.I.showDisInfo(DebugTool.target);
  3137. }
  3138. }
  3139. static switchDisController() {
  3140. if (DisController.I.target) {
  3141. DisController.I.target = null;
  3142. }
  3143. else {
  3144. if (DebugTool.target) {
  3145. DisController.I.target = DebugTool.target;
  3146. }
  3147. }
  3148. }
  3149. static get isThisShow() {
  3150. return false;
  3151. }
  3152. static showParent(sprite = null) {
  3153. if (!sprite)
  3154. sprite = DebugTool.target;
  3155. if (!sprite) {
  3156. console.log("no targetAvalible");
  3157. return null;
  3158. }
  3159. DebugTool.target = sprite.parent;
  3160. DebugTool.autoWork();
  3161. }
  3162. static showChild(sprite = null) {
  3163. if (!sprite)
  3164. sprite = DebugTool.target;
  3165. if (!sprite) {
  3166. console.log("no targetAvalible");
  3167. return null;
  3168. }
  3169. if (sprite.numChildren > 0) {
  3170. DebugTool.target = sprite.getChildAt(0);
  3171. DebugTool.autoWork();
  3172. }
  3173. }
  3174. static showAllChild(sprite = null) {
  3175. if (!sprite)
  3176. sprite = DebugTool.target;
  3177. if (!sprite) {
  3178. console.log("no targetAvalible");
  3179. return null;
  3180. }
  3181. DebugTool.selectedNodes = DisControlTool.getAllChild(sprite);
  3182. DebugTool.showSelected();
  3183. }
  3184. static showAllUnderMosue() {
  3185. DebugTool.selectedNodes = DisControlTool.getObjectsUnderGlobalPoint(Laya.Laya.stage);
  3186. DebugTool.showSelected();
  3187. }
  3188. static showParentChain(sprite = null) {
  3189. if (!sprite)
  3190. return;
  3191. DebugTool.selectedNodes = [];
  3192. var tar;
  3193. tar = sprite.parent;
  3194. while (tar) {
  3195. DebugTool.selectedNodes.push(tar);
  3196. tar = tar.parent;
  3197. }
  3198. DebugTool.showSelected();
  3199. }
  3200. static showAllBrother(sprite = null) {
  3201. if (!sprite)
  3202. sprite = DebugTool.target;
  3203. if (!sprite) {
  3204. console.log("no targetAvalible");
  3205. return null;
  3206. }
  3207. if (!sprite.parent)
  3208. return;
  3209. DebugTool.selectedNodes = DisControlTool.getAllChild(sprite.parent);
  3210. DebugTool.showSelected();
  3211. }
  3212. static showBrother(sprite, dID = 1) {
  3213. if (!sprite)
  3214. sprite = DebugTool.target;
  3215. if (!sprite) {
  3216. console.log("no targetAvalible");
  3217. return null;
  3218. }
  3219. var p;
  3220. p = sprite.parent;
  3221. if (!p)
  3222. return;
  3223. var n;
  3224. n = p.getChildIndex(sprite);
  3225. n += dID;
  3226. if (n < 0)
  3227. n += p.numChildren;
  3228. if (n >= p.numChildren)
  3229. n -= p.numChildren;
  3230. DebugTool.target = p.getChildAt(n);
  3231. DebugTool.autoWork();
  3232. }
  3233. static set showStatu(value) {
  3234. if (value) {
  3235. Laya.Stat.show();
  3236. }
  3237. else {
  3238. Laya.Stat.hide();
  3239. DebugTool.clearDebugLayer();
  3240. }
  3241. }
  3242. static clearDebugLayer() {
  3243. if (DebugTool.debugLayer.graphics)
  3244. DebugTool.debugLayer.graphics.clear();
  3245. }
  3246. static set target(v) {
  3247. DebugTool._target = v;
  3248. }
  3249. static get target() {
  3250. return DebugTool._target;
  3251. }
  3252. static showSelected() {
  3253. if (!DebugTool.autoShowSelected)
  3254. return;
  3255. if (!DebugTool.selectedNodes || DebugTool.selectedNodes.length < 1)
  3256. return;
  3257. console.log("selected:", DebugTool.selectedNodes);
  3258. var i;
  3259. var len;
  3260. len = DebugTool.selectedNodes.length;
  3261. DebugTool.clearDebugLayer();
  3262. for (i = 0; i < len; i++) {
  3263. DebugTool.showDisBound(DebugTool.selectedNodes[i], false);
  3264. }
  3265. }
  3266. static getClassCreateInfo(className) {
  3267. return RunProfile.getRunInfo(className);
  3268. }
  3269. static set showBound(value) {
  3270. DebugTool._showBound = value;
  3271. if (!DebugTool._showBound) {
  3272. DebugTool.clearDebugLayer();
  3273. }
  3274. }
  3275. static get showBound() {
  3276. return DebugTool._showBound;
  3277. }
  3278. static autoWork() {
  3279. if (!DebugTool.isThisShow)
  3280. return;
  3281. if (DebugTool.showBound)
  3282. DebugTool.showDisBound();
  3283. if (DebugTool.autoTraceSpriteInfo && DebugTool.target) {
  3284. TraceTool.traceSpriteInfo(DebugTool.target, DebugTool.autoTraceBounds, DebugTool.autoTraceSize, DebugTool.autoTraceTree);
  3285. }
  3286. if (!DebugTool.target)
  3287. return;
  3288. if (DebugTool.autoTraceCMD) {
  3289. DebugTool.traceCMD();
  3290. }
  3291. if (DebugTool.autoTraceCMDR) {
  3292. DebugTool.traceCMDR();
  3293. }
  3294. if (DebugTool.autoTraceEnable) {
  3295. DebugTool.traceDisMouseEnable(DebugTool.target);
  3296. }
  3297. }
  3298. static traceDisMouseEnable(tar = null) {
  3299. console.log("----------------traceDisMouseEnable--------------------");
  3300. if (!tar)
  3301. tar = DebugTool.target;
  3302. if (!tar) {
  3303. console.log("no targetAvalible");
  3304. return null;
  3305. }
  3306. var strArr;
  3307. strArr = [];
  3308. DebugTool.selectedNodes = [];
  3309. while (tar) {
  3310. strArr.push(ClassTool.getNodeClassAndName(tar) + ": mouseEnabled:" + tar.mouseEnabled + " hitFirst:" + tar.hitTestPrior);
  3311. DebugTool.selectedNodes.push(tar);
  3312. tar = tar.parent;
  3313. }
  3314. console.log(strArr.join("\n"));
  3315. DebugTool.showSelected();
  3316. return strArr.join("\n");
  3317. }
  3318. static traceDisSizeChain(tar = null) {
  3319. console.log("---------------------traceDisSizeChain-------------------");
  3320. if (!tar)
  3321. tar = DebugTool.target;
  3322. if (!tar) {
  3323. console.log("no targetAvalible");
  3324. return null;
  3325. }
  3326. DebugTool.selectedNodes = [];
  3327. var strArr;
  3328. strArr = [];
  3329. while (tar) {
  3330. strArr.push(ClassTool.getNodeClassAndName(tar) + ": x:" + tar.x + " y:" + tar.y + " w:" + tar.width + " h:" + tar.height + " scaleX:" + tar.scaleX + " scaleY:" + tar.scaleY);
  3331. DebugTool.selectedNodes.push(tar);
  3332. tar = tar.parent;
  3333. }
  3334. console.log(strArr.join("\n"));
  3335. DebugTool.showSelected();
  3336. return strArr.join("\n");
  3337. }
  3338. static showDisBound(sprite = null, clearPre = true, color = "#ff0000") {
  3339. if (!sprite)
  3340. sprite = DebugTool.target;
  3341. if (!sprite) {
  3342. console.log("no targetAvalible");
  3343. return null;
  3344. }
  3345. if (clearPre)
  3346. DebugTool.clearDebugLayer();
  3347. var pointList;
  3348. pointList = sprite._getBoundPointsM(true);
  3349. if (!pointList || pointList.length < 1)
  3350. return;
  3351. pointList = Laya.GrahamScan.pListToPointList(pointList, true);
  3352. WalkTools.walkArr(pointList, sprite.localToGlobal, sprite);
  3353. pointList = Laya.GrahamScan.pointListToPlist(pointList);
  3354. DebugTool._disBoundRec = Laya.Rectangle._getWrapRec(pointList, DebugTool._disBoundRec);
  3355. DebugTool.debugLayer.graphics.drawRect(DebugTool._disBoundRec.x, DebugTool._disBoundRec.y, DebugTool._disBoundRec.width, DebugTool._disBoundRec.height, null, color);
  3356. DebugInfoLayer.I.setTop();
  3357. }
  3358. static showDisBoundToSprite(sprite = null, graphicSprite = null, color = "#ff0000", lineWidth = 1) {
  3359. var pointList;
  3360. pointList = sprite._getBoundPointsM(true);
  3361. if (!pointList || pointList.length < 1)
  3362. return;
  3363. pointList = Laya.GrahamScan.pListToPointList(pointList, true);
  3364. WalkTools.walkArr(pointList, sprite.localToGlobal, sprite);
  3365. pointList = Laya.GrahamScan.pointListToPlist(pointList);
  3366. DebugTool._disBoundRec = Laya.Rectangle._getWrapRec(pointList, DebugTool._disBoundRec);
  3367. graphicSprite.graphics.drawRect(DebugTool._disBoundRec.x, DebugTool._disBoundRec.y, DebugTool._disBoundRec.width, DebugTool._disBoundRec.height, null, color, lineWidth);
  3368. }
  3369. static getNodeInfo() {
  3370. DebugTool.counter.reset();
  3371. WalkTools.walkTarget(Laya.Laya.stage, DebugTool.addNodeInfo);
  3372. console.log("node info:");
  3373. DebugTool.counter.traceSelf();
  3374. return DebugTool.counter.data;
  3375. }
  3376. static findByClass(className) {
  3377. DebugTool._classList = [];
  3378. DebugTool._tFindClass = className;
  3379. WalkTools.walkTarget(Laya.Laya.stage, DebugTool.addClassNode);
  3380. DebugTool.selectedNodes = DebugTool._classList;
  3381. DebugTool.showSelected();
  3382. return DebugTool._classList;
  3383. }
  3384. static addClassNode(node) {
  3385. var type;
  3386. type = node["constructor"].name;
  3387. if (type == DebugTool._tFindClass) {
  3388. DebugTool._classList.push(node);
  3389. }
  3390. }
  3391. static traceCMD(sprite = null) {
  3392. if (!sprite)
  3393. sprite = DebugTool.target;
  3394. if (!sprite) {
  3395. console.log("no targetAvalible");
  3396. return null;
  3397. }
  3398. console.log("self CMDs:");
  3399. console.log(sprite.graphics.cmds);
  3400. var renderSprite;
  3401. renderSprite = Laya.RenderSprite.renders[sprite._renderType];
  3402. console.log("renderSprite:", renderSprite);
  3403. DebugTool._rSpList.length = 0;
  3404. while (renderSprite && renderSprite["_sign"] > 0) {
  3405. DebugTool._rSpList.push(DebugTool.cmdToTypeO[renderSprite["_sign"]]);
  3406. renderSprite = renderSprite._next;
  3407. }
  3408. console.log("fun:", DebugTool._rSpList.join(","));
  3409. DebugTool.counter.reset();
  3410. DebugTool.addCMDs(sprite.graphics.cmds);
  3411. DebugTool.counter.traceSelf();
  3412. return DebugTool.counter.data;
  3413. }
  3414. static addCMDs(cmds) {
  3415. WalkTools.walkArr(cmds, DebugTool.addCMD);
  3416. }
  3417. static addCMD(cmd) {
  3418. DebugTool.counter.add(cmd.callee);
  3419. }
  3420. static traceCMDR(sprite = null) {
  3421. if (!sprite)
  3422. sprite = DebugTool.target;
  3423. if (!sprite) {
  3424. console.log("no targetAvalible");
  3425. return 0;
  3426. }
  3427. DebugTool.counter.reset();
  3428. WalkTools.walkTarget(sprite, DebugTool.getCMdCount);
  3429. console.log("cmds include children");
  3430. DebugTool.counter.traceSelf();
  3431. return DebugTool.counter.data;
  3432. }
  3433. static getCMdCount(target) {
  3434. if (!target)
  3435. return 0;
  3436. if (!(target instanceof Laya.Sprite))
  3437. return 0;
  3438. if (!target.graphics.cmds)
  3439. return 0;
  3440. DebugTool.addCMDs(target.graphics.cmds);
  3441. var rst = target.graphics.cmds.length;
  3442. return rst;
  3443. }
  3444. static addNodeInfo(node) {
  3445. var type;
  3446. type = node["constructor"].name;
  3447. DebugTool.counter.add(type);
  3448. }
  3449. static find(filter, ifShowSelected = true) {
  3450. var rst;
  3451. rst = DebugTool.findTarget(Laya.Laya.stage, filter);
  3452. DebugTool.selectedNodes = rst;
  3453. if (DebugTool.selectedNodes) {
  3454. DebugTool.target = DebugTool.selectedNodes[0];
  3455. }
  3456. if (ifShowSelected)
  3457. DebugTool.showSelected();
  3458. return rst;
  3459. }
  3460. static findByName(name) {
  3461. DebugTool.nameFilter.name = name;
  3462. return DebugTool.find(DebugTool.nameFilter);
  3463. }
  3464. static findNameStartWith(startStr) {
  3465. DebugTool.nameFilter.name = DebugTool.getStartWithFun(startStr);
  3466. return DebugTool.find(DebugTool.nameFilter);
  3467. }
  3468. static findNameHas(hasStr, showSelected = true) {
  3469. DebugTool.nameFilter.name = DebugTool.getHasFun(hasStr);
  3470. return DebugTool.find(DebugTool.nameFilter, showSelected);
  3471. }
  3472. static getStartWithFun(startStr) {
  3473. var rst = function (str) {
  3474. if (!str)
  3475. return false;
  3476. if (str.indexOf(startStr) == 0)
  3477. return true;
  3478. return false;
  3479. };
  3480. return rst;
  3481. }
  3482. static getHasFun(hasStr) {
  3483. var rst = function (str) {
  3484. if (!str)
  3485. return false;
  3486. if (str.indexOf(hasStr) >= 0)
  3487. return true;
  3488. return false;
  3489. };
  3490. return rst;
  3491. }
  3492. static findTarget(target, filter) {
  3493. var rst = [];
  3494. if (DebugTool.isFit(target, filter))
  3495. rst.push(target);
  3496. var i;
  3497. var len;
  3498. var tChild;
  3499. len = target.numChildren;
  3500. for (i = 0; i < len; i++) {
  3501. tChild = target.getChildAt(i);
  3502. if (tChild instanceof Laya.Sprite) {
  3503. rst = rst.concat(DebugTool.findTarget(tChild, filter));
  3504. }
  3505. }
  3506. return rst;
  3507. }
  3508. static findClassHas(target, str) {
  3509. var rst = [];
  3510. if (ClassTool.getClassName(target).indexOf(str) >= 0)
  3511. rst.push(target);
  3512. var i;
  3513. var len;
  3514. var tChild;
  3515. len = target.numChildren;
  3516. for (i = 0; i < len; i++) {
  3517. tChild = target.getChildAt(i);
  3518. if (tChild instanceof Laya.Sprite) {
  3519. rst = rst.concat(DebugTool.findClassHas(tChild, str));
  3520. }
  3521. }
  3522. return rst;
  3523. }
  3524. static isFit(tar, filter) {
  3525. if (!tar)
  3526. return false;
  3527. if (!filter)
  3528. return true;
  3529. if (filter instanceof Function) {
  3530. return filter(tar);
  3531. }
  3532. var key;
  3533. for (key in filter) {
  3534. if (filter[key] instanceof Function) {
  3535. if (!filter[key](tar[key]))
  3536. return false;
  3537. }
  3538. else {
  3539. if (tar[key] != filter[key])
  3540. return false;
  3541. }
  3542. }
  3543. return true;
  3544. }
  3545. static log(...args) {
  3546. var arr;
  3547. arr = DTrace.getArgArr(args);
  3548. if (DebugTool._logFun != null) {
  3549. DebugTool._logFun(arr.join(" "));
  3550. }
  3551. }
  3552. static export() {
  3553. var _window;
  3554. _window = window;
  3555. var key;
  3556. for (key in DebugTool._exportsDic) {
  3557. _window[key] = DebugTool._exportsDic[key];
  3558. }
  3559. }
  3560. }
  3561. DebugTool.enableCacheAnalyse = false;
  3562. DebugTool.enableNodeCreateAnalyse = true;
  3563. DebugTool.text = new Laya.Stat();
  3564. DebugTool.selectedNodes = [];
  3565. DebugTool.autoShowSelected = true;
  3566. DebugTool._showBound = true;
  3567. DebugTool.autoTraceEnable = false;
  3568. DebugTool.autoTraceBounds = false;
  3569. DebugTool.autoTraceSize = false;
  3570. DebugTool.autoTraceTree = true;
  3571. DebugTool.autoTraceCMD = true;
  3572. DebugTool.autoTraceCMDR = false;
  3573. DebugTool.autoTraceSpriteInfo = true;
  3574. DebugTool.cmdToTypeO = {};
  3575. DebugTool._rSpList = [];
  3576. DebugTool.counter = new CountTool();
  3577. DebugTool.nameFilter = { "name": "name" };
  3578. DebugTool._exportsDic = {
  3579. "DebugTool": DebugTool,
  3580. "Watcher": Watcher
  3581. };
  3582. TraceTool._debugtrace = DebugTool.dTrace;
  3583. class ByteEx {
  3584. constructor(data = null) {
  3585. this._xd_ = true;
  3586. this._allocated_ = 8;
  3587. this._pos_ = 0;
  3588. this._length = 0;
  3589. if (data) {
  3590. this._u8d_ = new Uint8Array(data);
  3591. this._d_ = new DataView(this._u8d_.buffer);
  3592. this._length = this._d_.byteLength;
  3593. }
  3594. else {
  3595. this._resizeBuffer(this._allocated_);
  3596. }
  3597. }
  3598. static getSystemEndian() {
  3599. if (!ByteEx._sysEndian) {
  3600. var buffer = new ArrayBuffer(2);
  3601. new DataView(buffer).setInt16(0, 256, true);
  3602. ByteEx._sysEndian = (new Int16Array(buffer))[0] === 256 ? ByteEx.LITTLE_ENDIAN : ByteEx.BIG_ENDIAN;
  3603. }
  3604. return ByteEx._sysEndian;
  3605. }
  3606. get buffer() {
  3607. var rstBuffer = this._d_.buffer;
  3608. if (rstBuffer.byteLength === this._length)
  3609. return rstBuffer;
  3610. return rstBuffer.slice(0, this._length);
  3611. }
  3612. get endian() {
  3613. return this._xd_ ? ByteEx.LITTLE_ENDIAN : ByteEx.BIG_ENDIAN;
  3614. }
  3615. set endian(value) {
  3616. this._xd_ = (value === ByteEx.LITTLE_ENDIAN);
  3617. }
  3618. set length(value) {
  3619. if (this._allocated_ < value)
  3620. this._resizeBuffer(this._allocated_ = Math.floor(Math.max(value, this._allocated_ * 2)));
  3621. else if (this._allocated_ > value)
  3622. this._resizeBuffer(this._allocated_ = value);
  3623. this._length = value;
  3624. }
  3625. get length() {
  3626. return this._length;
  3627. }
  3628. _resizeBuffer(len) {
  3629. try {
  3630. var newByteView = new Uint8Array(len);
  3631. if (this._u8d_ != null) {
  3632. if (this._u8d_.length <= len)
  3633. newByteView.set(this._u8d_);
  3634. else
  3635. newByteView.set(this._u8d_.subarray(0, len));
  3636. }
  3637. this._u8d_ = newByteView;
  3638. this._d_ = new DataView(newByteView.buffer);
  3639. }
  3640. catch (err) {
  3641. throw "Invalid typed array length:" + len;
  3642. }
  3643. }
  3644. getString() {
  3645. return this.readString();
  3646. }
  3647. readString() {
  3648. return this._rUTF(this.getUint16());
  3649. }
  3650. getFloat32Array(start, len) {
  3651. return this.readFloat32Array(start, len);
  3652. }
  3653. readFloat32Array(start, len) {
  3654. var end = start + len;
  3655. end = (end > this._length) ? this._length : end;
  3656. var v = new Float32Array(this._d_.buffer.slice(start, end));
  3657. this._pos_ = end;
  3658. return v;
  3659. }
  3660. getUint8Array(start, len) {
  3661. return this.readUint8Array(start, len);
  3662. }
  3663. readUint8Array(start, len) {
  3664. var end = start + len;
  3665. end = (end > this._length) ? this._length : end;
  3666. var v = new Uint8Array(this._d_.buffer.slice(start, end));
  3667. this._pos_ = end;
  3668. return v;
  3669. }
  3670. getInt16Array(start, len) {
  3671. return this.readInt16Array(start, len);
  3672. }
  3673. readInt16Array(start, len) {
  3674. var end = start + len;
  3675. end = (end > this._length) ? this._length : end;
  3676. var v = new Int16Array(this._d_.buffer.slice(start, end));
  3677. this._pos_ = end;
  3678. return v;
  3679. }
  3680. getFloat32() {
  3681. return this.readFloat32();
  3682. }
  3683. readFloat32() {
  3684. if (this._pos_ + 4 > this._length)
  3685. throw "getFloat32 error - Out of bounds";
  3686. var v = this._d_.getFloat32(this._pos_, this._xd_);
  3687. this._pos_ += 4;
  3688. return v;
  3689. }
  3690. getFloat64() {
  3691. return this.readFloat64();
  3692. }
  3693. readFloat64() {
  3694. if (this._pos_ + 8 > this._length)
  3695. throw "getFloat64 error - Out of bounds";
  3696. var v = this._d_.getFloat64(this._pos_, this._xd_);
  3697. this._pos_ += 8;
  3698. return v;
  3699. }
  3700. writeFloat32(value) {
  3701. this._ensureWrite(this._pos_ + 4);
  3702. this._d_.setFloat32(this._pos_, value, this._xd_);
  3703. this._pos_ += 4;
  3704. }
  3705. writeFloat64(value) {
  3706. this._ensureWrite(this._pos_ + 8);
  3707. this._d_.setFloat64(this._pos_, value, this._xd_);
  3708. this._pos_ += 8;
  3709. }
  3710. getInt32() {
  3711. return this.readInt32();
  3712. }
  3713. readInt32() {
  3714. if (this._pos_ + 4 > this._length)
  3715. throw "getInt32 error - Out of bounds";
  3716. var float = this._d_.getInt32(this._pos_, this._xd_);
  3717. this._pos_ += 4;
  3718. return float;
  3719. }
  3720. getUint32() {
  3721. return this.readUint32();
  3722. }
  3723. readUint32() {
  3724. if (this._pos_ + 4 > this._length)
  3725. throw "getUint32 error - Out of bounds";
  3726. var v = this._d_.getUint32(this._pos_, this._xd_);
  3727. this._pos_ += 4;
  3728. return v;
  3729. }
  3730. writeInt32(value) {
  3731. this._ensureWrite(this._pos_ + 4);
  3732. this._d_.setInt32(this._pos_, value, this._xd_);
  3733. this._pos_ += 4;
  3734. }
  3735. writeUint32(value) {
  3736. this._ensureWrite(this._pos_ + 4);
  3737. this._d_.setUint32(this._pos_, value, this._xd_);
  3738. this._pos_ += 4;
  3739. }
  3740. getInt16() {
  3741. return this.readInt16();
  3742. }
  3743. readInt16() {
  3744. if (this._pos_ + 2 > this._length)
  3745. throw "getInt16 error - Out of bounds";
  3746. var us = this._d_.getInt16(this._pos_, this._xd_);
  3747. this._pos_ += 2;
  3748. return us;
  3749. }
  3750. getUint16() {
  3751. return this.readUint16();
  3752. }
  3753. readUint16() {
  3754. if (this._pos_ + 2 > this._length)
  3755. throw "getUint16 error - Out of bounds";
  3756. var us = this._d_.getUint16(this._pos_, this._xd_);
  3757. this._pos_ += 2;
  3758. return us;
  3759. }
  3760. writeUint16(value) {
  3761. this._ensureWrite(this._pos_ + 2);
  3762. this._d_.setUint16(this._pos_, value, this._xd_);
  3763. this._pos_ += 2;
  3764. }
  3765. writeInt16(value) {
  3766. this._ensureWrite(this._pos_ + 2);
  3767. this._d_.setInt16(this._pos_, value, this._xd_);
  3768. this._pos_ += 2;
  3769. }
  3770. getUint8() {
  3771. return this.readUint8();
  3772. }
  3773. readUint8() {
  3774. if (this._pos_ + 1 > this._length)
  3775. throw "getUint8 error - Out of bounds";
  3776. return this._d_.getUint8(this._pos_++);
  3777. }
  3778. writeUint8(value) {
  3779. this._ensureWrite(this._pos_ + 1);
  3780. this._d_.setUint8(this._pos_, value);
  3781. this._pos_++;
  3782. }
  3783. _getUInt8(pos) {
  3784. return this._readUInt8(pos);
  3785. }
  3786. _readUInt8(pos) {
  3787. return this._d_.getUint8(pos);
  3788. }
  3789. _getUint16(pos) {
  3790. return this._readUint16(pos);
  3791. }
  3792. _readUint16(pos) {
  3793. return this._d_.getUint16(pos, this._xd_);
  3794. }
  3795. _getMatrix() {
  3796. return this._readMatrix();
  3797. }
  3798. _readMatrix() {
  3799. var rst = new Laya.Matrix(this.getFloat32(), this.getFloat32(), this.getFloat32(), this.getFloat32(), this.getFloat32(), this.getFloat32());
  3800. return rst;
  3801. }
  3802. _rUTF(len) {
  3803. var v = "", max = this._pos_ + len, c, c2, c3, f = String.fromCharCode;
  3804. var u = this._u8d_;
  3805. while (this._pos_ < max) {
  3806. c = u[this._pos_++];
  3807. if (c < 0x80) {
  3808. if (c != 0)
  3809. v += f(c);
  3810. }
  3811. else if (c < 0xE0) {
  3812. v += f(((c & 0x3F) << 6) | (u[this._pos_++] & 0x7F));
  3813. }
  3814. else if (c < 0xF0) {
  3815. c2 = u[this._pos_++];
  3816. v += f(((c & 0x1F) << 12) | ((c2 & 0x7F) << 6) | (u[this._pos_++] & 0x7F));
  3817. }
  3818. else {
  3819. c2 = u[this._pos_++];
  3820. c3 = u[this._pos_++];
  3821. v += f(((c & 0x0F) << 18) | ((c2 & 0x7F) << 12) | ((c3 << 6) & 0x7F) | (u[this._pos_++] & 0x7F));
  3822. }
  3823. }
  3824. return v;
  3825. }
  3826. getCustomString(len) {
  3827. return this.readCustomString(len);
  3828. }
  3829. readCustomString(len) {
  3830. var v = "", ulen = 0, c, c2, f = String.fromCharCode;
  3831. var u = this._u8d_;
  3832. while (len > 0) {
  3833. c = u[this._pos_];
  3834. if (c < 0x80) {
  3835. v += f(c);
  3836. this._pos_++;
  3837. len--;
  3838. }
  3839. else {
  3840. ulen = c - 0x80;
  3841. this._pos_++;
  3842. len -= ulen;
  3843. while (ulen > 0) {
  3844. c = u[this._pos_++];
  3845. c2 = u[this._pos_++];
  3846. v += f((c2 << 8) | c);
  3847. ulen--;
  3848. }
  3849. }
  3850. }
  3851. return v;
  3852. }
  3853. get pos() {
  3854. return this._pos_;
  3855. }
  3856. set pos(value) {
  3857. this._pos_ = value;
  3858. }
  3859. get bytesAvailable() {
  3860. return this._length - this._pos_;
  3861. }
  3862. clear() {
  3863. this._pos_ = 0;
  3864. this.length = 0;
  3865. }
  3866. __getBuffer() {
  3867. return this._d_.buffer;
  3868. }
  3869. writeUTFBytes(value) {
  3870. value = value + "";
  3871. for (var i = 0, sz = value.length; i < sz; i++) {
  3872. var c = value.charCodeAt(i);
  3873. if (c <= 0x7F) {
  3874. this.writeByte(c);
  3875. }
  3876. else if (c <= 0x7FF) {
  3877. this._ensureWrite(this._pos_ + 2);
  3878. this._u8d_.set([0xC0 | (c >> 6), 0x80 | (c & 0x3F)], this._pos_);
  3879. this._pos_ += 2;
  3880. }
  3881. else if (c <= 0xFFFF) {
  3882. this._ensureWrite(this._pos_ + 3);
  3883. this._u8d_.set([0xE0 | (c >> 12), 0x80 | ((c >> 6) & 0x3F), 0x80 | (c & 0x3F)], this._pos_);
  3884. this._pos_ += 3;
  3885. }
  3886. else {
  3887. this._ensureWrite(this._pos_ + 4);
  3888. this._u8d_.set([0xF0 | (c >> 18), 0x80 | ((c >> 12) & 0x3F), 0x80 | ((c >> 6) & 0x3F), 0x80 | (c & 0x3F)], this._pos_);
  3889. this._pos_ += 4;
  3890. }
  3891. }
  3892. }
  3893. writeUTFString(value) {
  3894. var tPos = this.pos;
  3895. this.writeUint16(1);
  3896. this.writeUTFBytes(value);
  3897. var dPos = this.pos - tPos - 2;
  3898. this._d_.setUint16(tPos, dPos, this._xd_);
  3899. }
  3900. readUTFString() {
  3901. return this.readUTFBytes(this.getUint16());
  3902. }
  3903. getUTFString() {
  3904. return this.readUTFString();
  3905. }
  3906. readUTFBytes(len = -1) {
  3907. if (len === 0)
  3908. return "";
  3909. var lastBytes = this.bytesAvailable;
  3910. if (len > lastBytes)
  3911. throw "readUTFBytes error - Out of bounds";
  3912. len = len > 0 ? len : lastBytes;
  3913. return this._rUTF(len);
  3914. }
  3915. getUTFBytes(len = -1) {
  3916. return this.readUTFBytes(len);
  3917. }
  3918. writeByte(value) {
  3919. this._ensureWrite(this._pos_ + 1);
  3920. this._d_.setInt8(this._pos_, value);
  3921. this._pos_ += 1;
  3922. }
  3923. readByte() {
  3924. if (this._pos_ + 1 > this._length)
  3925. throw "readByte error - Out of bounds";
  3926. return this._d_.getInt8(this._pos_++);
  3927. }
  3928. getByte() {
  3929. return this.readByte();
  3930. }
  3931. _ensureWrite(lengthToEnsure) {
  3932. if (this._length < lengthToEnsure)
  3933. this._length = lengthToEnsure;
  3934. if (this._allocated_ < lengthToEnsure)
  3935. this.length = lengthToEnsure;
  3936. }
  3937. writeArrayBuffer(arraybuffer, offset = 0, length = 0) {
  3938. if (offset < 0 || length < 0)
  3939. throw "writeArrayBuffer error - Out of bounds";
  3940. if (length == 0)
  3941. length = arraybuffer.byteLength - offset;
  3942. this._ensureWrite(this._pos_ + length);
  3943. var uint8array = new Uint8Array(arraybuffer);
  3944. this._u8d_.set(uint8array.subarray(offset, offset + length), this._pos_);
  3945. this._pos_ += length;
  3946. }
  3947. }
  3948. ByteEx.BIG_ENDIAN = "bigEndian";
  3949. ByteEx.LITTLE_ENDIAN = "littleEndian";
  3950. ByteEx._sysEndian = null;
  3951. class Base64Tool {
  3952. constructor() {
  3953. }
  3954. static init() {
  3955. if (Base64Tool.lookup)
  3956. return;
  3957. Base64Tool.lookup = new Uint8Array(256);
  3958. for (var i = 0; i < Base64Tool.chars.length; i++) {
  3959. Base64Tool.lookup[Base64Tool.chars.charCodeAt(i)] = i;
  3960. }
  3961. }
  3962. static encode(arraybuffer) {
  3963. var bytes = new Uint8Array(arraybuffer), i, len = bytes["length"], base64 = "";
  3964. for (i = 0; i < len; i += 3) {
  3965. base64 += Base64Tool.chars[bytes[i] >> 2];
  3966. base64 += Base64Tool.chars[((bytes[i] & 3) << 4) | (bytes[i + 1] >> 4)];
  3967. base64 += Base64Tool.chars[((bytes[i + 1] & 15) << 2) | (bytes[i + 2] >> 6)];
  3968. base64 += Base64Tool.chars[bytes[i + 2] & 63];
  3969. }
  3970. if ((len % 3) === 2) {
  3971. base64 = base64.substring(0, base64.length - 1) + "=";
  3972. }
  3973. else if (len % 3 === 1) {
  3974. base64 = base64.substring(0, base64.length - 2) + "==";
  3975. }
  3976. return base64;
  3977. }
  3978. static encodeStr(str) {
  3979. var byte;
  3980. byte = new ByteEx();
  3981. byte.writeUTFString(str);
  3982. return Base64Tool.encodeByte(byte);
  3983. }
  3984. static encodeStr2(str) {
  3985. var byte;
  3986. byte = new ByteEx();
  3987. byte.writeUTFBytes(str);
  3988. return Base64Tool.encodeByte(byte);
  3989. }
  3990. static encodeByte(byte, start = 0, end = -1) {
  3991. if (end < 0) {
  3992. end = byte.length;
  3993. }
  3994. return Base64Tool.encode(byte.buffer.slice(start, end));
  3995. }
  3996. static decodeToByte(base64) {
  3997. return new ByteEx(Base64Tool.decode(base64));
  3998. }
  3999. static decode(base64) {
  4000. Base64Tool.init();
  4001. var bufferLength = base64.length * 0.75, len = base64.length, i, p = 0, encoded1, encoded2, encoded3, encoded4;
  4002. if (base64[base64.length - 1] === "=") {
  4003. bufferLength--;
  4004. if (base64[base64.length - 2] === "=") {
  4005. bufferLength--;
  4006. }
  4007. }
  4008. var arraybuffer = new ArrayBuffer(bufferLength), bytes = new Uint8Array(arraybuffer);
  4009. for (i = 0; i < len; i += 4) {
  4010. encoded1 = Base64Tool.lookup[base64.charCodeAt(i)];
  4011. encoded2 = Base64Tool.lookup[base64.charCodeAt(i + 1)];
  4012. encoded3 = Base64Tool.lookup[base64.charCodeAt(i + 2)];
  4013. encoded4 = Base64Tool.lookup[base64.charCodeAt(i + 3)];
  4014. bytes[p++] = (encoded1 << 2) | (encoded2 >> 4);
  4015. bytes[p++] = ((encoded2 & 15) << 4) | (encoded3 >> 2);
  4016. bytes[p++] = ((encoded3 & 3) << 6) | (encoded4 & 63);
  4017. }
  4018. return arraybuffer;
  4019. }
  4020. ;
  4021. }
  4022. Base64Tool.chars = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/";
  4023. Base64Tool.lookup = null;
  4024. class DivScripts {
  4025. constructor() {
  4026. }
  4027. static init() {
  4028. var script;
  4029. script = Base64Tool.decodeToByte(DivScripts.data).readUTFBytes();
  4030. window["eval"](script);
  4031. }
  4032. }
  4033. DivScripts.data = "ZnVuY3Rpb24gZGh0bWx4RXZlbnQoZSx0LGkpe2UuYWRkRXZlbnRMaXN0ZW5lcj9lLmFkZEV2ZW50TGlzdGVuZXIodCxpLCExKTplLmF0dGFjaEV2ZW50JiZlLmF0dGFjaEV2ZW50KCJvbiIrdCxpKX1mdW5jdGlvbiBkaHRtbFhUcmVlT2JqZWN0KGUsdCxpLG4pe2lmKGRodG1seEV2ZW50LmluaXRUb3VjaCYmZGh0bWx4RXZlbnQuaW5pdFRvdWNoKCksX2lzSUUpdHJ5e2RvY3VtZW50LmV4ZWNDb21tYW5kKCJCYWNrZ3JvdW5kSW1hZ2VDYWNoZSIsITEsITApfWNhdGNoKG8pe310aGlzLnBhcmVudE9iamVjdD0ib2JqZWN0IiE9dHlwZW9mIGU/ZG9jdW1lbnQuZ2V0RWxlbWVudEJ5SWQoZSk6ZSx0aGlzLnBhcmVudE9iamVjdC5zdHlsZS5vdmVyZmxvdz0iaGlkZGVuIix0aGlzLl9pdGltX2RnPSEwLHRoaXMuZGxtdHI9IiwiLHRoaXMuZHJvcExvd2VyPSExLHRoaXMuZW5hYmxlSUVJbWFnZUZpeCghMCksdGhpcy54bWxzdGF0ZT0wLHRoaXMubXl0eXBlPSJ0cmVlIix0aGlzLnNtY2hlY2s9ITAsdGhpcy53aWR0aD10LHRoaXMuaGVpZ2h0PWksdGhpcy5yb290SWQ9bix0aGlzLmNoaWxkQ2FsYz1udWxsLHRoaXMuZGVmX2ltZ194PSIxOHB4Iix0aGlzLmRlZl9pbWdfeT0iMThweCIsdGhpcy5kZWZfb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J1Z192aWV3Lm9uUHJpbnRTaXplQ2hhaW49ZnVuY3Rpb24oZSl7c2l6ZV9jaGFpbl9jb250cm9sLm9uY2xpY2s9ZX0sbGF5YWFpcl9kZWJ1Z192aWV3Lm9uVG9nZ2xlVmlzaWJpbGl0eT1mdW5jdGlvbihlKXt2aXNpYmlsaXR5X2NvbnRyb2wub25jaGFuZ2U9ZX0sbGF5YWFpcl9kZWJ1Z192aWV3Lm9uVG9nZ2xlRGVidWdCb3JkZXI9ZnVuY3Rpb24oZSl7c2hvd19ib3JkZXJfY29udHJvbC5vbmNoYW5nZT1lfSxsYXlhYWlyX2RlYnVnX3ZpZXcub25Ub2dnbGVTaG93Q3VycmVudENhY2hlPWZ1bmN0aW9uKGUpe3Nob3dfY3VycmVudF9jYWNoZV9jb250cm9sLm9uY2hhbmdlPWV9LGxheWFhaXJfZGVidWdfdmlldy5vblRvZ2dsZVNob3dBbGxDYWNoZT1mdW5jdGlvbihlKXtzaG93X2FsbF9jYWNoZV9jb250cm9sLm9uY2hhbmdlPWV9LGxheWFhaXJfZGVidWdfdmlldy5vblRvZ2dsZVNob3dBdGxhcz1mdW5jdGlvbihlKXtzaG93X2F0bGFzX2NvbnRyb2wub25jaGFuZ2U9ZX07";
  4034. class AtlasTools {
  4035. constructor() {
  4036. this.mIndex = 0;
  4037. this.mTextureDic = {};
  4038. }
  4039. static getInstance() {
  4040. return AtlasTools.mInstance = AtlasTools.mInstance || new AtlasTools();
  4041. }
  4042. start() {
  4043. if (this.mSprite == null) {
  4044. this.mSprite = new Laya.Sprite();
  4045. }
  4046. Laya.Laya.stage.addChild(this.mSprite);
  4047. this.showNext();
  4048. }
  4049. end() {
  4050. if (this.mSprite) {
  4051. Laya.Laya.stage.removeChild(this.mSprite);
  4052. }
  4053. }
  4054. showNext() {
  4055. if (this.mSprite == null) {
  4056. this.mSprite = new Laya.Sprite();
  4057. }
  4058. Laya.Laya.stage.addChild(this.mSprite);
  4059. this.mIndex++;
  4060. var tTexture;
  4061. if (this.mTextureDic[this.mIndex]) {
  4062. tTexture = this.mTextureDic[this.mIndex];
  4063. }
  4064. }
  4065. }
  4066. class ObjTimeCountTool {
  4067. constructor() {
  4068. this.timeDic = {};
  4069. this.resultDic = {};
  4070. this.countDic = {};
  4071. this.resultCountDic = {};
  4072. this.nodeDic = {};
  4073. this.resultNodeDic = {};
  4074. }
  4075. addTime(sprite, time) {
  4076. IDTools.idObj(sprite);
  4077. var key;
  4078. key = IDTools.getObjID(sprite);
  4079. if (!this.timeDic.hasOwnProperty(key)) {
  4080. this.timeDic[key] = 0;
  4081. }
  4082. this.timeDic[key] = this.timeDic[key] + time;
  4083. if (!this.countDic.hasOwnProperty(key)) {
  4084. this.countDic[key] = 0;
  4085. }
  4086. this.countDic[key] = this.countDic[key] + 1;
  4087. this.nodeDic[key] = sprite;
  4088. }
  4089. getTime(sprite) {
  4090. IDTools.idObj(sprite);
  4091. var key;
  4092. key = IDTools.getObjID(sprite);
  4093. if (!this.resultDic[key])
  4094. return 0;
  4095. return this.resultDic[key];
  4096. }
  4097. getCount(sprite) {
  4098. IDTools.idObj(sprite);
  4099. var key;
  4100. key = IDTools.getObjID(sprite);
  4101. return this.resultCountDic[key];
  4102. }
  4103. reset() {
  4104. var key;
  4105. for (key in this.timeDic) {
  4106. this.timeDic[key] = 0;
  4107. this.countDic[key] = 0;
  4108. }
  4109. ObjectTools.clearObj(this.nodeDic);
  4110. }
  4111. updates() {
  4112. ObjectTools.clearObj(this.resultDic);
  4113. ObjectTools.insertValue(this.resultDic, this.timeDic);
  4114. ObjectTools.clearObj(this.resultCountDic);
  4115. ObjectTools.insertValue(this.resultCountDic, this.countDic);
  4116. ObjectTools.insertValue(this.resultNodeDic, this.nodeDic);
  4117. this.reset();
  4118. }
  4119. }
  4120. class DebugConsts {
  4121. constructor() {
  4122. }
  4123. }
  4124. DebugConsts.CLICK_SELECT_COLOR = "#ff0000";
  4125. DebugConsts.CANVAS_REC_COLOR = "#FF00FF";
  4126. DebugConsts.RECACHE_REC_COLOR = "#00ff00";
  4127. DebugConsts.SPRITE_REC_COLOR = "#ff0000";
  4128. DebugConsts.SPRITE_REC_LINEWIDTH = 2;
  4129. class NodeRecInfo extends Laya.Sprite {
  4130. constructor() {
  4131. super();
  4132. this.recColor = "#00ff00";
  4133. this.txt = new Laya.Text();
  4134. this.txt.color = "#ff0000";
  4135. this.txt.bgColor = "#00ff00";
  4136. this.txt.fontSize = 12;
  4137. this.addChild(this.txt);
  4138. }
  4139. setInfo(str) {
  4140. this.txt.text = str;
  4141. }
  4142. setTarget(tar) {
  4143. this._tar = tar;
  4144. }
  4145. showInfo(node) {
  4146. this._tar = node;
  4147. if (!node)
  4148. return;
  4149. if (node.destroyed)
  4150. return;
  4151. this.graphics.clear();
  4152. var pointList;
  4153. pointList = node._getBoundPointsM(true);
  4154. if (!pointList || pointList.length < 1)
  4155. return;
  4156. pointList = Laya.GrahamScan.pListToPointList(pointList, true);
  4157. WalkTools.walkArr(pointList, node.localToGlobal, node);
  4158. pointList = Laya.GrahamScan.pointListToPlist(pointList);
  4159. NodeRecInfo._disBoundRec = Laya.Rectangle._getWrapRec(pointList, NodeRecInfo._disBoundRec);
  4160. this.graphics.drawRect(0, 0, NodeRecInfo._disBoundRec.width, NodeRecInfo._disBoundRec.height, null, DebugConsts.RECACHE_REC_COLOR, 2);
  4161. this.pos(NodeRecInfo._disBoundRec.x, NodeRecInfo._disBoundRec.y);
  4162. }
  4163. fresh() {
  4164. this.showInfo(this._tar);
  4165. }
  4166. clearMe() {
  4167. this._tar = null;
  4168. }
  4169. }
  4170. NodeRecInfo._disBoundRec = new Laya.Rectangle();
  4171. class ReCacheRecInfo extends NodeRecInfo {
  4172. constructor() {
  4173. super();
  4174. this.isWorking = false;
  4175. this.mTime = 0;
  4176. this.txt.fontSize = 12;
  4177. }
  4178. addCount(time = 0) {
  4179. this.count++;
  4180. this.mTime += time;
  4181. if (!this.isWorking) {
  4182. this.working = true;
  4183. }
  4184. }
  4185. updates() {
  4186. if (!this._tar["displayedInStage"]) {
  4187. this.working = false;
  4188. this.removeSelf();
  4189. }
  4190. this.txt.text = ClassTool.getNodeClassAndName(this._tar) + "\n" + "reCache:" + this.count + "\ntime:" + this.mTime;
  4191. if (this.count > 0) {
  4192. this.fresh();
  4193. Laya.Laya.timer.clear(this, this.removeSelfLater);
  4194. }
  4195. else {
  4196. this.working = false;
  4197. Laya.Laya.timer.once(ReCacheRecInfo.showTime, this, this.removeSelfLater);
  4198. }
  4199. this.count = 0;
  4200. this.mTime = 0;
  4201. }
  4202. removeSelfLater() {
  4203. this.working = false;
  4204. this.removeSelf();
  4205. }
  4206. set working(v) {
  4207. this.isWorking = v;
  4208. if (v) {
  4209. Laya.Laya.timer.loop(1000, this, this.updates);
  4210. }
  4211. else {
  4212. Laya.Laya.timer.clear(this, this.updates);
  4213. }
  4214. }
  4215. }
  4216. ReCacheRecInfo.showTime = 3000;
  4217. class CacheAnalyser {
  4218. constructor() {
  4219. }
  4220. static renderLoopBegin() {
  4221. DebugInfoLayer.I.cacheViewLayer.graphics.clear();
  4222. }
  4223. static get I() {
  4224. if (!CacheAnalyser._instance) {
  4225. CacheAnalyser._instance = new CacheAnalyser();
  4226. }
  4227. return CacheAnalyser._instance;
  4228. }
  4229. static set I(value) {
  4230. CacheAnalyser._instance = value;
  4231. }
  4232. static getNodeInfoByNode(node) {
  4233. IDTools.idObj(node);
  4234. var key;
  4235. key = IDTools.getObjID(node);
  4236. if (!CacheAnalyser._nodeInfoDic[key]) {
  4237. CacheAnalyser._nodeInfoDic[key] = new ReCacheRecInfo();
  4238. }
  4239. CacheAnalyser._nodeInfoDic[key].setTarget(node);
  4240. return CacheAnalyser._nodeInfoDic[key];
  4241. }
  4242. renderCanvas(sprite, time = 0) {
  4243. if (!CacheAnalyser.showCacheSprite)
  4244. return;
  4245. if (DebugInfoLayer.I.isDebugItem(sprite))
  4246. return;
  4247. DebugTool.showDisBoundToSprite(sprite, DebugInfoLayer.I.cacheViewLayer, DebugConsts.CANVAS_REC_COLOR, 4);
  4248. }
  4249. reCacheCanvas(sprite, time = 0) {
  4250. if (!CacheAnalyser.showRecacheSprite)
  4251. return;
  4252. if (DebugInfoLayer.I.isDebugItem(sprite))
  4253. return;
  4254. var info;
  4255. info = CacheAnalyser.getNodeInfoByNode(sprite);
  4256. info.addCount(time);
  4257. CacheAnalyser.counter.addTime(sprite, time);
  4258. if (!info.parent) {
  4259. DebugInfoLayer.I.nodeRecInfoLayer.addChild(info);
  4260. }
  4261. }
  4262. }
  4263. CacheAnalyser.counter = new ObjTimeCountTool();
  4264. CacheAnalyser._nodeInfoDic = {};
  4265. CacheAnalyser.showCacheSprite = false;
  4266. CacheAnalyser.showRecacheSprite = true;
  4267. class Notice extends Laya.EventDispatcher {
  4268. constructor() { super(); }
  4269. static get I() {
  4270. if (!Notice._instance) {
  4271. Notice._instance = new Notice();
  4272. }
  4273. return Notice._instance;
  4274. }
  4275. static set I(value) {
  4276. Notice._instance = value;
  4277. }
  4278. static notify(type, data = null) {
  4279. Notice.I.event(type, data);
  4280. }
  4281. static listen(type, _scope, fun, args = null, cancelBefore = false) {
  4282. if (cancelBefore)
  4283. Notice.cancel(type, _scope, fun);
  4284. Notice.I.on(type, _scope, fun, args);
  4285. }
  4286. static cancel(type, _scope, fun) {
  4287. Notice.I.off(type, _scope, fun);
  4288. }
  4289. }
  4290. class DButton extends Laya.Text {
  4291. constructor() {
  4292. super();
  4293. this.bgColor = "#ffff00";
  4294. this.wordWrap = false;
  4295. this.mouseEnabled = true;
  4296. }
  4297. }
  4298. class DisplayHook {
  4299. constructor() {
  4300. this._matrix = new Laya.Matrix();
  4301. this._point = new Laya.Point();
  4302. this._rect = new Laya.Rectangle();
  4303. this._event = Laya.Event.EMPTY;
  4304. this.isGetting = false;
  4305. this._stage = Laya.Laya.stage;
  4306. this.init(Laya.Render.context.canvas);
  4307. }
  4308. static initMe() {
  4309. if (!DisplayHook.instance) {
  4310. DisplayHook.instance = new DisplayHook();
  4311. DisplayHook.selectNodeUnderMouse = DebugTool.selectNodeUnderMouse;
  4312. DebugTool.selectNodeUnderMouse = () => {
  4313. DisplayHook.instance.selectDisUnderMouse();
  4314. DisplayHook.selectNodeUnderMouse();
  4315. };
  4316. }
  4317. }
  4318. init(canvas) {
  4319. if (window.navigator.msPointerEnabled) {
  4320. canvas.style['-ms-content-zooming'] = 'none';
  4321. canvas.style['-ms-touch-action'] = 'none';
  4322. }
  4323. var _this = this;
  4324. document.addEventListener('mousedown', (e) => {
  4325. this._event._stoped = false;
  4326. DisplayHook.isFirst = true;
  4327. _this.check(_this._stage, e.offsetX, e.offsetY, _this.onMouseDown, true, false);
  4328. }, true);
  4329. document.addEventListener('touchstart', (e) => {
  4330. this._event._stoped = false;
  4331. DisplayHook.isFirst = true;
  4332. var touches = e.changedTouches;
  4333. for (var i = 0, n = touches.length; i < n; i++) {
  4334. var touch = touches[i];
  4335. initEvent(touch, e);
  4336. _this.check(_this._stage, _this.mouseX, _this.mouseY, _this.onMouseDown, true, false);
  4337. }
  4338. }, true);
  4339. function initEvent(e, event = null) {
  4340. _this._event._stoped = false;
  4341. _this._event.nativeEvent = event || e;
  4342. _this._target = null;
  4343. if (e.offsetX) {
  4344. _this.mouseX = e.offsetX;
  4345. _this.mouseY = e.offsetY;
  4346. }
  4347. else {
  4348. _this.mouseX = e.clientX - Laya.Laya.stage.offset.x;
  4349. _this.mouseY = e.clientY - Laya.Laya.stage.offset.y;
  4350. }
  4351. }
  4352. }
  4353. onMouseMove(ele, hit) {
  4354. this.sendEvent(ele, Laya.Event.MOUSE_MOVE);
  4355. return;
  4356. if (hit && ele != this._stage && ele !== this._target) {
  4357. if (this._target) {
  4358. if (this._target.$_MOUSEOVER) {
  4359. this._target.$_MOUSEOVER = false;
  4360. this._target.event(Laya.Event.MOUSE_OUT);
  4361. }
  4362. }
  4363. this._target = ele;
  4364. if (!ele.$_MOUSEOVER) {
  4365. ele.$_MOUSEOVER = true;
  4366. this.sendEvent(ele, Laya.Event.MOUSE_OVER);
  4367. }
  4368. }
  4369. else if (!hit && this._target && ele === this._target) {
  4370. this._target = null;
  4371. if (ele.$_MOUSEOVER) {
  4372. ele.$_MOUSEOVER = false;
  4373. this.sendEvent(ele, Laya.Event.MOUSE_OUT);
  4374. }
  4375. }
  4376. }
  4377. onMouseUp(ele, hit) {
  4378. hit && this.sendEvent(ele, Laya.Event.MOUSE_UP);
  4379. }
  4380. onMouseDown(ele, hit) {
  4381. if (hit) {
  4382. ele.$_MOUSEDOWN = true;
  4383. this.sendEvent(ele, Laya.Event.MOUSE_DOWN);
  4384. }
  4385. }
  4386. sendEvent(ele, type) {
  4387. if (!this._event._stoped) {
  4388. ele.event(type, this._event.setTo(type, ele, ele));
  4389. if (type === Laya.Event.MOUSE_UP && ele.$_MOUSEDOWN) {
  4390. ele.$_MOUSEDOWN = false;
  4391. ele.event(Laya.Event.CLICK, this._event.setTo(Laya.Event.CLICK, ele, ele));
  4392. }
  4393. }
  4394. }
  4395. selectDisUnderMouse() {
  4396. DisplayHook.isFirst = true;
  4397. this.check(Laya.Laya.stage, Laya.Laya.stage.mouseX, Laya.Laya.stage.mouseY, null, true, false);
  4398. }
  4399. getDisUnderMouse() {
  4400. this.isGetting = true;
  4401. DisplayHook.isFirst = true;
  4402. DebugTool.target = null;
  4403. this.check(Laya.Laya.stage, Laya.Laya.stage.mouseX, Laya.Laya.stage.mouseY, null, true, false);
  4404. this.isGetting = false;
  4405. return DebugTool.target;
  4406. }
  4407. check(sp, mouseX, mouseY, callBack, hitTest, mouseEnable) {
  4408. if (sp == DebugTool.debugLayer)
  4409. return false;
  4410. if (sp == DebugInfoLayer.I)
  4411. return false;
  4412. if (this.isGetting && sp == DebugInfoLayer.I)
  4413. return false;
  4414. if (!sp.visible || sp.getSelfBounds().width <= 0)
  4415. return false;
  4416. var isHit = false;
  4417. mouseEnable = true;
  4418. if (mouseEnable) {
  4419. var graphicHit = false;
  4420. if (hitTest) {
  4421. this._rect = sp.getBounds();
  4422. isHit = this._rect.contains(mouseX, mouseY);
  4423. this._point.setTo(mouseX, mouseY);
  4424. sp.fromParentPoint(this._point);
  4425. mouseX = this._point.x;
  4426. mouseY = this._point.y;
  4427. }
  4428. if (isHit) {
  4429. var flag = false;
  4430. for (var i = sp._children.length - 1; i > -1; i--) {
  4431. var child = sp._children[i];
  4432. (flag = this.check(child, mouseX, mouseY, callBack, hitTest, true));
  4433. if (flag)
  4434. break;
  4435. }
  4436. graphicHit = sp.getGraphicBounds().contains(mouseX, mouseY);
  4437. isHit = flag || graphicHit;
  4438. if (isHit && !flag && DisplayHook.isFirst) {
  4439. DisplayHook.isFirst = false;
  4440. if (!(sp instanceof DButton)) {
  4441. DebugTool.target = sp;
  4442. if (!this.isGetting) {
  4443. DebugTool.autoWork();
  4444. Notice.notify(DisplayHook.ITEM_CLICKED, sp);
  4445. }
  4446. }
  4447. }
  4448. }
  4449. }
  4450. return isHit;
  4451. }
  4452. }
  4453. DisplayHook.ITEM_CLICKED = "ItemClicked";
  4454. DisplayHook.isFirst = false;
  4455. class ClickSelectTool {
  4456. constructor() {
  4457. this._selectTip = new Laya.Sprite();
  4458. this._selectTip.setSelfBounds(new Laya.Rectangle(0, 0, 0, 0));
  4459. Notice.listen(DisplayHook.ITEM_CLICKED, this, this.itemClicked);
  4460. }
  4461. static get I() {
  4462. if (!ClickSelectTool._I)
  4463. ClickSelectTool._I = new ClickSelectTool();
  4464. return ClickSelectTool._I;
  4465. }
  4466. beginClickSelect(complete = null) {
  4467. this.completeHandler = complete;
  4468. ClickSelectTool.isClickSelectState = true;
  4469. this.clickSelectChange();
  4470. }
  4471. clickSelectChange() {
  4472. if (!Laya.Browser.onPC)
  4473. return;
  4474. this.tSelectTar = null;
  4475. this.clearSelectTip();
  4476. if (ClickSelectTool.isClickSelectState) {
  4477. Laya.Laya.timer.loop(200, this, this.updateSelectTar, null, true);
  4478. }
  4479. else {
  4480. Laya.Laya.timer.clear(this, this.updateSelectTar);
  4481. }
  4482. }
  4483. clearSelectTip() {
  4484. this._selectTip.removeSelf();
  4485. }
  4486. updateSelectTar() {
  4487. this.clearSelectTip();
  4488. this.tSelectTar = DisplayHook.instance.getDisUnderMouse();
  4489. if (!this.tSelectTar) {
  4490. return;
  4491. }
  4492. if (DebugInfoLayer.I.isDebugItem(this.tSelectTar))
  4493. return;
  4494. var g;
  4495. g = this._selectTip.graphics;
  4496. g.clear();
  4497. var rec;
  4498. rec = NodeUtils.getGRec(this.tSelectTar);
  4499. DebugInfoLayer.I.popLayer.addChild(this._selectTip);
  4500. g.drawRect(0, 0, rec.width, rec.height, null, DebugConsts.CLICK_SELECT_COLOR, 2);
  4501. this._selectTip.pos(rec.x, rec.y);
  4502. }
  4503. itemClicked(tar) {
  4504. if (!ClickSelectTool.isClickSelectState)
  4505. return;
  4506. if (ClickSelectTool.ignoreDebugTool) {
  4507. if (DebugInfoLayer.I.isDebugItem(tar))
  4508. return;
  4509. }
  4510. DebugTool.showDisBound(tar);
  4511. if (this.completeHandler) {
  4512. this.completeHandler.runWith(tar);
  4513. }
  4514. ClickSelectTool.isClickSelectState = false;
  4515. this.clickSelectChange();
  4516. }
  4517. }
  4518. ClickSelectTool.isClickSelectState = false;
  4519. ClickSelectTool.ignoreDebugTool = false;
  4520. class RenderSpriteHook {
  4521. constructor() {
  4522. }
  4523. static init() {
  4524. if (RenderSpriteHook._oldCanvas)
  4525. return;
  4526. RenderSpriteHook._oldCanvas = Laya.RenderSprite["prototype"]["_canvas"];
  4527. Laya.RenderSprite["prototype"]["_canvas"] = RenderSpriteHook["prototype"]["_canvas"];
  4528. }
  4529. _canvas(sprite, context, x, y) {
  4530. var _cacheStyle = sprite._cacheStyle;
  4531. var _next = this._next;
  4532. var _repaint;
  4533. if (!_cacheStyle.enableCanvasRender) {
  4534. RenderSpriteHook._oldCanvas.call(this, sprite, context, x, y);
  4535. return;
  4536. }
  4537. if (sprite._needRepaint() || (!_cacheStyle.canvas)) {
  4538. _repaint = true;
  4539. }
  4540. else {
  4541. _repaint = false;
  4542. }
  4543. var preTime;
  4544. preTime = Laya.Browser.now();
  4545. RenderSpriteHook._oldCanvas.call(this, sprite, context, x, y);
  4546. if (_repaint) {
  4547. CacheAnalyser.I.reCacheCanvas(sprite, Laya.Browser.now() - preTime);
  4548. }
  4549. else {
  4550. CacheAnalyser.I.renderCanvas(sprite, Laya.Browser.now() - preTime);
  4551. }
  4552. }
  4553. }
  4554. RenderSpriteHook.IMAGE = 0x01;
  4555. RenderSpriteHook.FILTERS = 0x02;
  4556. RenderSpriteHook.ALPHA = 0x04;
  4557. RenderSpriteHook.TRANSFORM = 0x08;
  4558. RenderSpriteHook.CANVAS = 0x10;
  4559. RenderSpriteHook.BLEND = 0x20;
  4560. RenderSpriteHook.CLIP = 0x40;
  4561. RenderSpriteHook.STYLE = 0x80;
  4562. RenderSpriteHook.GRAPHICS = 0x100;
  4563. RenderSpriteHook.CUSTOM = 0x200;
  4564. RenderSpriteHook.ENABLERENDERMERGE = 0x400;
  4565. RenderSpriteHook.CHILDS = 0x800;
  4566. RenderSpriteHook.INIT = 0x11111;
  4567. RenderSpriteHook.renders = [];
  4568. class SpriteRenderHook {
  4569. constructor() {
  4570. this._repaint = 1;
  4571. this._renderType = 1;
  4572. }
  4573. static init() {
  4574. if (SpriteRenderHook.I)
  4575. return;
  4576. SpriteRenderHook.I = new SpriteRenderHook();
  4577. SpriteRenderHook.setRenderHook();
  4578. }
  4579. static setRenderHook() {
  4580. Laya.Sprite["prototype"]["render"] = SpriteRenderHook.I.render;
  4581. }
  4582. static showDisplayBorder(sprite, ifShowBorder = true) {
  4583. sprite[SpriteRenderHook.ShowBorderSign] = ifShowBorder;
  4584. }
  4585. static isDisplayShowBorder(sprite) {
  4586. return sprite[SpriteRenderHook.ShowBorderSign];
  4587. }
  4588. render(context, x, y) {
  4589. if (this == Laya.Laya.stage) {
  4590. CacheAnalyser.renderLoopBegin();
  4591. }
  4592. var preTime;
  4593. preTime = Laya.Browser.now();
  4594. if (this[SpriteRenderHook.ShowBorderSign]) {
  4595. DebugTool.showDisBoundToSprite(this, DebugInfoLayer.I.cacheViewLayer, DebugConsts.SPRITE_REC_COLOR, DebugConsts.SPRITE_REC_LINEWIDTH);
  4596. }
  4597. Laya.RenderSprite.renders[this._renderType]._fun(this, context, x + this._x, y + this._y);
  4598. this._repaint = 0;
  4599. RenderAnalyser.I.render(this, Laya.Browser.now() - preTime);
  4600. }
  4601. }
  4602. SpriteRenderHook.ShowBorderSign = "ShowBorderSign";
  4603. class JSTools {
  4604. constructor() {
  4605. }
  4606. static showToBody(el, x = 0, y = 0) {
  4607. Laya.Browser.document.body.appendChild(el);
  4608. var style;
  4609. style = el.style;
  4610. style.position = "absolute";
  4611. style.top = y + "px";
  4612. style.left = x + "px";
  4613. }
  4614. static showToParent(el, x = 0, y = 0, parent = null) {
  4615. parent.appendChild(el);
  4616. var style;
  4617. style = el.style;
  4618. style.position = "absolute";
  4619. style.top = y + "px";
  4620. style.left = x + "px";
  4621. }
  4622. static addToBody(el) {
  4623. Laya.Browser.document.body.appendChild(el);
  4624. }
  4625. static setPos(el, x, y) {
  4626. var style;
  4627. style = el.style;
  4628. style.top = y + "px";
  4629. style.left = x + "px";
  4630. }
  4631. static setSize(el, width, height) {
  4632. var style;
  4633. style = el.style;
  4634. style.width = width + "px";
  4635. style.height = height + "px";
  4636. }
  4637. static setTransform(el, mat) {
  4638. var style;
  4639. style = el.style;
  4640. style.transformOrigin = style.webkitTransformOrigin = style.msTransformOrigin = style.mozTransformOrigin = style.oTransformOrigin = "0px 0px 0px";
  4641. style.transform = style.webkitTransform = style.msTransform = style.mozTransform = style.oTransform = "matrix(" + mat.toString() + ")";
  4642. }
  4643. static noMouseEvent(el) {
  4644. var style;
  4645. style = el.style;
  4646. style["pointer-events"] = "none";
  4647. }
  4648. static setMouseEnable(el, enable) {
  4649. var style;
  4650. style = el.style;
  4651. style["pointer-events"] = enable ? "auto" : "none";
  4652. }
  4653. static setZIndex(el, zIndex) {
  4654. var style;
  4655. style = el.style;
  4656. style["z-index"] = zIndex;
  4657. }
  4658. static showAboveSprite(el, sprite, dx = 0, dy = 0) {
  4659. var pos;
  4660. pos = new Laya.Point();
  4661. pos = sprite.localToGlobal(pos);
  4662. pos.x += dx;
  4663. pos.y += dy;
  4664. pos.x += Laya.Laya.stage.offset.x;
  4665. pos.y += Laya.Laya.stage.offset.y;
  4666. JSTools.showToBody(el, pos.x, pos.y);
  4667. }
  4668. static removeElement(el) {
  4669. Laya.Browser.removeElement(el);
  4670. }
  4671. static isElementInDom(el) {
  4672. return el && el.parentNode;
  4673. }
  4674. static getImageSpriteByFile(file, width = 0, height = 0) {
  4675. var reader;
  4676. reader = new FileReader();
  4677. reader.readAsDataURL(file);
  4678. var sprite;
  4679. sprite = new Laya.Sprite();
  4680. reader.onload = function (e) {
  4681. var txt;
  4682. txt = new Laya.Texture();
  4683. txt.load(reader.result);
  4684. sprite.graphics.drawTexture(txt, 0, 0, width, height);
  4685. };
  4686. return sprite;
  4687. }
  4688. static getPixelRatio() {
  4689. if (JSTools._pixelRatio > 0)
  4690. return JSTools._pixelRatio;
  4691. var canvas = Laya.Browser.createElement("canvas");
  4692. var context = canvas.getContext('2d');
  4693. var devicePixelRatio = Laya.Browser.window.devicePixelRatio || 1;
  4694. var backingStoreRatio = context.webkitBackingStorePixelRatio ||
  4695. context.mozBackingStorePixelRatio ||
  4696. context.msBackingStorePixelRatio ||
  4697. context.oBackingStorePixelRatio ||
  4698. context.backingStorePixelRatio || 1;
  4699. var ratio = devicePixelRatio / backingStoreRatio;
  4700. console.log("pixelRatioc:", ratio);
  4701. JSTools._pixelRatio = ratio;
  4702. return ratio;
  4703. }
  4704. }
  4705. JSTools._pixelRatio = -1;
  4706. class DebugPanel {
  4707. constructor() {
  4708. this.preValueO = {};
  4709. this.height = 300;
  4710. this.width = 600;
  4711. this.dragArea = 10;
  4712. this.fromMe = false;
  4713. this._init();
  4714. }
  4715. static enable(underGame = true, bgColor = "#ffffff") {
  4716. if (!DebugPanel._enable && !DebugPanel.I) {
  4717. DebugPanel._enable = true;
  4718. DebugPanel.overlay = !underGame;
  4719. DivScripts.init();
  4720. DisplayHook.initMe();
  4721. DebugTool.initBasicFunctions();
  4722. RenderSpriteHook.init();
  4723. SpriteRenderHook.init();
  4724. DebugPanel.I = new DebugPanel();
  4725. DebugPanel.I.setRoot(Laya.Laya.stage);
  4726. CacheAnalyser.showRecacheSprite = false;
  4727. if (bgColor) {
  4728. DebugPanel.I.div.style.background = bgColor;
  4729. }
  4730. }
  4731. }
  4732. static getSpriteTreeArr(sprite) {
  4733. var rst;
  4734. rst = {};
  4735. rst[DebugPanel.LabelSign] = "" + ClassTool.getNodeClassAndName(sprite);
  4736. rst.target = sprite;
  4737. IDTools.idObj(sprite);
  4738. rst.id = IDTools.getObjID(sprite);
  4739. var childs;
  4740. childs = sprite._children;
  4741. var i, len;
  4742. len = childs.length;
  4743. var childsList;
  4744. childsList = [];
  4745. rst[DebugPanel.ChildrenSign] = childsList;
  4746. for (i = 0; i < len; i++) {
  4747. childsList.push(DebugPanel.getSpriteTreeArr(childs[i]));
  4748. }
  4749. return rst;
  4750. }
  4751. removeNoDisplayKeys(arr) {
  4752. var i;
  4753. for (i = arr.length - 1; i >= 0; i--) {
  4754. if (DebugPanel.noDisplayKeys[arr[i]]) {
  4755. arr.splice(i, 1);
  4756. }
  4757. }
  4758. }
  4759. updateShowKeys() {
  4760. DebugPanel.tObjKeys.length = 0;
  4761. if (!this.tShowObj)
  4762. return;
  4763. DebugPanel.tObjKeys = ClassTool.getObjectDisplayAbleKeys(this.tShowObj, DebugPanel.tObjKeys);
  4764. if (this.tShowObj == Laya.Laya.stage) {
  4765. this.removeNoDisplayKeys(DebugPanel.tObjKeys);
  4766. }
  4767. DebugPanel.tObjKeys.sort(Laya.MathUtil.sortSmallFirst);
  4768. }
  4769. static getObjectData(data) {
  4770. var dataList;
  4771. var tData;
  4772. var key;
  4773. var tValue;
  4774. var tType;
  4775. dataList = [];
  4776. var keys;
  4777. keys = DebugPanel.tObjKeys;
  4778. var i, len;
  4779. len = keys.length;
  4780. for (i = 0; i < len; i++) {
  4781. key = keys[i];
  4782. tValue = data[key];
  4783. tType = typeof (tValue);
  4784. if (key.charAt(0) == "_")
  4785. continue;
  4786. if (DebugPanel.displayTypes[tType]) {
  4787. tData = {};
  4788. tData["key"] = key;
  4789. tData["value"] = tValue;
  4790. tData["type"] = tType;
  4791. dataList.push(tData);
  4792. }
  4793. }
  4794. return dataList;
  4795. }
  4796. _init() {
  4797. this.div = Laya.Browser.document.createElement('div');
  4798. Laya.Browser.document.body.appendChild(this.div);
  4799. this.clickedHandler = new Laya.Handler(this, this.onClickSelected);
  4800. this.debug_view = Laya.Browser.window.layaair_debug_view;
  4801. this.debug_view.initLayaAirDebugView(this.div);
  4802. this.debug_view.tree.attachEvent("onSelect", (id) => {
  4803. var dataO;
  4804. dataO = this.getDataByID(id, this._treeDataList[0]);
  4805. if (dataO.target) {
  4806. DebugTool.showDisBound(dataO.target);
  4807. this.showTargetInfo(dataO.target);
  4808. }
  4809. });
  4810. this.debug_view.setValueChangeHandler((data, new_value) => {
  4811. this.onValueChange(data, new_value);
  4812. });
  4813. this.debug_view.onRefresh(() => {
  4814. DebugPanel.I.setRoot(Laya.Laya.stage);
  4815. });
  4816. this.debug_view.onInspectElement(() => {
  4817. ClickSelectTool.I.beginClickSelect(this.clickedHandler);
  4818. });
  4819. this.debug_view.onLogInfo(() => {
  4820. console.log(this.tShowObj);
  4821. });
  4822. this.debug_view.onPrintEnabledNodeChain(() => {
  4823. DebugTool.traceDisMouseEnable(this.tShowObj);
  4824. });
  4825. this.debug_view.onPrintSizeChain(() => {
  4826. DebugTool.traceDisSizeChain(this.tShowObj);
  4827. });
  4828. this.debug_view.onToggleVisibility((selectd) => {
  4829. if (this.tShowObj) {
  4830. this.tShowObj.visible = this.debug_view.getVisibility();
  4831. }
  4832. });
  4833. this.debug_view.onToggleDebugBorder((selectd) => {
  4834. if (!this.tShowObj)
  4835. return;
  4836. SpriteRenderHook.showDisplayBorder(this.tShowObj, this.debug_view.getShowDebugBorder());
  4837. });
  4838. this.debug_view.onToggleShowCurrentCache((selectd) => {
  4839. CacheAnalyser.showRecacheSprite = this.debug_view.getShowCurrentCache();
  4840. });
  4841. this.debug_view.onToggleShowAllCache((selectd) => {
  4842. CacheAnalyser.showCacheSprite = this.debug_view.getShowAllCache();
  4843. });
  4844. this.debug_view.onToggleShowAtlas((selectd) => {
  4845. console.log("toggle show atlas:", this.debug_view.getShowAtlas());
  4846. if (this.debug_view.getShowAtlas()) {
  4847. AtlasTools.getInstance().start();
  4848. }
  4849. else {
  4850. AtlasTools.getInstance().end();
  4851. }
  4852. });
  4853. JSTools.showToBody(this.div, 0, 0);
  4854. this.initNewDivs();
  4855. this.initDragWork();
  4856. this.initTreeWidthDrag();
  4857. Laya.Laya.stage.on(Laya.Event.RESIZE, this, this.adptPos);
  4858. this.adptPos();
  4859. }
  4860. initNewDivs() {
  4861. var parentNode;
  4862. parentNode = Laya.Browser.document.getElementById("show_current_cache_control").parentNode;
  4863. var switchNode;
  4864. switchNode = Laya.Browser.createElement("input");
  4865. switchNode.type = "checkbox";
  4866. parentNode.appendChild(switchNode);
  4867. parentNode.append("右侧");
  4868. function onSwitchChange(e) {
  4869. if (e.target.checked) {
  4870. DebugPanel.sideType = DebugPanel.Right;
  4871. }
  4872. else {
  4873. DebugPanel.sideType = DebugPanel.Bottom;
  4874. }
  4875. this.adptPos();
  4876. }
  4877. switchNode.addEventListener("change", onSwitchChange.bind(this));
  4878. }
  4879. static getOffset(e, sign) {
  4880. var target;
  4881. target = e.target;
  4882. var cTarget;
  4883. cTarget = e.currentTarget;
  4884. var kSign;
  4885. if (sign == "X") {
  4886. kSign = "offsetLeft";
  4887. }
  4888. else {
  4889. kSign = "offsetTop";
  4890. }
  4891. var value;
  4892. value = e["offset" + sign];
  4893. while (target && target != cTarget) {
  4894. value += target[kSign];
  4895. target = target.offsetParent;
  4896. }
  4897. return value;
  4898. }
  4899. initTreeWidthDrag() {
  4900. var leftDiv;
  4901. var rightDiv;
  4902. leftDiv = Laya.Browser.document.getElementById("tree_container");
  4903. var parentNode;
  4904. parentNode = leftDiv.parentNode;
  4905. rightDiv = parentNode.children[1];
  4906. var isMouseDown = false;
  4907. function onDivMouseMove(e) {
  4908. var abs;
  4909. abs = Math.abs(DebugPanel.getOffset(e, "X") - leftDiv.clientWidth);
  4910. if (abs < this.dragArea) {
  4911. this.div.style.cursor = "e-resize";
  4912. }
  4913. else {
  4914. this.div.style.cursor = "auto";
  4915. }
  4916. }
  4917. function onDivMouseDown(e) {
  4918. var abs;
  4919. abs = Math.abs(DebugPanel.getOffset(e, "X") - leftDiv.clientWidth);
  4920. if (abs < this.dragArea) {
  4921. this.div.style.cursor = "e-resize";
  4922. isMouseDown = true;
  4923. }
  4924. else {
  4925. isMouseDown = false;
  4926. return;
  4927. }
  4928. e.stopPropagation();
  4929. }
  4930. function onBodyMouseMove(e) {
  4931. if (!isMouseDown)
  4932. return;
  4933. leftDiv.style.width = DebugPanel.getOffset(e, "X") + "px";
  4934. e.stopPropagation();
  4935. }
  4936. function onDivMouseUp(e) {
  4937. if (!isMouseDown)
  4938. return;
  4939. isMouseDown = false;
  4940. e.stopPropagation();
  4941. }
  4942. parentNode.addEventListener("mousedown", onDivMouseDown.bind(this), true);
  4943. parentNode.addEventListener("mousemove", onDivMouseMove.bind(this), true);
  4944. Laya.Browser.document.body.addEventListener("mousemove", onBodyMouseMove.bind(this));
  4945. Laya.Browser.document.body.addEventListener("mouseup", onDivMouseUp.bind(this));
  4946. }
  4947. initDragWork() {
  4948. var isMouseDown = false;
  4949. var preX;
  4950. var preY;
  4951. function onDivMouseMove(e) {
  4952. if (DebugPanel.sideType == DebugPanel.Bottom) {
  4953. if (DebugPanel.getOffset(e, "Y") < this.dragArea) {
  4954. this.div.style.cursor = "n-resize";
  4955. }
  4956. else {
  4957. this.div.style.cursor = "auto";
  4958. }
  4959. }
  4960. else {
  4961. if (DebugPanel.getOffset(e, "X") < this.dragArea) {
  4962. this.div.style.cursor = "e-resize";
  4963. }
  4964. else {
  4965. this.div.style.cursor = "auto";
  4966. }
  4967. }
  4968. }
  4969. function onDivMouseDown(e) {
  4970. if (DebugPanel.sideType == DebugPanel.Bottom) {
  4971. if (DebugPanel.getOffset(e, "Y") > this.dragArea)
  4972. return;
  4973. }
  4974. else {
  4975. if (DebugPanel.getOffset(e, "X") > this.dragArea)
  4976. return;
  4977. }
  4978. isMouseDown = true;
  4979. preX = e.pageX;
  4980. preY = e.pageY;
  4981. e.stopPropagation();
  4982. }
  4983. function onBodyMouseMove(e) {
  4984. if (!isMouseDown)
  4985. return;
  4986. var curX;
  4987. var curY;
  4988. var dX;
  4989. var dY;
  4990. curX = e.pageX;
  4991. curY = e.pageY;
  4992. dX = curX - preX;
  4993. dY = curY - preY;
  4994. if (DebugPanel.sideType == DebugPanel.Bottom) {
  4995. this.height -= dY;
  4996. }
  4997. else {
  4998. this.width -= dX;
  4999. }
  5000. this.adptPos();
  5001. preX = curX;
  5002. preY = curY;
  5003. e.stopPropagation();
  5004. }
  5005. function onDivMouseUp(e) {
  5006. if (!isMouseDown)
  5007. return;
  5008. isMouseDown = false;
  5009. e.stopPropagation();
  5010. }
  5011. this.div.addEventListener("mousedown", onDivMouseDown.bind(this), true);
  5012. this.div.addEventListener("mousemove", onDivMouseMove.bind(this), true);
  5013. Laya.Browser.document.body.addEventListener("mousemove", onBodyMouseMove.bind(this));
  5014. Laya.Browser.document.body.addEventListener("mouseup", onDivMouseUp.bind(this));
  5015. }
  5016. onClickSelected(target) {
  5017. if (!this._treeDataList)
  5018. return;
  5019. this.debug_view.tree.selectItem(IDTools.getObjID(target));
  5020. this.debug_view.bounceUpInspectButton();
  5021. }
  5022. updateLoop() {
  5023. if (this.tShowObj) {
  5024. this.showTargetInfo(this.tShowObj);
  5025. }
  5026. }
  5027. onSelectItem(obj) {
  5028. var tTarget;
  5029. tTarget = obj.target;
  5030. this.showTargetInfo(tTarget);
  5031. }
  5032. static mParseFloat(v) {
  5033. var rst;
  5034. rst = parseFloat(v);
  5035. if (isNaN(rst))
  5036. return 0;
  5037. return rst;
  5038. }
  5039. onValueChange(obj, newValue) {
  5040. if (obj["type"] == "number") {
  5041. newValue = DebugPanel.mParseFloat(newValue);
  5042. }
  5043. if (obj["type"] == "boolean") {
  5044. newValue = newValue.toString() == "true";
  5045. }
  5046. if (this.tShowObj) {
  5047. var key;
  5048. key = obj["key"];
  5049. this.preValueO[key] = this.tShowObj[key] = newValue;
  5050. }
  5051. }
  5052. showTargetInfo(tTarget) {
  5053. if (!tTarget)
  5054. return;
  5055. this.debug_view.setVisibility(tTarget.visible);
  5056. this.debug_view.setShowDebugBorder(SpriteRenderHook.isDisplayShowBorder(tTarget));
  5057. var i, len;
  5058. len = DebugPanel.tObjKeys.length;
  5059. var key;
  5060. if (this.tShowObj == tTarget) {
  5061. for (i = 0; i < len; i++) {
  5062. key = DebugPanel.tObjKeys[i];
  5063. if (this.preValueO[key] != tTarget[key]) {
  5064. this.debug_view.changeValueByLabel(key, tTarget[key]);
  5065. }
  5066. }
  5067. }
  5068. else {
  5069. this.tShowObj = tTarget;
  5070. this.updateShowKeys();
  5071. var dataList;
  5072. dataList = DebugPanel.getObjectData(tTarget);
  5073. this.debug_view.setContents(dataList);
  5074. }
  5075. }
  5076. adptPos() {
  5077. if (this.fromMe)
  5078. return;
  5079. this.fromMe = true;
  5080. if (DebugPanel.sideType == DebugPanel.Bottom) {
  5081. JSTools.setPos(this.div, 0, Laya.Browser.clientHeight - this.height);
  5082. this.debug_view.resize(Laya.Browser.clientWidth, this.height);
  5083. if (!DebugPanel.overlay) {
  5084. Laya.Laya.stage.setScreenSize(Laya.Browser.clientWidth * Laya.Browser.pixelRatio, (Laya.Browser.clientHeight - this.height) * Laya.Browser.pixelRatio);
  5085. }
  5086. }
  5087. else {
  5088. JSTools.setPos(this.div, Laya.Browser.clientWidth - this.width, 0);
  5089. this.debug_view.resize(this.width, Laya.Browser.clientHeight);
  5090. if (!DebugPanel.overlay) {
  5091. let newWidth = 0;
  5092. if (Laya.Browser.clientWidth > this.width) {
  5093. newWidth = (Laya.Browser.clientWidth - this.width) * Laya.Browser.pixelRatio;
  5094. }
  5095. Laya.Laya.stage.setScreenSize(newWidth, Laya.Browser.clientHeight * Laya.Browser.pixelRatio);
  5096. }
  5097. }
  5098. this.fromMe = false;
  5099. }
  5100. setRoot(sprite) {
  5101. var mtreeo;
  5102. mtreeo = DebugPanel.getSpriteTreeArr(sprite);
  5103. this._treeDataList = [mtreeo];
  5104. var wraped;
  5105. wraped = {};
  5106. wraped.id = 0;
  5107. wraped.item = [mtreeo];
  5108. this.debug_view.setTree(wraped);
  5109. Laya.Laya.timer.loop(500, this, this.updateLoop);
  5110. }
  5111. getDataByID(targetID, nodeO) {
  5112. if (!nodeO)
  5113. return null;
  5114. if (targetID == nodeO.id)
  5115. return nodeO;
  5116. var childs;
  5117. childs = nodeO[DebugPanel.ChildrenSign];
  5118. if (!childs)
  5119. return null;
  5120. var i, len;
  5121. len = childs.length;
  5122. var tRst;
  5123. for (i = 0; i < len; i++) {
  5124. tRst = this.getDataByID(targetID, childs[i]);
  5125. if (tRst)
  5126. return tRst;
  5127. }
  5128. return null;
  5129. }
  5130. getDataByTarget(target, nodeO) {
  5131. if (!nodeO)
  5132. return null;
  5133. if (target == nodeO.target)
  5134. return nodeO;
  5135. var childs;
  5136. childs = nodeO[DebugPanel.ChildrenSign];
  5137. if (!childs)
  5138. return null;
  5139. var i, len;
  5140. len = childs.length;
  5141. var tRst;
  5142. for (i = 0; i < len; i++) {
  5143. tRst = this.getDataByTarget(target, childs[i]);
  5144. if (tRst)
  5145. return tRst;
  5146. }
  5147. return null;
  5148. }
  5149. }
  5150. DebugPanel._enable = false;
  5151. DebugPanel.ChildrenSign = "item";
  5152. DebugPanel.LabelSign = "text";
  5153. DebugPanel.displayTypes = { "boolean": true, "number": true, "string": true };
  5154. DebugPanel.displayKeys = [["x", "number"], ["y", "number"], ["width", "number"], ["width", "number"], ["width", "number"], ["width", "number"], ["width", "number"], ["width", "number"], ["width", "number"], ["width", "number"], ["width", "number"]];
  5155. DebugPanel.tObjKeys = [];
  5156. DebugPanel.noDisplayKeys = { "desginWidth": true, "desginHeight": true };
  5157. DebugPanel.Bottom = "bottom";
  5158. DebugPanel.Right = "right";
  5159. DebugPanel.sideType = DebugPanel.Bottom;
  5160. class Base64ImageTool {
  5161. constructor() {
  5162. }
  5163. static getCanvasPic(img) {
  5164. img = img.bitmap;
  5165. var canvas = Laya.Browser.createElement("canvas");
  5166. var ctx = canvas.getContext('2d');
  5167. canvas.height = img.height;
  5168. canvas.width = img.width;
  5169. ctx.drawImage(img.bitmap, 0, 0);
  5170. return canvas;
  5171. }
  5172. static getBase64Pic(img) {
  5173. return Base64ImageTool.getCanvasPic(img).toDataURL("image/png");
  5174. }
  5175. static getPreloads(base64Data) {
  5176. var rst;
  5177. rst = [];
  5178. var key;
  5179. for (key in base64Data) {
  5180. rst.push({ url: base64Data[key], type: Laya.Loader.IMAGE });
  5181. }
  5182. return rst;
  5183. }
  5184. }
  5185. class Base64Atlas {
  5186. constructor(data, idKey = null) {
  5187. this.data = data;
  5188. if (!idKey)
  5189. idKey = Math.random() + "key";
  5190. this.idKey = idKey;
  5191. this.init();
  5192. }
  5193. init() {
  5194. this.replaceO = {};
  5195. var key;
  5196. for (key in this.data) {
  5197. this.replaceO[key] = this.idKey + "/" + key;
  5198. }
  5199. }
  5200. getAdptUrl(url) {
  5201. return this.replaceO[url];
  5202. }
  5203. preLoad(completeHandler = null) {
  5204. this._loadedHandler = completeHandler;
  5205. Laya.Laya.loader.load(Base64ImageTool.getPreloads(this.data), new Laya.Handler(this, this.preloadEnd));
  5206. }
  5207. preloadEnd() {
  5208. var key;
  5209. for (key in this.data) {
  5210. var tx;
  5211. tx = Laya.Laya.loader.getRes(this.data[key]);
  5212. Laya.Loader.cacheRes(this.replaceO[key], tx);
  5213. }
  5214. if (this._loadedHandler) {
  5215. this._loadedHandler.run();
  5216. }
  5217. }
  5218. replaceRes(uiObj) {
  5219. ObjectTools.replaceValue(uiObj, this.replaceO);
  5220. }
  5221. }
  5222. class Base64AtlasManager {
  5223. constructor() {
  5224. }
  5225. static replaceRes(uiO) {
  5226. Base64AtlasManager.base64.replaceRes(uiO);
  5227. }
  5228. }
  5229. Base64AtlasManager.dataO = { "comp/button1.png": "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAGIAAABRCAYAAAApS3MNAAABSUlEQVR4Xu3a0QmFMADFUJ1JXM0h3moPZ6qg4AoNeLqAIenFn65jjLE40w2sQkxvcAMI0eggRKSDEEJUDEQ4/COEiBiIYFiEEBEDEQyLECJiIIJhEUJEDEQwLEKIiIEIhkUIETEQwbAIISIGIhgWIUTEQATDIoSIGIhgWIQQEQMRDIsQImIggnEvYvv9IzjfxDiP/XlgJsTcCyDEXP/v14UQImIggmERQkQMRDAsQoiIgQiGRQgRMRDBsAghIgYiGBYhRMRABMMihIgYiGBYhBARAxEMixAiYiCCYRFCRAxEMCxCiIiBCMa7iAjPpzG8fY3kF0KIiIEIhkUIETEQwbAIISIGIhgWIUTEQATDIoSIGIhgWIQQEQMRDIsQImIggmERQkQMRDAsQoiIgQiGRQgRMRDBsAghIgYiGBYhRMRABMMihIgYiGBcGJiOHTRZjZAAAAAASUVORK5CYII=", "comp/line2.png": "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABQAAAAECAYAAACOXx+WAAAAG0lEQVQYV2NkoDJgpLJ5DIxtra3/qWko1V0IAJvgApS1libIAAAAAElFTkSuQmCC", "view/create.png": "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAwAAAAkCAYAAAC9itu8AAAAdElEQVQ4T2NkwAIWLFjwH5t4QkICIyM2CXQxmAHka/j///9mXDYxMjL6YtgwBDUg+w8crIT8MBQ0oEca55JvWNPS9xgu4tISzADyNfz///8MnrRkgmHDENSALWng9fRQ0DA40xLecglbWhpqGoZCMUNKUQkANAHAJVkE5XwAAAAASUVORK5CYII=", "view/rendertime.png": "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAwAAAAkCAYAAAC9itu8AAABeUlEQVQ4T+2Uv0tCURSAvyNdcwiXBlsaaomWFgeHlqAtCPsDJHwIiUtDSxERtErtmQ6CjkHo4FpDBQ0tbVFR0BYE0eQvOnFF7T17QlOTd3m88873OD8+rtA9uVzOBIPBlIisAwvd8B1QajQahXQ63bIx6QHFYrEEJHrv7qeqZhzHOfYA+Xw+Yow5B+YHoGwymdxW1QAQEFWNAk8i8uEDuZM3gUcLZIEJYNcNqWrVcZyd7p9t8jLwYIFTYBx47UHlcjmcSCQ+B5JtpU0LnAFj3br7kE+yTalb4BCYczVqoT3AjteW4T73FlgFNgY+1IGQz4hPLGCAI2DGbweu2Auw1Vmcqk4C+8DsEOgZOBCR9/6mVdU2vgIsAdOuIVwANRFpezatuahpTYVSop1m+y6pasm8NQqSvvW61KwslkSHuCRkgvErr0taiUXaal1Sr0siWRO/9HfpF+RN9nfpB/qqmrXrv7mktVhYVm5GLo1cct9LI5e8d84/3UvfAgdlKH0EO7MAAAAASUVORK5CYII=", "view/cache.png": "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAA0AAAAkCAYAAABSSLCCAAAAcElEQVQ4T2NcsGDB/4SEBEYGBgYGYtmMxCpENhhsA6mA8f///5tHNTEwkBcQpIYcSD15kUtWigi51vR/jVYdOGUQy2YkViGywWSnvTOkhiAonkY1gZIRqSEHTntkRe4g10RWQIyWe5Bgo2O5R7dkBADztyP+yFzirAAAAABJRU5ErkJggg==", "comp/clip_selectBox.png": "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAGQAAAAoCAYAAAAIeF9DAAAAsElEQVRoQ+3ZQQ0AMQzEwAuqEgh/Sj2pKObhIrBsrfLonHPu12MMTEGYFg+kIFaPgmA9ClIQzQDG0w0pCGYAw2khBcEMYDgtpCCYAQynhRQEM4DhtJCCYAYwnBZSEMwAhtNCCoIZwHBmd/tTh6IUBIrx/tRbiFWkIFaPFoL1KEhBNAMYTzekIJgBDKeFFAQzgOG0kIJgBjCcFlIQzACG00IKghnAcFpIQTADGE4LwYL8U/BE1dCJ3PsAAAAASUVORK5CYII=", "comp/label.png": "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAHgAAAASCAYAAACQCxruAAAAmElEQVRoQ+3aMQqAQBBDUef+hx4Zq1mrbPnhWylECHmghVZ397OOqqp97TlugdNzgEXFIaaFuwROt0LmBEay5aXb920+FjIpMJItLy1wvhUyKTCSLS8tcL4VMikwki0vLXC+FTIpMJItLy1wvhUyKTCSLS89wPP1Qeh8M0zy+84gMMbruqjA15OxbtjAu7mPa5bj0fb/A8cLgD4n/wQKNiIAAAAASUVORK5CYII=", "comp/clip_tree_arrow.png": "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAgAAAAQCAYAAAArij59AAAAwUlEQVQoU5WRPRKCMBCFWUt6vYQeB06RUDpoBbFDa7yDwm30FGi9dHnOMiQDBgvT5c3b7+0PRVEUlVV9A3NmzL6T//SRfMz5CgCdtVafjlmzaHAigAbM2tE8YVo1pf0yvABoc9D3wACgBbMKIgD4qqDJsqqlMV8VGL5n/88geCJKlijSMBXFZUNx/CSi9WwX1r7R99thzKKqkxXRbMUWSE2u2sEwHsxHCbrMVSq6N4xRD9HAvJstylEkarhurlqnfQC58YP5+CvQNwAAAABJRU5ErkJggg==", "view/bg_panel.png": "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAACAAAAAgCAYAAABzenr0AAAAMUlEQVRYR+3QQREAAAjDMGZk/l2CDD6pgl7SduexGCBAgAABAgQIECBAgAABAgS+BQ4oyStBhXcy5AAAAABJRU5ErkJggg==", "view/bg_top.png": "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAACAAAAAgCAYAAABzenr0AAAAMUlEQVRYR+3QQREAAAjDMKZp/rWBDD6pgl7SduexGCBAgAABAgQIECBAgAABAgS+BQ6WyDMhXMLeQgAAAABJRU5ErkJggg==", "view/clickselect.png": "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oa2CtvaKqywC8bs06M7+eGszMn7nTBqDOzPNpwcvLyyPb29vfAZh2Naq6Za0tpAbXarUzURS53eGKL1trv0oKZ+a3AHytqplMJlOOoui4tfaDvqOw1lZUtabubBOtqOqN0dHRB/v7++62XwHwDoB33dkAUGPmoO92e/yitXZeVT8BkE1acbdpPQiCj4hIBw52hQsLC8c6nc77AN4E8FK3yQ4R/Qzgc2b+Je0ZDPU+fjiZp1eXFD5U8CB7u+/DGybgXxnFMA3/m1GISGwegNMAeuYBuON53lKpVBrePBG5RkTuSPc1b2ZmZnDzRKRnHoDYvIODg3u5XM69/E8AKAO40G1aNcb0N6/ZbF5X1fsAbjpInXnGmETzGo3GRdew+0DPGmPSzRORTQA988bHx89NTk6mmtdoNGLziGjJ9/1085rN5l1VPWSeMSbVvLW1tXwYhoXp6en+5olIbB6A2Dzf9wcyb319/cju7m5hdnY22TwRic3zPO98qVQayLxWq3U0DMPYPGNMsnmrq6snx8bGNqempgYyT0SKzjoAsXnGmP7mNZvNU9lsdqtYLKaaJyJXABwyzxiTbp6IxOYRUd33/VTzNjY2RnZ2dnrmAdgyxqSbJyJnAMTmEdFl3/cTzROR2DzHk6qWiei4Maa/eSJScZY99FRXPM+7MTIy8iAMQ6/dbsfmEVHPPGPM4OaJiBtDqnmuqfuL4Pv+8Oa1Wq1jYRg+ZR6A2DxjzP/mPRupfwAf56Q4urCh6QAAAABJRU5ErkJggg==", "view/tab_panel.png": "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABYAAABICAYAAADyMAW8AAAAcUlEQVRYR+3WsQ3AMAhE0TCMeyTvP1tShRQo7lxYegxA8fUPLuac97VhwuKXKhTlFxRQ9GPDClawYvGEDwxIZu7pFRZXr4ACinY1ghWsYMX/NxWQr22edyvGGHt6hcV1NqGAon8QVrCCFYteISDnBuQB3xJuQcDkEngAAAAASUVORK5CYII=", "view/btn_close.png": "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABQAAAAqCAYAAACz+XvQAAACmU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QTZZZkkeN9dbuNJOXPPu/DN5ZHkMa7dbpfgx0TAEdvEedeE2HbWxDa0JjaxLQUMe3HPJrahQECrNE3RarUOJheLBbIsq9znZAdgJ0mC4XCIer1eSa/Xa4xGI+R5TuwA272RTqeDfr9fuTeZTDCfz/dmONkK/cFggGazebnCcrnEeDw+uCKxFdiNRmO3nURRBO/9bvtYrVbEVpgejXa7XfR6PUynU8xms6O1nGzlU3DO7fbu7V5dlsf/0yO2ElsSJ7ZES1lLbCWgJE5siZaylthKQEmc2BItZS2xlYCSOLElWspaYisBJXFiS7SUtcRWAkrixJZoKWuJrQSUxIkt0VLWElsJKIkTW6L1t5an6wFooRGerofKBeZ4uh4IFxrj6XqoXECOp+sBaJoIT9c1esIsT9eFYFbl/J5tJc13agyliU1sWwHDbtyziW0oYNiKk22JfXJ6xnfXjcDdFttnb43a/b9tovQ5iG30/IltBL1tQ2xiGwoYtuJkE9tQILBV/ugl4rh2MF1sPJJP59fuc7IDsTe37mHz8Bki+MoKHhFqn9+j9vs7sQN9K7G89xRx837levHzG5Lph8p1TrZK3iF//ApxdLVI4YFk/BpA9Uc5sVXYwObOCfyDJ3AoUcIh+vIRtYuve1clthJ7G8/7p4hv30Xx6weSybuDKxL7BrARxcjTF0iyN4AviH0Tpto1ONlaQUGe2AIsbSmxtYKCPLEFWNpSYmsFBXliC7C0pZfY2oWY/zeBP8uaLni/AFTVAAAAAElFTkSuQmCC", "comp/textinput.png": "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAFsAAAAWCAYAAACv8OArAAAAZElEQVRYR+3UQQkAMAwEwcZI/LtsoSL2NTGwMByZ3b3HJQIDO3H+EdidNezQGjbsUiBs+dmwQ4EwZdmwQ4EwZdmwQ4EwZdmwQ4EwZdmwQ4EwZdmwQ4EwZdmwQ4EwZdmwQ4Ew9QBe0R29X9x+dwAAAABJRU5ErkJggg==", "comp/vscroll.png": "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABEAAAAhCAYAAAA/F0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DS9lM7W4dyCquuvpbM9PFkq0iHm7mSl2yP+bj05uxdeXZe5FHOL6Xdr17nQ79bziwew4NXFqwUTMiaEtKBPwtZjnRi8WgXPglfqsyQITc60pwpAeNpH1GRZtRM0pWVVcTJM6S+dYaRsIf025wAAAABJRU5ErkJggg==", "comp/vscroll$bar.png": "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABEAAAA/CAYAAAAGyyO8AAABYElEQVRYR+2Wv0sDMRTH30tarCg6dRWnQnFT6OiqoP+tk+Cig+AiHayDiNSlg+jgD47K1US+Lwm5s4o/mkElN1xy73KfcF/efTi+Ht3Y0X1Btw8FffdoLy3QSnuZ+HhwZe+exrS13hGGJYsTWSszN0rJ1zHDDbJ0eDYkgHjv5Nxub3TIGEsTY/xDVq6NAN7MfW2u2aCG1nQ0GEZIOXmp7Pw5BPDF+VaGIGQfbM6k0ng5kw8/wF/eJzP5JInZkjg2CSS8zk6vCys7Wb8r5qqsncAP+pdR1Lu9rvgVT4uYg+3F+PCtAzjzu/taKdKKBSS2/wkEMBg/Q+rB50zqzZb7ZPoD/GeZ1HySxGxJHJsEEl5nc22VmCFalpFJTjLKNUtFxlDfP72IogYAP8PPZekWM5OqjErFWpjjbxprABJRA/JYjOOOX4Bgo6bWGYKsfMg5k+lmy5n8uUxm8kkSs6Vw7Cstibc9Fv5vWQAAAABJRU5ErkJggg==", "comp/vscroll$up.png": "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABEAAAAzCAYAAABxCePHAAADF0lEQVRIS92WTUhUURTHz31vPv0KKmkXrtxUGNomkCANLdCUpEatJFuIClIEFRl9kGH0BYWQElLpotGKEJXAtKQooYUFpi1axLQZMCyyZJqv926cM2/uTM288emoUHfx3v16v3fuuef+72Hume/c7/cBAwaLKWaLBZjLPc0Zk0CSJGBs4SDOObDP7i9ckuXkIbLJRJDFFrJk2SGNvZNwy7ExoZEJLWnqfQ+4SlUFaHNs0gXpQhq6x0GWGe0Y7oCicGivyYsLigup7XgFJl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E0qAFgZBYGrQgEBJLgxYEQmJp0IJASCwNWhAIiaUVtOfrdMIbwi1oQ7H7hAcN2lwgFJYGLQiExNKgBYGQWBq0IBASS4MWBEJiadCCQEgsDVoQCImlQQsCIbE0aEEgJJYGLQiExNIC2g/MxaMp6CSauwAAAABJRU5ErkJggg==", "view/bg_tool.png": "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAACAAAAAgCAYAAABzenr0AAAAMklEQVRYR+3QQREAAAjDMCYG/DsEGXxSBb2ke7YeiwECBAgQIECAAAECBAgQIEDgW+AAAeIuAVS/mngAAAAASUVORK5CYII=", "comp/minBtn.png": "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABwAAAA8CAYAAAB1odqiAAAArUlEQVRYR+3X0QmAMAwE0GQN19B9nM193CmiIH7ZXOAoRc/fpjl8jVDdOj/eOc8USBcXqUjLAtDQRMSOdHb3JatTYCZUXodIy10bGxTI1Lx6/YA0Ima6W2tKFcjmdpGKtCow7NBAdxozy+804Gfx/cDqbLzWDzs0ekNY4B9nOMEehMKTVIEEyKeFSKmc18+MppRtipJuYPCa1SkwEyqvo6Tlxm8bFEijvBt9n/QA/fOPydLHcUIAAAAASUVORK5CYII=", "view/zoom_out.png": "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABYAAAAoCAYAAAD6xArmAAACy0lEQVRIS92WQU8TQRTH/28oQkj0CL0QOMAJQkz4DkS6A+GA+A00Hrhj0uy8NiTwEdBPAOrB0Fnq3U8g6gkOSjxUjpCQCu08M5u2qaVAt7YmOqfNZPa3b9/+Z35L6NOgPnHx98Gbm5sTlUplA0AGQBpACcBBKpXazmaz3+5607YVM/MjEXlNRPdbASJyTkRrzPz+Nvg1MDNPAvgI4AGA10qpvHPuSCk17ZwLAazV4HPM/PUmeDvwSwBPAbxl5sf+RmYWZo7XMvOehwPYYebnScAnAMaVUrNhGH5pBefz+Rnn3GcAJ8w8kQT8E8A9AEMA/HXrqM9fMrO/bjvataJvFdd7/IaZfS9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/refresh.png": "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAwAAAAkCAYAAAC9itu8AAACiElEQVQ4T4WVS4iPYRTGf4/7/X6XcivXcktEUhTKQkqyYCOKjWyUhezFThbIlJ3LYrIRkoWGUhhhTMko4zJujYRpxgxHj9737/P3zfh239c57/uc5/zO+UQ3T0QsBRYCtZI+5jBVx0fEcGA6MA+YCXQCVyXddWwlISL6ARuARcXvhQPrJF3/nRARvYHtwLRuFLYCFyW15ITl6XTHvwIuJzlrgHrgiqSOiqSI2ANMAL4BxyW1R8RYYKSkp8Vb8w2HgD7AE0kXSozoD0wC2nPCAWAw0CyppiRhBzAD6MgJW4D5KdDFNeSkiJgFbEvONeYE698N2K0ArPsDMAZwguN+AmeKfZgLbAb6llj7A7gk6eFfnY6I0cDKpNc1tQFNwG1JvvFPp0sKXQ2sAGokveuJpVHAHGBJ4ul76vLNapbs9dYk6R8oU7driyztA2Z3w5L1n5LUnBPWptMd/xw4l+RscsHAeeNSZMloTAG+AIcltUXERPdB0qMylk4klu5LOlni2ABgqm3Oko4BQ4Fnko6WJOxPzlXg2wV4hv2czuOYhmsBsDf1rD7fYP0HkyyzZN0twHjACZmlI0WWFgM7e2DprKQ71SyNA9YDBnFYcq0RuOZ5/h9LdsVS6yV97YmlgYDn2X3wjUa7QdKLapY8015ePrWMJVtembhewLI0YWU4eZvck/Q525pXo4M/AY+TLMP40u+SuooseVjsitm/IakzItz5QcXhKSZsBCyrpdjlwuZwfSO8mLOkdYAHqFXSrRKWvErtXFdOcJcnp0AX96ZwuldQ5uxtTrD+VUmWWXqfujwk8eQ4f68rsuRG+d/gZVb9eIk9kPS6miXvIv91rNc12TXPc5MkTyO/AFhJCujHqZlCAAAAAElFTkSuQmCC", "comp/checkbox.png": "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAA4AAAAqCAYAAACDdWrxAAABbUlEQVRIS+2TP0gCURzHv88GRYsrExyOo5cEQVEtWdQQpE4N0R+HxmirXXCrKYigqM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gu5O9pUtsif0+Tv6dhF8P/657mLz4NfQVdLmZiAAAAAElFTkSuQmCC", "comp/textarea.png": "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAFsAAAAXCAYAAABkrDOOAAAA4klEQVRoQ+3ZvQrCMBiF4e9rU+sPOErRqxDRe/KG9Fp0EAc3VzuIg1ML4uDmlkaaquDenMUTyJoDD+8W3ZyKlaoshSeogHOy1m1euOmoI1EU+auqQUf/8XHnnBzLp3jsWdaVJEnEGEPsADXU2Ifro8Gej/uSpqnHruvmaVegqirZX+4N9mIy8Nh13XEct7vE18RaK7vzjdiIFoiNUH5vEJvYQAHgFMsmNlAAOMWyiQ0UAE6xbGIDBYBTLJvYQAHgFMsmNlAAOMWyiQ0UAE79lM2fmrDy358a/q6Hhf68ng175QueKdEXxUGVVwAAAABJRU5ErkJggg==", "view/re.png": "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABYAAAAoCAYAAAD6xArmAAACpklEQVRIS+WWPUgcQRiG3+8O70QEUwTB1EJgsTGdRRrhOMjOtEtSRbBIBMFKuCtkZleES2uRQoWQJggKKW7Of7GyTRvBLkVShhS73OXMfWGOU85Es7uXs0m2XeZh+OZ95xnCHX10R1ykBvu+P5fP59+VSqVvf9pUarBS6jWAR0Q0rbWOboP3BCaiOQAHAKTW+vtN8L8BW96W4zjPPM/78Ss8FlypVEYajYbHzALAJIAHALJdoDWl1Esi4m74rWBmpiAI5pk5AHAvJj0VrXU5Fmyhvu+/AfA8YRxfaa1LsWDf92eZeSMJlJnXtdYvEo1Ca30G4GEH/ImI1lqt1nE+nz9vNBrLnVTY39uO4zxNdHgrKytjzWbzs13FzKfDw8PFxcXF8HL3Nscd8BEAN3HcgiCYbLVaHyyIiGaUUm+7R9JzQZRSo0T0BUCGmRd831/tBttK53K5zXK5/DV1pZVSG0Q0C2BXa/0kySEmKojWeoiZD4hoKpvNTiwtLX1MC7+1IFrrQWZeJaJxx3EKN5186lF0LwiC4DEz31dKvU+z69i7Ig0stnm9wv4zsDGm7bxCodBf5xlj2s5j5mkpZf+c1wHPEdFBGIbS87z+OO8S3EnAVhRFvTnv8PBwpF6ve0QkiGiSmX9znuu66ZxXq9XmAcQ6j5krUspkzqvVaqmcJ4SId54xxl6ZiZwHYN113WTOq1arZ0R05TwAa5lM5rher5/ncrllAPYl1HZeFEXJnLe3tzd2cXHRdh6A04GBgWKxWLxyXlcqjqIochPHbWdn58p5AGaEENec13NB9vf3R5vNZtt5RLTguu4159lKA9gUQqR3njHGHpx9tOxKKfvnvGq1OmQrC2AKwIQQon/OOzk5GQzD0I5hPIqi/jvPGNN2npTyH3feTzoJOzgswwlqAAAAAElFTkSuQmCC", "view/search.png": "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABUAAAAqCAYAAABcOxDuAAABX0lEQVRIS+3VsUrEQBAG4H9HiDZiJQg+gJVaiKAoWClYXWeZ7D6CtbWFr5Ai2ayQxkLQRgsLGwtBUQsRC6sDCxHxEIvIZSRwxRGSu83pNUe23c0H+89kR2AISwzBxAiinuctCSH2AawD+AFwRkR7QRC85CO0ur5SaoOZzwGM54A3IlrJw1aolPIewEJJUY+01jvde31RKeUMgNceXdLSWk9VQl3XnSWiZhnKzF9RFE1WQrPDUsonAHNFsBDiJAzDRmXUdd1tIjoFMJaDW0KI1TAMH61RpdQ0Mx8z8zMzHxLRAYBlAG0Al2ma7hpjHqxbqgNeAJgHcKW1XutEMeE4Ttv3/axXC1dh9XPgbZqmW8aYd9t3ohCVUt4BWARwkyTJZhzHH7Zgdq4MvQbw7ThOw/f9zypgKVoVsS7UX+C+v+kgeI0Oklrvb0Yw03rwlZW8Hnz14OvqjXrw1e/pPyfwCww91CttlMG7AAAAAElFTkSuQmCC", "view/save.png": "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABYAAAAoCAYAAAD6xArmAAAA1klEQVRIS+2VzQ3DIAyFwxwdoMMAA/VQ8ZByyEBhmA7QOVxxKLIaOcIoSZUfrlifHw/wM91Ky6zE7SZgANTaDEDhzYJ5odSMC7nA5U7+b4X2dVQr3ic4hHCTlMcY33xPZUUGcwBvdEJwjcfGGIQQ4rd2qenWA3hyAUuABwCP31NtN+i1v02qP4DicRybM885J2ceB/NCyUupfuLxBS4WbmKF9rNUv4p9gq21d0l5SunF91RWZDAH8EYnBNd4nDPPWitnXst0I6Leez+feVowEQ3e+wNk3ge7C/Qp3GfwkgAAAABJRU5ErkJggg==" };
  5230. Base64AtlasManager.base64 = new Base64Atlas(Base64AtlasManager.dataO);
  5231. class CallLaterTool {
  5232. constructor() {
  5233. }
  5234. static initCallLaterRecorder() {
  5235. if (CallLaterTool.oldCallLater)
  5236. return;
  5237. CallLaterTool.oldCallLater = Laya.Laya.timer["callLater"];
  5238. Laya.Laya.timer["callLater"] = CallLaterTool["prototype"]["callLater"];
  5239. }
  5240. static beginRecordCallLater() {
  5241. CallLaterTool.initCallLaterRecorder();
  5242. CallLaterTool._isRecording = true;
  5243. }
  5244. static runRecordedCallLaters() {
  5245. CallLaterTool._isRecording = false;
  5246. var timer;
  5247. timer = Laya.Laya.timer;
  5248. var laters = timer["_laters"];
  5249. laters = CallLaterTool._recordedCallLaters;
  5250. for (var i = 0, n = laters.length - 1; i <= n; i++) {
  5251. var handler = laters[i];
  5252. if (CallLaterTool._recordedCallLaters.indexOf(handler) < 0)
  5253. continue;
  5254. handler.method !== null && handler.run(false);
  5255. timer["_recoverHandler"](handler);
  5256. laters.splice(i, 1);
  5257. }
  5258. CallLaterTool._recordedCallLaters.length = 0;
  5259. }
  5260. callLater(caller, method, args = null) {
  5261. if (this._getHandler(caller, method) == null) {
  5262. CallLaterTool.oldCallLater.call(this, caller, method, args);
  5263. if (CallLaterTool._isRecording) {
  5264. CallLaterTool._recordedCallLaters.push(this._laters[this._laters.length - 1]);
  5265. }
  5266. }
  5267. }
  5268. }
  5269. CallLaterTool._recordedCallLaters = [];
  5270. CallLaterTool._isRecording = false;
  5271. class CanvasTools {
  5272. constructor() {
  5273. }
  5274. static createCanvas(width, height) {
  5275. return null;
  5276. }
  5277. static renderSpriteToCanvas(sprite, canvas, offsetX, offsetY) {
  5278. Laya.RenderSprite.renders[sprite._renderType]._fun(sprite, canvas.context, offsetX, offsetY);
  5279. }
  5280. static getImageDataFromCanvas(canvas, x = 0, y = 0, width = 0, height = 0) {
  5281. if (width <= 0)
  5282. width = canvas.width;
  5283. if (height <= 0)
  5284. height = canvas.height;
  5285. var imgdata = canvas.context.getImageData(x, y, width, height);
  5286. return imgdata;
  5287. }
  5288. static getImageDataFromCanvasByRec(canvas, rec) {
  5289. var imgdata = canvas.context.getImageData(rec.x, rec.y, rec.width, rec.height);
  5290. return imgdata;
  5291. }
  5292. static getDifferCount(imageData1, imageData2) {
  5293. var data1 = imageData1.data;
  5294. var data2 = imageData2.data;
  5295. var differCount;
  5296. differCount = 0;
  5297. CanvasTools.walkImageData(imageData1, myWalkFun);
  5298. return differCount;
  5299. function myWalkFun(i, j, tarPos, data) {
  5300. if (!CanvasTools.isPoinSame(tarPos, data1, data2))
  5301. differCount++;
  5302. }
  5303. }
  5304. static getDifferRate(imageData1, imageData2) {
  5305. return CanvasTools.getDifferCount(imageData1, imageData2) / (imageData1.width * imageData1.height);
  5306. }
  5307. static getCanvasDisRec(canvas) {
  5308. var rst;
  5309. rst = new Laya.Rectangle;
  5310. var imgdata;
  5311. imgdata = CanvasTools.getImageDataFromCanvas(canvas, 0, 0);
  5312. var maxX;
  5313. var minX;
  5314. var maxY;
  5315. var minY;
  5316. maxX = maxY = 0;
  5317. minX = imgdata.width;
  5318. minY = imgdata.height;
  5319. var i, iLen;
  5320. var j, jLen;
  5321. iLen = imgdata.width;
  5322. jLen = imgdata.height;
  5323. var data;
  5324. data = imgdata.data;
  5325. var tarPos = 0;
  5326. for (j = 0; j < jLen; j++) {
  5327. for (i = 0; i < iLen; i++) {
  5328. if (!CanvasTools.isEmptyPoint(data, tarPos)) {
  5329. if (minX > i)
  5330. minX = i;
  5331. if (maxX < i)
  5332. maxX = i;
  5333. if (minY > j)
  5334. minY = j;
  5335. if (maxY < j)
  5336. maxY = j;
  5337. }
  5338. tarPos += 4;
  5339. }
  5340. }
  5341. rst.setTo(minX, minY, maxX - minX + 1, maxY - minY + 1);
  5342. return rst;
  5343. }
  5344. static fillCanvasRec(canvas, rec, color) {
  5345. var ctx = canvas.context;
  5346. ctx.fillStyle = color;
  5347. ctx.fillRect(rec.x, rec.y, rec.width, rec.height);
  5348. }
  5349. static isEmptyPoint(data, pos) {
  5350. if (data[pos] == 0 && data[pos + 1] == 0 && data[pos + 2] == 0 && data[pos + 3] == 0) {
  5351. return true;
  5352. }
  5353. else {
  5354. return false;
  5355. }
  5356. }
  5357. static isPoinSame(pos, data1, data2) {
  5358. if (data1[pos] == data2[pos] && data1[pos + 1] == data2[pos + 1] && data1[pos + 2] == data2[pos + 2] && data1[pos + 3] == data2[pos + 3]) {
  5359. return true;
  5360. }
  5361. else {
  5362. return false;
  5363. }
  5364. }
  5365. static walkImageData(imgdata, walkFun) {
  5366. var i, iLen;
  5367. var j, jLen;
  5368. iLen = imgdata.width;
  5369. jLen = imgdata.height;
  5370. var tarPos = 0;
  5371. var data = imgdata.data;
  5372. for (i = 0; i < iLen; i++) {
  5373. for (j = 0; j < jLen; j++) {
  5374. walkFun(i, j, tarPos, data);
  5375. tarPos += 4;
  5376. }
  5377. }
  5378. }
  5379. static renderSpritesToCanvas(canvas, sprites, offx = 0, offy = 0, startIndex = 0) {
  5380. var i, len;
  5381. len = sprites.length;
  5382. for (i = startIndex; i < len; i++) {
  5383. CanvasTools.renderSpriteToCanvas(sprites[i], canvas, offx, offy);
  5384. }
  5385. }
  5386. static clearCanvas(canvas) {
  5387. var preWidth;
  5388. var preHeight;
  5389. preWidth = canvas.width;
  5390. preHeight = canvas.height;
  5391. canvas.size(preWidth + 1, preHeight);
  5392. canvas.size(preWidth, preHeight);
  5393. }
  5394. static getImagePixels(x, y, width, data, colorLen = 4) {
  5395. var pos;
  5396. pos = (x * width + y) * colorLen;
  5397. var i, len;
  5398. var rst;
  5399. rst = [];
  5400. len = colorLen;
  5401. for (i = 0; i < len; i++) {
  5402. rst.push(data[pos + i]);
  5403. }
  5404. return rst;
  5405. }
  5406. }
  5407. class MathTools {
  5408. constructor() {
  5409. }
  5410. static sortBigFirst(a, b) {
  5411. if (a == b)
  5412. return 0;
  5413. return b > a ? 1 : -1;
  5414. }
  5415. static sortSmallFirst(a, b) {
  5416. if (a == b)
  5417. return 0;
  5418. return b > a ? -1 : 1;
  5419. }
  5420. static sortNumBigFirst(a, b) {
  5421. return parseFloat(b) - parseFloat(a);
  5422. }
  5423. static sortNumSmallFirst(a, b) {
  5424. return parseFloat(a) - parseFloat(b);
  5425. }
  5426. static sortByKey(key, bigFirst = false, forceNum = true) {
  5427. var _sortFun;
  5428. if (bigFirst) {
  5429. _sortFun = forceNum ? MathTools.sortNumBigFirst : MathTools.sortBigFirst;
  5430. }
  5431. else {
  5432. _sortFun = forceNum ? MathTools.sortNumSmallFirst : MathTools.sortSmallFirst;
  5433. }
  5434. return function (a, b) {
  5435. return _sortFun(a[key], b[key]);
  5436. };
  5437. }
  5438. }
  5439. class ColorTool {
  5440. constructor() {
  5441. }
  5442. static toHexColor(color) {
  5443. return Laya.Utils.toHexColor(color);
  5444. }
  5445. static getRGBByRGBStr(str) {
  5446. str.charAt(0) == '#' && (str = str.substr(1));
  5447. var color = parseInt(str, 16);
  5448. var flag = (str.length == 8);
  5449. var _color;
  5450. _color = [((0x00FF0000 & color) >> 16), ((0x0000FF00 & color) >> 8), (0x000000FF & color)];
  5451. return _color;
  5452. }
  5453. static getColorBit(value) {
  5454. var rst;
  5455. rst = Math.floor(value).toString(16);
  5456. rst = rst.length > 1 ? rst : "0" + rst;
  5457. return rst;
  5458. }
  5459. static getRGBStr(rgb, coefficient = 1) {
  5460. return "#" + ColorTool.getColorBit(rgb[0] * coefficient) + ColorTool.getColorBit(rgb[1] * coefficient) + ColorTool.getColorBit(rgb[2] * coefficient);
  5461. }
  5462. static traseHSB(hsb) {
  5463. console.log("hsb:", hsb[0], hsb[1], hsb[2]);
  5464. }
  5465. static rgb2hsb(rgbR, rgbG, rgbB) {
  5466. var rgb = [rgbR, rgbG, rgbB];
  5467. rgb.sort(MathTools.sortNumSmallFirst);
  5468. var max = rgb[2];
  5469. var min = rgb[0];
  5470. var hsbB = max / 255.0;
  5471. var hsbS = max == 0 ? 0 : (max - min) / max;
  5472. var hsbH = 0;
  5473. if (max == min) {
  5474. hsbH = 1;
  5475. }
  5476. else if (rgbR == 0 && rgbG == 0 && rgbB == 0) ;
  5477. else if (max == rgbR && rgbG >= rgbB) {
  5478. hsbH = (rgbG - rgbB) * 60 / (max - min) + 0;
  5479. }
  5480. else if (max == rgbR && rgbG < rgbB) {
  5481. hsbH = (rgbG - rgbB) * 60 / (max - min) + 360;
  5482. }
  5483. else if (max == rgbG) {
  5484. hsbH = (rgbB - rgbR) * 60 / (max - min) + 120;
  5485. }
  5486. else if (max == rgbB) {
  5487. hsbH = (rgbR - rgbG) * 60 / (max - min) + 240;
  5488. }
  5489. return [hsbH, hsbS, hsbB];
  5490. }
  5491. static hsb2rgb(h, s, v) {
  5492. var r = 0, g = 0, b = 0;
  5493. var i = Math.floor((h / 60) % 6);
  5494. var f = (h / 60) - i;
  5495. var p = v * (1 - s);
  5496. var q = v * (1 - f * s);
  5497. var t = v * (1 - (1 - f) * s);
  5498. switch (i) {
  5499. case 0:
  5500. r = v;
  5501. g = t;
  5502. b = p;
  5503. break;
  5504. case 1:
  5505. r = q;
  5506. g = v;
  5507. b = p;
  5508. break;
  5509. case 2:
  5510. r = p;
  5511. g = v;
  5512. b = t;
  5513. break;
  5514. case 3:
  5515. r = p;
  5516. g = q;
  5517. b = v;
  5518. break;
  5519. case 4:
  5520. r = t;
  5521. g = p;
  5522. b = v;
  5523. break;
  5524. case 5:
  5525. r = v;
  5526. g = p;
  5527. b = q;
  5528. break;
  5529. default:
  5530. break;
  5531. }
  5532. return [Math.floor(r * 255.0), Math.floor(g * 255.0), Math.floor(b * 255.0)];
  5533. }
  5534. }
  5535. class CommonTools {
  5536. constructor() {
  5537. }
  5538. static bind(fun, scope) {
  5539. var rst;
  5540. rst = fun.bind(scope);
  5541. return rst;
  5542. }
  5543. static insertP(tar, x, y, scaleX, scaleY, rotation) {
  5544. var nSp;
  5545. nSp = new Laya.Sprite();
  5546. tar.parent.addChild(nSp);
  5547. nSp.x = x;
  5548. nSp.y = y;
  5549. nSp.scaleX = scaleX;
  5550. nSp.scaleY = scaleY;
  5551. nSp.rotation = rotation;
  5552. nSp.addChild(tar);
  5553. CommonTools.count++;
  5554. nSp.name = "insertP:" + CommonTools.count;
  5555. }
  5556. static insertChild(tar, x, y, scaleX, scaleY, rotation, color = "#ff00ff") {
  5557. var nSp;
  5558. nSp = new Laya.Sprite();
  5559. tar.addChild(nSp);
  5560. nSp.x = x;
  5561. nSp.y = y;
  5562. nSp.scaleX = scaleX;
  5563. nSp.scaleY = scaleY;
  5564. nSp.rotation = rotation;
  5565. nSp.graphics.drawRect(0, 0, 20, 20, color);
  5566. nSp.name = "child:" + tar.numChildren;
  5567. return nSp;
  5568. }
  5569. static createSprite(width, height, color = "#ff0000") {
  5570. var sp;
  5571. sp = new Laya.Sprite();
  5572. sp.graphics.drawRect(0, 0, width, height, color);
  5573. sp.size(width, height);
  5574. return sp;
  5575. }
  5576. static createBtn(txt, width = 100, height = 40) {
  5577. var sp;
  5578. sp = new Laya.Sprite();
  5579. sp.size(width, height);
  5580. sp.graphics.drawRect(0, 0, sp.width, sp.height, "#ff0000");
  5581. sp.graphics.fillText(txt, sp.width * 0.5, sp.height * 0.5, null, "#ffff00", "center");
  5582. return sp;
  5583. }
  5584. }
  5585. CommonTools.count = 0;
  5586. class DebugTxt {
  5587. constructor() {
  5588. }
  5589. static init() {
  5590. if (DebugTxt._txt)
  5591. return;
  5592. DebugTxt._txt = new Laya.Text();
  5593. DebugTxt._txt.pos(100, 100);
  5594. DebugTxt._txt.color = "#ff00ff";
  5595. DebugTxt._txt.zOrder = 999;
  5596. DebugTxt._txt.fontSize = 24;
  5597. DebugTxt._txt.text = "debugTxt inited";
  5598. Laya.Laya.stage.addChild(DebugTxt._txt);
  5599. }
  5600. static getArgArr(arg) {
  5601. var rst;
  5602. rst = [];
  5603. var i, len = arg.length;
  5604. for (i = 0; i < len; i++) {
  5605. rst.push(arg[i]);
  5606. }
  5607. return rst;
  5608. }
  5609. static dTrace(...arg) {
  5610. arg = DebugTxt.getArgArr(arg);
  5611. var str;
  5612. str = arg.join(" ");
  5613. if (DebugTxt._txt) {
  5614. DebugTxt._txt.text = str + "\n" + DebugTxt._txt.text;
  5615. }
  5616. }
  5617. static getTimeStr() {
  5618. var dateO = new Date();
  5619. return dateO.toTimeString();
  5620. }
  5621. static traceTime(msg) {
  5622. DebugTxt.dTrace(DebugTxt.getTimeStr());
  5623. DebugTxt.dTrace(msg);
  5624. }
  5625. static show(...arg) {
  5626. arg = DebugTxt.getArgArr(arg);
  5627. var str;
  5628. str = arg.join(" ");
  5629. if (DebugTxt._txt) {
  5630. DebugTxt._txt.text = str;
  5631. }
  5632. }
  5633. }
  5634. class DisEditor {
  5635. constructor() {
  5636. this.rec = new Laya.Sprite();
  5637. this.rootContainer = new Laya.Sprite();
  5638. }
  5639. setTarget(target) {
  5640. this.tar = target;
  5641. var g;
  5642. g = this.rec.graphics;
  5643. g.clear();
  5644. var bounds;
  5645. bounds = this.tar.getSelfBounds();
  5646. g.drawRect(bounds.x, bounds.y, bounds.width, bounds.height, null, "#00ff00");
  5647. this.createSameDisChain();
  5648. Laya.Laya.stage.addChild(this.rootContainer);
  5649. }
  5650. createSameDisChain() {
  5651. var tParent;
  5652. var cpParent;
  5653. var preTar;
  5654. preTar = this.rec;
  5655. tParent = this.tar;
  5656. while (tParent && tParent != Laya.Laya.stage) {
  5657. cpParent = new Laya.Sprite();
  5658. cpParent.addChild(preTar);
  5659. cpParent.x = tParent.x;
  5660. cpParent.y = tParent.y;
  5661. cpParent.scaleX = tParent.scaleX;
  5662. cpParent.scaleY = tParent.scaleY;
  5663. cpParent.rotation = tParent.rotation;
  5664. cpParent.scrollRect = tParent.scrollRect;
  5665. preTar = cpParent;
  5666. tParent = tParent.parent;
  5667. }
  5668. this.rootContainer.removeChildren();
  5669. this.rootContainer.addChild(preTar);
  5670. }
  5671. }
  5672. class DisPool {
  5673. constructor() {
  5674. }
  5675. static getDis(clz) {
  5676. var clzName;
  5677. clzName = ClassTool.getClassNameByClz(clz);
  5678. if (!DisPool._objDic[clzName]) {
  5679. DisPool._objDic[clzName] = [];
  5680. }
  5681. var disList;
  5682. disList = DisPool._objDic[clzName];
  5683. var i, len;
  5684. len = disList.length;
  5685. for (i = 0; i < len; i++) {
  5686. if (!disList[i].parent) {
  5687. return disList[i];
  5688. }
  5689. }
  5690. disList.push(new clz());
  5691. return disList[disList.length - 1];
  5692. }
  5693. }
  5694. DisPool._objDic = {};
  5695. class DragBox extends Laya.Sprite {
  5696. constructor(type) {
  5697. super();
  5698. this._left = this.drawBlock();
  5699. this._right = this.drawBlock();
  5700. this._top = this.drawBlock();
  5701. this._bottom = this.drawBlock();
  5702. this._topLeft = this.drawBlock();
  5703. this._topRight = this.drawBlock();
  5704. this._bottomLeft = this.drawBlock();
  5705. this._bottomRight = this.drawBlock();
  5706. this._lastPoint = new Laya.Point();
  5707. this._type = type = 3;
  5708. this.addChild(this._box = this.drawBorder(0, 0, 0xff0000));
  5709. if (type == 1 || type == 3) {
  5710. this.addChild(this._left);
  5711. this.addChild(this._right);
  5712. }
  5713. if (type == 2 || type == 3) {
  5714. this.addChild(this._top);
  5715. this.addChild(this._bottom);
  5716. }
  5717. if (type == 3) {
  5718. this.addChild(this._topLeft);
  5719. this.addChild(this._topRight);
  5720. this.addChild(this._bottomLeft);
  5721. this.addChild(this._bottomRight);
  5722. }
  5723. this.on(Laya.Event.MOUSE_DOWN, this, this.onMouseDown);
  5724. this.mouseThrough = true;
  5725. }
  5726. onMouseDown(e) {
  5727. this._currDir = e.target;
  5728. if (e.nativeEvent.shiftKey) {
  5729. this.initFixScale();
  5730. }
  5731. if (this._currDir != this) {
  5732. this._lastPoint.x = Laya.Laya.stage.mouseX;
  5733. this._lastPoint.y = Laya.Laya.stage.mouseY;
  5734. Laya.Laya.stage.on(Laya.Event.MOUSE_MOVE, this, this.onMouseMove);
  5735. Laya.Laya.stage.on(Laya.Event.MOUSE_UP, this, this.onMouseUp);
  5736. e.stopPropagation();
  5737. }
  5738. }
  5739. onMouseUp(e) {
  5740. Laya.Laya.stage.off(Laya.Event.MOUSE_MOVE, this, this.onMouseMove);
  5741. Laya.Laya.stage.off(Laya.Event.MOUSE_UP, this, this.onMouseUp);
  5742. }
  5743. initFixScale() {
  5744. this.fixScale = this._target.height / this._target.width;
  5745. }
  5746. onMouseMove(e) {
  5747. var scale = 1;
  5748. var tx = (Laya.Laya.stage.mouseX - this._lastPoint.x) / scale;
  5749. var ty = (Laya.Laya.stage.mouseY - this._lastPoint.y) / scale;
  5750. var sameScale = false;
  5751. var adptX;
  5752. var adptY;
  5753. if (e.nativeEvent.shiftKey) {
  5754. if (this.fixScale < 0)
  5755. this.initFixScale();
  5756. adptY = tx * this.fixScale;
  5757. adptX = ty / this.fixScale;
  5758. sameScale = true;
  5759. switch (this._currDir) {
  5760. case this._topLeft:
  5761. case this._bottomLeft:
  5762. this._currDir = this._left;
  5763. break;
  5764. case this._topRight:
  5765. case this._bottomRight:
  5766. this._currDir = this._right;
  5767. break;
  5768. }
  5769. }
  5770. if (tx != 0 || ty != 0) {
  5771. this._lastPoint.x += tx * scale;
  5772. this._lastPoint.y += ty * scale;
  5773. var tw = tx / this._target.scaleX;
  5774. var th = ty / this._target.scaleY;
  5775. if (this._currDir == this._left) {
  5776. this._target.x += tx;
  5777. this._target.width -= tw;
  5778. if (sameScale) {
  5779. this._target.height = this._target.width * this.fixScale;
  5780. }
  5781. }
  5782. else if (this._currDir == this._right) {
  5783. this._target.width += tw;
  5784. if (sameScale) {
  5785. this._target.height = this._target.width * this.fixScale;
  5786. }
  5787. }
  5788. else if (this._currDir == this._top) {
  5789. this._target.y += ty;
  5790. this._target.height -= th;
  5791. if (sameScale) {
  5792. this._target.width = this._target.height / this.fixScale;
  5793. }
  5794. }
  5795. else if (this._currDir == this._bottom) {
  5796. this._target.height += th;
  5797. if (sameScale) {
  5798. this._target.width = this._target.height / this.fixScale;
  5799. }
  5800. }
  5801. else if (this._currDir == this._topLeft) {
  5802. this._target.x += tx;
  5803. this._target.y += ty;
  5804. this._target.width -= tw;
  5805. this._target.height -= th;
  5806. }
  5807. else if (this._currDir == this._topRight) {
  5808. this._target.y += ty;
  5809. this._target.width += tw;
  5810. this._target.height -= th;
  5811. }
  5812. else if (this._currDir == this._bottomLeft) {
  5813. this._target.x += tx;
  5814. this._target.width -= tw;
  5815. this._target.height += th;
  5816. }
  5817. else if (this._currDir == this._bottomRight) {
  5818. this._target.width += tw;
  5819. this._target.height += th;
  5820. }
  5821. if (this._target.width < 1) {
  5822. this._target.width = 1;
  5823. }
  5824. if (this._target.height < 1) {
  5825. this._target.height = 1;
  5826. }
  5827. this._target.width = Math.round(this._target.width);
  5828. this._target.x = Math.round(this._target.x);
  5829. this._target.y = Math.round(this._target.y);
  5830. this._target.height = Math.round(this._target.height);
  5831. this.refresh();
  5832. }
  5833. }
  5834. drawBorder(width, height, color, alpha = 1) {
  5835. var box = new Laya.Sprite();
  5836. var g = box.graphics;
  5837. g.clear();
  5838. g.drawRect(0, 0, width, height, null, "#" + color);
  5839. return box;
  5840. }
  5841. drawBlock() {
  5842. var box = new Laya.Sprite();
  5843. var g = box.graphics;
  5844. g.clear();
  5845. box.width = DragBox.BLOCK_WIDTH;
  5846. box.height = DragBox.BLOCK_WIDTH;
  5847. g.drawRect(-DragBox.BLOCK_WIDTH * 0.5, -DragBox.BLOCK_WIDTH * 0.5, DragBox.BLOCK_WIDTH, DragBox.BLOCK_WIDTH, "#ffffff", "#ff0000", 1);
  5848. box.mouseEnabled = true;
  5849. box.mouseThrough = true;
  5850. return box;
  5851. }
  5852. setTarget(target) {
  5853. this._target = target;
  5854. this.refresh();
  5855. }
  5856. refresh() {
  5857. this.changePoint();
  5858. this.changeSize();
  5859. }
  5860. changePoint() {
  5861. var p = this._target.localToGlobal(new Laya.Point());
  5862. var np = this.parent.globalToLocal(p);
  5863. this.x = np.x;
  5864. this.y = np.y;
  5865. }
  5866. changeSize() {
  5867. var width = this._target.width * this._target.scaleX;
  5868. var height = this._target.height * this._target.scaleY;
  5869. console.log("change size");
  5870. this.rotation = this._target.rotation;
  5871. if (this._box.width != width || this._box.height != height) {
  5872. this._box.graphics.clear();
  5873. this._box.graphics.drawRect(0, 0, Math.abs(width), Math.abs(height), null, "#ff0000");
  5874. this._box.size(width, height);
  5875. this.size(width, height);
  5876. this._box.scaleX = Math.abs(this._box.scaleX) * (this._target.scaleX > 0 ? 1 : -1);
  5877. this._box.scaleY = Math.abs(this._box.scaleY) * (this._target.scaleY > 0 ? 1 : -1);
  5878. this._left.x = 0;
  5879. this._left.y = height * 0.5;
  5880. this._right.x = width;
  5881. this._right.y = height * 0.5;
  5882. this._top.x = width * 0.5;
  5883. this._top.y = 0;
  5884. this._bottom.x = width * 0.5;
  5885. this._bottom.y = height;
  5886. this._topLeft.x = this._topLeft.y = 0;
  5887. this._topRight.x = width;
  5888. this._topRight.y = 0;
  5889. this._bottomLeft.x = 0;
  5890. this._bottomLeft.y = height;
  5891. this._bottomRight.x = width;
  5892. this._bottomRight.y = height;
  5893. }
  5894. }
  5895. }
  5896. DragBox.BLOCK_WIDTH = 6;
  5897. class FilterTool {
  5898. constructor() {
  5899. }
  5900. static getArrByFilter(arr, filterFun) {
  5901. var i, len = arr.length;
  5902. var rst = [];
  5903. for (i = 0; i < len; i++) {
  5904. if (filterFun(arr[i]))
  5905. rst.push(arr[i]);
  5906. }
  5907. return rst;
  5908. }
  5909. static getArr(arr, sign, value) {
  5910. var i, len = arr.length;
  5911. var rst = [];
  5912. for (i = 0; i < len; i++) {
  5913. if (arr[i][sign] == value)
  5914. rst.push(arr[i]);
  5915. }
  5916. return rst;
  5917. }
  5918. }
  5919. class GetSetProfile {
  5920. static removeNoDisplayKeys(arr) {
  5921. var i;
  5922. for (i = arr.length - 1; i >= 0; i--) {
  5923. if (GetSetProfile.noDisplayKeys[arr[i]]) {
  5924. arr.splice(i, 1);
  5925. }
  5926. }
  5927. }
  5928. static getClassCount(className) {
  5929. return GetSetProfile.countDic[className];
  5930. }
  5931. static addClassCount(className) {
  5932. if (!GetSetProfile.countDic[className]) {
  5933. GetSetProfile.countDic[className] = 1;
  5934. }
  5935. else {
  5936. GetSetProfile.countDic[className] = GetSetProfile.countDic[className] + 1;
  5937. }
  5938. }
  5939. static init() {
  5940. if (GetSetProfile._inited)
  5941. return;
  5942. GetSetProfile._inited = true;
  5943. var createFun = function (sp) {
  5944. GetSetProfile.classCreated(sp);
  5945. };
  5946. FunHook.hook(Node, "call", null, createFun);
  5947. GetSetProfile.handlerO = {};
  5948. GetSetProfile.handlerO["get"] = function (target, key, receiver) {
  5949. console.log("get", target, key, receiver);
  5950. return Reflect.get(target, key, receiver);
  5951. };
  5952. GetSetProfile.handlerO["set"] = function (target, key, value, receiver) {
  5953. console.log("set", target, key, value, receiver);
  5954. return Reflect.set(target, key, value, receiver);
  5955. };
  5956. }
  5957. static classCreated(obj, oClas = null) {
  5958. if (GetSetProfile.fromMe)
  5959. return;
  5960. var className;
  5961. className = ClassTool.getClassName(obj);
  5962. GetSetProfile.addClassCount(className);
  5963. GetSetProfile.addClassCount(GetSetProfile.ALL);
  5964. IDTools.idObj(obj);
  5965. var classDes;
  5966. classDes = GetSetProfile.hookClassDic[className];
  5967. if (!classDes) {
  5968. GetSetProfile.profileClass(obj["constructor"]);
  5969. classDes = GetSetProfile.hookClassDic[className];
  5970. if (!classDes)
  5971. return;
  5972. }
  5973. GetSetProfile.hookObj2(obj, classDes);
  5974. }
  5975. static hookObj(obj, keys) {
  5976. var handler = GetSetProfile.handlerO;
  5977. new Proxy(obj, handler);
  5978. }
  5979. static hookObj2(obj, keys) {
  5980. var i, len;
  5981. len = keys.length;
  5982. for (i = 0; i < len; i++) {
  5983. GetSetProfile.hookVar(obj, keys[i]);
  5984. }
  5985. }
  5986. static profileClass(clz) {
  5987. var className;
  5988. className = ClassTool.getClassName(clz);
  5989. GetSetProfile.fromMe = true;
  5990. var tO = new clz();
  5991. GetSetProfile.fromMe = false;
  5992. var keys;
  5993. keys = ClassTool.getObjectDisplayAbleKeys(tO);
  5994. keys = ObjectTools.getNoSameArr(keys);
  5995. var i, len;
  5996. len = keys.length;
  5997. var tV;
  5998. var key;
  5999. for (i = len - 1; i >= 0; i--) {
  6000. key = keys[i];
  6001. tV = tO[key];
  6002. if (tV instanceof Function) {
  6003. keys.splice(i, 1);
  6004. }
  6005. }
  6006. len = keys.length;
  6007. GetSetProfile.removeNoDisplayKeys(keys);
  6008. GetSetProfile.hookClassDic[className] = keys;
  6009. }
  6010. static hookPrototype(tO, key) {
  6011. console.log("hook:", key);
  6012. try {
  6013. GetSetProfile.hookVar(tO, key);
  6014. }
  6015. catch (e) {
  6016. console.log("fail", key);
  6017. }
  6018. }
  6019. static reportCall(obj, name, type) {
  6020. IDTools.idObj(obj);
  6021. var objID;
  6022. objID = IDTools.getObjID(obj);
  6023. var className;
  6024. className = ClassTool.getClassName(obj);
  6025. GetSetProfile.recordInfo(className, name, type, objID);
  6026. GetSetProfile.recordInfo(GetSetProfile.ALL, name, type, objID);
  6027. }
  6028. static recordInfo(className, name, type, objID) {
  6029. var propCallsDic;
  6030. if (!GetSetProfile.infoDic[className]) {
  6031. GetSetProfile.infoDic[className] = {};
  6032. }
  6033. propCallsDic = GetSetProfile.infoDic[className];
  6034. var propCalls;
  6035. if (!propCallsDic[name]) {
  6036. propCallsDic[name] = {};
  6037. }
  6038. propCalls = propCallsDic[name];
  6039. var propCallO;
  6040. if (!propCalls[type]) {
  6041. propCalls[type] = {};
  6042. }
  6043. propCallO = propCalls[type];
  6044. if (!propCallO[objID]) {
  6045. propCallO[objID] = 1;
  6046. if (!propCallO["objCount"]) {
  6047. propCallO["objCount"] = 1;
  6048. }
  6049. else {
  6050. propCallO["objCount"] = propCallO["objCount"] + 1;
  6051. }
  6052. }
  6053. else {
  6054. propCallO[objID] = propCallO[objID] + 1;
  6055. }
  6056. if (!propCallO["count"]) {
  6057. propCallO["count"] = 1;
  6058. }
  6059. else {
  6060. propCallO["count"] = propCallO["count"] + 1;
  6061. }
  6062. }
  6063. static showInfo() {
  6064. var rstO;
  6065. rstO = {};
  6066. var rstO1;
  6067. rstO1 = {};
  6068. var arr;
  6069. arr = [];
  6070. var arr1;
  6071. arr1 = [];
  6072. var className;
  6073. var keyName;
  6074. var type;
  6075. for (className in GetSetProfile.infoDic) {
  6076. var tClassO;
  6077. var tClassO1;
  6078. tClassO = GetSetProfile.infoDic[className];
  6079. rstO[className] = tClassO1 = {};
  6080. for (keyName in tClassO) {
  6081. var tKeyO;
  6082. var tKeyO1;
  6083. tKeyO = tClassO[keyName];
  6084. tClassO1[keyName] = tKeyO1 = {};
  6085. for (type in tKeyO) {
  6086. var tDataO;
  6087. tDataO = tKeyO[type];
  6088. tDataO["rate"] = tDataO["objCount"] / GetSetProfile.getClassCount(className);
  6089. tKeyO1[type] = tDataO["rate"];
  6090. var tSKey;
  6091. tSKey = className + "_" + keyName + "_" + type;
  6092. rstO1[tSKey] = tDataO["rate"];
  6093. if (className == GetSetProfile.ALL) {
  6094. if (type == "get") {
  6095. arr.push([tSKey, tDataO["rate"], tDataO["count"]]);
  6096. }
  6097. else {
  6098. arr1.push([tSKey, tDataO["rate"], tDataO["count"]]);
  6099. }
  6100. }
  6101. }
  6102. }
  6103. }
  6104. console.log(GetSetProfile.infoDic);
  6105. console.log(GetSetProfile.countDic);
  6106. console.log(rstO);
  6107. console.log(rstO1);
  6108. console.log("nodeCount:", GetSetProfile.getClassCount(GetSetProfile.ALL));
  6109. console.log("sort by rate");
  6110. GetSetProfile.showStaticInfo(arr, arr1, "1");
  6111. console.log("sort by count");
  6112. GetSetProfile.showStaticInfo(arr, arr1, "2");
  6113. }
  6114. static showStaticInfo(arr, arr1, sortKey) {
  6115. console.log("get:");
  6116. GetSetProfile.showStaticArray(arr, sortKey);
  6117. console.log("set:");
  6118. GetSetProfile.showStaticArray(arr1, sortKey);
  6119. }
  6120. static showStaticArray(arr, sortKey = "1") {
  6121. arr.sort(Laya.MathUtil.sortByKey(sortKey, true, true));
  6122. var i, len;
  6123. len = arr.length;
  6124. var tArr;
  6125. for (i = 0; i < len; i++) {
  6126. tArr = arr[i];
  6127. console.log(tArr[0], Math.floor(tArr[1] * 100), tArr[2]);
  6128. }
  6129. }
  6130. static hookVar(obj, name, setHook = null, getHook = null) {
  6131. if (!setHook)
  6132. setHook = [];
  6133. if (!getHook)
  6134. getHook = [];
  6135. var preO = obj;
  6136. var preValue;
  6137. var des;
  6138. des = ClassTool.getOwnPropertyDescriptor(obj, name);
  6139. var ndes = {};
  6140. var mSet = function (value) {
  6141. preValue = value;
  6142. };
  6143. var mGet = function () {
  6144. return preValue;
  6145. };
  6146. var mSet1 = function (value) {
  6147. var _t = this;
  6148. GetSetProfile.reportCall(_t, name, "set");
  6149. };
  6150. var mGet1 = function () {
  6151. var _t = this;
  6152. GetSetProfile.reportCall(_t, name, "get");
  6153. return preValue;
  6154. };
  6155. getHook.push(mGet1);
  6156. setHook.push(mSet1);
  6157. while (!des && obj["__proto__"]) {
  6158. obj = obj["__proto__"];
  6159. des = ClassTool.getOwnPropertyDescriptor(obj, name);
  6160. }
  6161. if (des) {
  6162. ndes.set = des.set ? des.set : mSet;
  6163. ndes.get = des.get ? des.get : mGet;
  6164. if (!des.get) {
  6165. preValue = preO[name];
  6166. }
  6167. ndes.enumerable = des.enumerable;
  6168. setHook.push(ndes.set);
  6169. getHook.push(ndes.get);
  6170. FunHook.hookFuns(ndes, "set", setHook);
  6171. FunHook.hookFuns(ndes, "get", getHook, getHook.length - 1);
  6172. ClassTool.defineProperty(preO, name, ndes);
  6173. }
  6174. if (!des) {
  6175. ndes.set = mSet;
  6176. ndes.get = mGet;
  6177. preValue = preO[name];
  6178. setHook.push(ndes.set);
  6179. getHook.push(ndes.get);
  6180. FunHook.hookFuns(ndes, "set", setHook);
  6181. FunHook.hookFuns(ndes, "get", getHook, getHook.length - 1);
  6182. ClassTool.defineProperty(preO, name, ndes);
  6183. }
  6184. }
  6185. }
  6186. GetSetProfile._inited = false;
  6187. GetSetProfile.noDisplayKeys = { "conchModel": true };
  6188. GetSetProfile.ALL = "ALL";
  6189. GetSetProfile.countDic = {};
  6190. GetSetProfile.fromMe = false;
  6191. GetSetProfile.hookClassDic = {};
  6192. GetSetProfile.infoDic = {};
  6193. class JsonTool {
  6194. constructor() {
  6195. this.meta = {
  6196. '\b': '\\b',
  6197. '\t': '\\t',
  6198. '\n': '\\n',
  6199. '\f': '\\f',
  6200. '\r': '\\r',
  6201. '"': '\\"',
  6202. '\\': '\\\\'
  6203. };
  6204. }
  6205. static getJsonString(obj, singleLine = true, split = "\n", depth = 0, Width = 4) {
  6206. var preStr = "";
  6207. preStr = JsonTool.getEmptyStr(depth * Width);
  6208. var rst;
  6209. var keyValues;
  6210. keyValues = {};
  6211. var tKey;
  6212. var tValue;
  6213. var keys;
  6214. keys = [];
  6215. for (tKey in obj) {
  6216. keys.push(tKey);
  6217. tValue = obj[tKey];
  6218. if (JsonTool.singleLineKey[tKey]) {
  6219. keyValues[tKey] = JsonTool.getValueStr(tValue, true, split, depth + 1, Width);
  6220. }
  6221. else {
  6222. keyValues[tKey] = JsonTool.getValueStr(tValue, singleLine, split, depth + 1, Width);
  6223. }
  6224. }
  6225. var i, len;
  6226. len = keys.length;
  6227. keys.sort();
  6228. keys = keys.reverse();
  6229. var keyPreStr;
  6230. keyPreStr = JsonTool.getEmptyStr((depth + 1) * Width);
  6231. if (singleLine) {
  6232. split = "";
  6233. preStr = "";
  6234. keyPreStr = "";
  6235. }
  6236. var keyValueStrArr;
  6237. keyValueStrArr = [];
  6238. for (i = 0; i < len; i++) {
  6239. tKey = keys[i];
  6240. keyValueStrArr.push(keyPreStr + JsonTool.wrapValue(tKey) + ":" + keyValues[tKey]);
  6241. }
  6242. rst = "{" + split + keyValueStrArr.join("," + split) + split + preStr + "}";
  6243. return rst;
  6244. }
  6245. static wrapValue(value, wraper = "\"") {
  6246. return wraper + value + wraper;
  6247. }
  6248. static getArrStr(arr, singleLine = true, split = "\n", depth = 0, Width = 4) {
  6249. var rst;
  6250. var i, len;
  6251. len = arr.length;
  6252. var valueStrArr;
  6253. valueStrArr = [];
  6254. for (i = 0; i < len; i++) {
  6255. valueStrArr.push(JsonTool.getValueStr(arr[i], singleLine, split, depth + 1, Width));
  6256. }
  6257. var preStr = "";
  6258. preStr = JsonTool.getEmptyStr((depth + 1) * Width);
  6259. if (singleLine) {
  6260. split = "";
  6261. preStr = "";
  6262. }
  6263. rst = "[" + split + preStr + valueStrArr.join("," + split + preStr) + "]";
  6264. return rst;
  6265. }
  6266. static quote(string) {
  6267. JsonTool.escapable.lastIndex = 0;
  6268. return JsonTool.escapable.test(string) ? '"' + string.replace(JsonTool.escapable, function (a) {
  6269. var c = this.meta[a];
  6270. return typeof c === 'string' ? c :
  6271. '\\u' + ('0000' + a.charCodeAt(0).toString(16)).slice(-4);
  6272. }) + '"' : '"' + string + '"';
  6273. }
  6274. static getValueStr(tValue, singleLine = true, split = "\n", depth = 0, Width = 0) {
  6275. var rst;
  6276. if (typeof (tValue) == 'string') {
  6277. rst = JsonTool.quote(tValue);
  6278. }
  6279. else if (tValue == null) {
  6280. rst = "null";
  6281. }
  6282. else if (typeof (tValue) == 'number' || typeof (tValue) == 'number' || tValue instanceof Boolean) {
  6283. rst = tValue;
  6284. }
  6285. else if (tValue instanceof Array) {
  6286. rst = JsonTool.getArrStr(tValue, singleLine, split, depth, Width);
  6287. }
  6288. else if (typeof (tValue) == 'object') {
  6289. rst = JsonTool.getJsonString(tValue, singleLine, split, depth, Width);
  6290. }
  6291. else {
  6292. rst = tValue;
  6293. }
  6294. return rst;
  6295. }
  6296. static getEmptyStr(width) {
  6297. if (!JsonTool.emptyDic.hasOwnProperty(width)) {
  6298. var i;
  6299. var len;
  6300. len = width;
  6301. var rst;
  6302. rst = "";
  6303. for (i = 0; i < len; i++) {
  6304. rst += " ";
  6305. }
  6306. JsonTool.emptyDic[width] = rst;
  6307. }
  6308. return JsonTool.emptyDic[width];
  6309. }
  6310. }
  6311. JsonTool.singleLineKey = {
  6312. "props": true
  6313. };
  6314. JsonTool.escapable = /[\\\"\x00-\x1f\x7f-\x9f\u00ad\u0600-\u0604\u070f\u17b4\u17b5\u200c-\u200f\u2028-\u202f\u2060-\u206f\ufeff\ufff0-\uffff]/g;
  6315. JsonTool.emptyDic = {};
  6316. class LayoutTools {
  6317. constructor() {
  6318. }
  6319. static layoutToXCount(items, xCount = 1, dx = 0, dY = 0, sx = 0, sy = 0) {
  6320. var tX, tY;
  6321. var tItem;
  6322. var i, len;
  6323. var tCount;
  6324. var maxHeight;
  6325. tCount = 0;
  6326. maxHeight = 0;
  6327. tX = sx;
  6328. tY = sy;
  6329. len = items.length;
  6330. for (i = 0; i < len; i++) {
  6331. tItem = items[i];
  6332. tItem.x = tX;
  6333. tItem.y = tY;
  6334. if (tItem.height > maxHeight) {
  6335. maxHeight = tItem.height;
  6336. }
  6337. tCount++;
  6338. if (tCount >= xCount) {
  6339. tCount = tCount % xCount;
  6340. tItem.y += maxHeight + dY;
  6341. maxHeight = 0;
  6342. }
  6343. else {
  6344. tX += tItem.width + dx;
  6345. }
  6346. }
  6347. }
  6348. static layoutToWidth(items, width, dX, dY, sx, sy) {
  6349. var tX, tY;
  6350. var tItem;
  6351. var i, len;
  6352. tX = sx;
  6353. tY = sy;
  6354. len = items.length;
  6355. for (i = 0; i < len; i++) {
  6356. tItem = items[i];
  6357. if (tX + tItem.width + dX > width) {
  6358. tX = sx;
  6359. tY += dY + tItem.height;
  6360. }
  6361. tItem.x = tX;
  6362. tItem.y = tY;
  6363. tX += dX + tItem.width;
  6364. }
  6365. }
  6366. }
  6367. class MouseEventAnalyser {
  6368. constructor() {
  6369. }
  6370. static analyseNode(node) {
  6371. DebugTool.showDisBound(node, true);
  6372. var _node;
  6373. _node = node;
  6374. ObjectTools.clearObj(MouseEventAnalyser.infoO);
  6375. ObjectTools.clearObj(MouseEventAnalyser.nodeO);
  6376. ObjectTools.clearObj(MouseEventAnalyser.hitO);
  6377. var nodeList;
  6378. nodeList = [];
  6379. while (node) {
  6380. IDTools.idObj(node);
  6381. MouseEventAnalyser.nodeO[IDTools.getObjID(node)] = node;
  6382. nodeList.push(node);
  6383. node = node.parent;
  6384. }
  6385. MouseEventAnalyser.check(Laya.Laya.stage, Laya.Laya.stage.mouseX, Laya.Laya.stage.mouseY, null);
  6386. var canStr;
  6387. if (MouseEventAnalyser.hitO[IDTools.getObjID(_node)]) {
  6388. console.log("can hit");
  6389. canStr = "can hit";
  6390. }
  6391. else {
  6392. console.log("can't hit");
  6393. canStr = "can't hit";
  6394. }
  6395. var i, len;
  6396. nodeList = nodeList.reverse();
  6397. len = nodeList.length;
  6398. var rstTxts;
  6399. rstTxts = ["[分析对象]:" + ClassTool.getNodeClassAndName(_node) + ":" + canStr];
  6400. for (i = 0; i < len; i++) {
  6401. node = nodeList[i];
  6402. if (MouseEventAnalyser.hitO[IDTools.getObjID(node)]) {
  6403. console.log("can hit:", ClassTool.getNodeClassAndName(node));
  6404. console.log("原因:", MouseEventAnalyser.infoO[IDTools.getObjID(node)]);
  6405. rstTxts.push("can hit:" + " " + ClassTool.getNodeClassAndName(node));
  6406. rstTxts.push("原因:" + " " + MouseEventAnalyser.infoO[IDTools.getObjID(node)]);
  6407. }
  6408. else {
  6409. console.log("can't hit:" + ClassTool.getNodeClassAndName(node));
  6410. console.log("原因:", MouseEventAnalyser.infoO[IDTools.getObjID(node)] ? MouseEventAnalyser.infoO[IDTools.getObjID(node)] : "鼠标事件在父级已停止派发");
  6411. rstTxts.push("can't hit:" + " " + ClassTool.getNodeClassAndName(node));
  6412. rstTxts.push("原因:" + " " + (MouseEventAnalyser.infoO[IDTools.getObjID(node)] ? MouseEventAnalyser.infoO[IDTools.getObjID(node)] : "鼠标事件在父级已停止派发"));
  6413. }
  6414. }
  6415. var rstStr;
  6416. rstStr = rstTxts.join("\n");
  6417. }
  6418. static check(sp, mouseX, mouseY, callBack) {
  6419. IDTools.idObj(sp);
  6420. var isInAnlyseChain;
  6421. isInAnlyseChain = MouseEventAnalyser.nodeO[IDTools.getObjID(sp)];
  6422. MouseEventAnalyser._point.setTo(mouseX, mouseY);
  6423. sp.fromParentPoint(MouseEventAnalyser._point);
  6424. mouseX = MouseEventAnalyser._point.x;
  6425. mouseY = MouseEventAnalyser._point.y;
  6426. var scrollRect = sp.scrollRect;
  6427. if (scrollRect) {
  6428. MouseEventAnalyser._rect.setTo(scrollRect.x, scrollRect.y, scrollRect.width, scrollRect.height);
  6429. var isHit = MouseEventAnalyser._rect.contains(mouseX, mouseY);
  6430. if (!isHit) {
  6431. if (isInAnlyseChain) {
  6432. MouseEventAnalyser.infoO[IDTools.getObjID(sp)] = "scrollRect没有包含鼠标" + MouseEventAnalyser._rect.toString() + ":" + mouseX + "," + mouseY;
  6433. }
  6434. return false;
  6435. }
  6436. }
  6437. var i, len;
  6438. var cList;
  6439. cList = sp._children;
  6440. len = cList.length;
  6441. var child;
  6442. var childInChain;
  6443. childInChain = null;
  6444. for (i = 0; i < len; i++) {
  6445. child = cList[i];
  6446. IDTools.idObj(child);
  6447. if (MouseEventAnalyser.nodeO[IDTools.getObjID(child)]) {
  6448. childInChain = child;
  6449. break;
  6450. }
  6451. }
  6452. var coverByOthers;
  6453. coverByOthers = childInChain ? true : false;
  6454. var flag = false;
  6455. if (sp.hitTestPrior && !sp.mouseThrough && !MouseEventAnalyser.hitTest(sp, mouseX, mouseY)) {
  6456. MouseEventAnalyser.infoO[IDTools.getObjID(sp)] = "hitTestPrior=true,宽高区域不包含鼠标:" + ":" + mouseX + "," + mouseY + " size:" + sp.width + "," + sp.height;
  6457. return false;
  6458. }
  6459. for (i = sp._children.length - 1; i > -1; i--) {
  6460. child = sp._children[i];
  6461. if (child == childInChain) {
  6462. if (!childInChain.mouseEnabled) {
  6463. MouseEventAnalyser.infoO[IDTools.getObjID(childInChain)] = "mouseEnabled=false";
  6464. }
  6465. if (!childInChain.visible) {
  6466. MouseEventAnalyser.infoO[IDTools.getObjID(childInChain)] = "visible=false";
  6467. }
  6468. coverByOthers = false;
  6469. }
  6470. if (child.mouseEnabled && child.visible) {
  6471. flag = MouseEventAnalyser.check(child, mouseX, mouseY, callBack);
  6472. if (flag) {
  6473. MouseEventAnalyser.hitO[IDTools.getObjID(sp)] = true;
  6474. MouseEventAnalyser.infoO[IDTools.getObjID(sp)] = "子对象被击中";
  6475. if (child == childInChain) {
  6476. MouseEventAnalyser.infoO[IDTools.getObjID(sp)] = "子对象被击中," + "击中对象在分析链中";
  6477. }
  6478. else {
  6479. MouseEventAnalyser.infoO[IDTools.getObjID(sp)] = "子对象被击中," + "击中对象不在分析链中";
  6480. if (coverByOthers) {
  6481. MouseEventAnalyser.infoO[IDTools.getObjID(childInChain)] = "被兄弟节点挡住,兄弟节点信息:" + ClassTool.getNodeClassAndName(child) + "," + child.getBounds().toString();
  6482. DebugTool.showDisBound(child, false, "#ffff00");
  6483. }
  6484. }
  6485. return true;
  6486. }
  6487. else {
  6488. if (child == childInChain) {
  6489. coverByOthers = false;
  6490. }
  6491. }
  6492. }
  6493. }
  6494. var mHitRect = new Laya.Rectangle();
  6495. var graphicHit = false;
  6496. graphicHit = sp.getGraphicBounds().contains(mouseX, mouseY);
  6497. if (sp.width > 0 && sp.height > 0) {
  6498. var hitRect = MouseEventAnalyser._rect;
  6499. if (!sp.mouseThrough) {
  6500. if (sp.hitArea)
  6501. hitRect = sp.hitArea;
  6502. else
  6503. hitRect.setTo(0, 0, sp.width, sp.height);
  6504. mHitRect.copyFrom(hitRect);
  6505. isHit = hitRect.contains(mouseX, mouseY);
  6506. }
  6507. else {
  6508. isHit = graphicHit;
  6509. mHitRect.copyFrom(sp.getGraphicBounds());
  6510. }
  6511. if (isHit) {
  6512. MouseEventAnalyser.hitO[IDTools.getObjID(sp)] = true;
  6513. }
  6514. }
  6515. if (!isHit) {
  6516. if (graphicHit) {
  6517. MouseEventAnalyser.infoO[IDTools.getObjID(sp)] = "子对象未包含鼠标,实际绘图区域包含鼠标,设置的宽高区域不包含鼠标:" + ":" + mouseX + "," + mouseY + " hitRec:" + mHitRect.toString() + " graphicBounds:" + sp.getGraphicBounds().toString() + ",设置mouseThrough=true或将宽高设置到实际绘图区域可解决问题";
  6518. }
  6519. else {
  6520. MouseEventAnalyser.infoO[IDTools.getObjID(sp)] = "子对象未包含鼠标,实际绘图区域不包含鼠标,设置的宽高区域不包含鼠标:" + ":" + mouseX + "," + mouseY + " hitRec:" + mHitRect.toString() + " graphicBounds:" + sp.getGraphicBounds().toString();
  6521. }
  6522. }
  6523. else {
  6524. MouseEventAnalyser.infoO[IDTools.getObjID(sp)] = "自身区域被击中";
  6525. }
  6526. return isHit;
  6527. }
  6528. static hitTest(sp, mouseX, mouseY) {
  6529. var isHit = false;
  6530. if (sp.hitArea instanceof Laya.HitArea) {
  6531. return Laya.MouseManager.instance.hitTest(sp, mouseX, mouseY);
  6532. }
  6533. if (sp.width > 0 && sp.height > 0 || sp.mouseThrough || sp.hitArea) {
  6534. var hitRect = MouseEventAnalyser._rect;
  6535. if (!sp.mouseThrough) {
  6536. if (sp.hitArea)
  6537. hitRect = sp.hitArea;
  6538. else
  6539. hitRect.setTo(0, 0, sp.width, sp.height);
  6540. isHit = hitRect.contains(mouseX, mouseY);
  6541. }
  6542. else {
  6543. isHit = sp.getGraphicBounds().contains(mouseX, mouseY);
  6544. }
  6545. }
  6546. return isHit;
  6547. }
  6548. }
  6549. MouseEventAnalyser.infoO = {};
  6550. MouseEventAnalyser.nodeO = {};
  6551. MouseEventAnalyser.hitO = {};
  6552. MouseEventAnalyser._matrix = new Laya.Matrix();
  6553. MouseEventAnalyser._point = new Laya.Point();
  6554. MouseEventAnalyser._rect = new Laya.Rectangle();
  6555. DebugTool.analyseMouseHit = () => {
  6556. if (DebugTool.target)
  6557. MouseEventAnalyser.analyseNode(DebugTool.target);
  6558. };
  6559. class ResTools {
  6560. constructor() {
  6561. }
  6562. static getCachedResList() {
  6563. return ResTools.getWebGlResList();
  6564. }
  6565. static getWebGlResList() {
  6566. var rst;
  6567. rst = [];
  6568. return rst;
  6569. }
  6570. static getCanvasResList() {
  6571. var picDic;
  6572. picDic = {};
  6573. var dataO;
  6574. dataO = Laya.Loader.loadedMap;
  6575. ResTools.collectPics(dataO, picDic);
  6576. return ResTools.getArrFromDic(picDic);
  6577. }
  6578. static getArrFromDic(dic) {
  6579. var key;
  6580. var rst;
  6581. rst = [];
  6582. for (key in dic) {
  6583. rst.push(key);
  6584. }
  6585. return rst;
  6586. }
  6587. static collectPics(dataO, picDic) {
  6588. if (!dataO)
  6589. return;
  6590. var key;
  6591. var tTexture;
  6592. for (key in dataO) {
  6593. tTexture = dataO[key];
  6594. if (tTexture) {
  6595. if (tTexture.bitmap && tTexture.bitmap.src) {
  6596. var url = tTexture.bitmap.src;
  6597. if (url.indexOf("data:image/png;base64") < 0)
  6598. picDic[tTexture.bitmap.src] = true;
  6599. }
  6600. }
  6601. }
  6602. }
  6603. }
  6604. class SingleTool {
  6605. constructor() {
  6606. this._objDic = {};
  6607. }
  6608. static get I() {
  6609. if (!SingleTool._instance) {
  6610. SingleTool._instance = new SingleTool();
  6611. }
  6612. return SingleTool._instance;
  6613. }
  6614. static set I(value) {
  6615. SingleTool._instance = value;
  6616. }
  6617. getArr(sign) {
  6618. var dic;
  6619. dic = this.getTypeDic("Array");
  6620. if (!dic[sign])
  6621. dic[sign] = [];
  6622. return dic[sign];
  6623. }
  6624. getObject(sign) {
  6625. var dic;
  6626. dic = this.getTypeDic("Object");
  6627. if (!dic[sign])
  6628. dic[sign] = {};
  6629. return dic[sign];
  6630. }
  6631. getByClass(sign, clzSign, clz) {
  6632. var dic;
  6633. dic = this.getTypeDic(clzSign);
  6634. if (!dic[sign])
  6635. dic[sign] = new clz();
  6636. return dic[sign];
  6637. }
  6638. getTypeDic(type) {
  6639. if (!this._objDic[type])
  6640. this._objDic[type] = {};
  6641. return this._objDic[type];
  6642. }
  6643. }
  6644. class TimeTool {
  6645. constructor() {
  6646. }
  6647. static getTime(sign, update = true) {
  6648. if (!TimeTool.timeDic[sign]) {
  6649. TimeTool.timeDic[sign] = 0;
  6650. }
  6651. var tTime;
  6652. tTime = Laya.Browser.now();
  6653. var rst;
  6654. rst = tTime - TimeTool.timeDic[sign];
  6655. TimeTool.timeDic[sign] = tTime;
  6656. return rst;
  6657. }
  6658. static runAllCallLater() {
  6659. if (TimeTool._deep > 0)
  6660. debugger;
  6661. TimeTool._deep++;
  6662. var timer;
  6663. timer = Laya.Laya.timer;
  6664. var laters = timer["_laters"];
  6665. for (var i = 0, n = laters.length - 1; i <= n; i++) {
  6666. var handler = laters[i];
  6667. if (handler) {
  6668. handler.method !== null && handler.run(false);
  6669. timer["_recoverHandler"](handler);
  6670. }
  6671. else {
  6672. debugger;
  6673. }
  6674. i === n && (n = laters.length - 1);
  6675. }
  6676. laters.length = 0;
  6677. TimeTool._deep--;
  6678. }
  6679. }
  6680. TimeTool.timeDic = {};
  6681. TimeTool._deep = 0;
  6682. class TimerControlTool {
  6683. constructor() {
  6684. }
  6685. static now() {
  6686. if (TimerControlTool._timeRate != 1)
  6687. return TimerControlTool.getRatedNow();
  6688. return Date.now();
  6689. }
  6690. static getRatedNow() {
  6691. var dTime;
  6692. dTime = TimerControlTool.getNow() - TimerControlTool._startTime;
  6693. return dTime * TimerControlTool._timeRate + TimerControlTool._startTime;
  6694. }
  6695. static getNow() {
  6696. return Date.now();
  6697. }
  6698. static setTimeRate(rate) {
  6699. if (TimerControlTool._browerNow == null)
  6700. TimerControlTool._browerNow = Laya.Browser["now"];
  6701. TimerControlTool._startTime = TimerControlTool.getNow();
  6702. TimerControlTool._timeRate = rate;
  6703. if (rate != 1) {
  6704. Laya.Browser["now"] = TimerControlTool.now;
  6705. }
  6706. else {
  6707. if (TimerControlTool._browerNow != null)
  6708. Laya.Browser["now"] = TimerControlTool._browerNow;
  6709. }
  6710. }
  6711. static recoverRate() {
  6712. TimerControlTool.setTimeRate(1);
  6713. }
  6714. }
  6715. TimerControlTool._timeRate = 1;
  6716. class TouchDebugTools {
  6717. constructor() {
  6718. }
  6719. static getTouchIDs(events) {
  6720. var rst;
  6721. rst = [];
  6722. var i, len;
  6723. len = events.length;
  6724. for (i = 0; i < len; i++) {
  6725. rst.push(events[i].identifier || 0);
  6726. }
  6727. return rst;
  6728. }
  6729. static traceTouchIDs(msg, events) {
  6730. DebugTxt.dTrace(msg + ":" + TouchDebugTools.getTouchIDs(events).join(","));
  6731. }
  6732. }
  6733. class UVTools {
  6734. constructor() {
  6735. }
  6736. static getUVByRec(x, y, width, height) {
  6737. return [x, y, x + width, y, x + width, y + height, x, y + height];
  6738. }
  6739. static getRecFromUV(uv) {
  6740. var rst;
  6741. rst = new Laya.Rectangle(uv[0], uv[1], uv[2] - uv[0], uv[5] - uv[1]);
  6742. return rst;
  6743. }
  6744. static isUVRight(uv) {
  6745. if (uv[0] != uv[6])
  6746. return false;
  6747. if (uv[1] != uv[3])
  6748. return false;
  6749. if (uv[2] != uv[4])
  6750. return false;
  6751. if (uv[5] != uv[7])
  6752. return false;
  6753. return true;
  6754. }
  6755. static getTextureRec(texture) {
  6756. var rst;
  6757. rst = UVTools.getRecFromUV((texture.uv));
  6758. rst.x *= texture.bitmap.width;
  6759. rst.y *= texture.bitmap.height;
  6760. rst.width *= texture.bitmap.width;
  6761. rst.height *= texture.bitmap.height;
  6762. return rst;
  6763. }
  6764. }
  6765. class VisibleAnalyser {
  6766. constructor() {
  6767. }
  6768. static analyseTarget(node) {
  6769. var isInstage;
  6770. isInstage = node.displayedInStage;
  6771. var gRec;
  6772. gRec = NodeUtils.getGRec(node);
  6773. var stageRec = new Laya.Rectangle();
  6774. stageRec.setTo(0, 0, Laya.Laya.stage.width, Laya.Laya.stage.height);
  6775. var isInVisibleRec;
  6776. var visibleRec;
  6777. visibleRec = stageRec.intersection(gRec);
  6778. if (visibleRec.width > 0 && visibleRec.height > 0) {
  6779. isInVisibleRec = true;
  6780. }
  6781. else {
  6782. isInVisibleRec = false;
  6783. }
  6784. var gAlpha;
  6785. gAlpha = NodeUtils.getGAlpha(node);
  6786. var gVisible;
  6787. gVisible = NodeUtils.getGVisible(node);
  6788. var msg;
  6789. msg = "";
  6790. msg += "isInstage:" + isInstage + "\n";
  6791. msg += "isInVisibleRec:" + isInVisibleRec + "\n";
  6792. msg += "gVisible:" + gVisible + "\n";
  6793. msg += "gAlpha:" + gAlpha + "\n";
  6794. if (isInstage && isInVisibleRec && gVisible && gAlpha > 0) {
  6795. VisibleAnalyser.anlyseRecVisible(node);
  6796. msg += "coverRate:" + VisibleAnalyser.coverRate + "\n";
  6797. if (VisibleAnalyser._coverList.length > 0) {
  6798. Laya.Laya.timer.once(1000, null, VisibleAnalyser.showListLater);
  6799. }
  6800. }
  6801. console.log(msg);
  6802. }
  6803. static showListLater() {
  6804. }
  6805. static isCoverByBrother(node) {
  6806. var parent = node.parent;
  6807. if (!parent)
  6808. return;
  6809. var _childs = parent._children;
  6810. var index;
  6811. index = _childs.indexOf(node);
  6812. if (index < 0)
  6813. return;
  6814. var rec;
  6815. rec = parent.getSelfBounds();
  6816. if (rec.width <= 0 || rec.height <= 0)
  6817. return;
  6818. }
  6819. static anlyseRecVisible(node) {
  6820. VisibleAnalyser.isNodeWalked = false;
  6821. VisibleAnalyser._analyseTarget = node;
  6822. if (!VisibleAnalyser.mainCanvas)
  6823. VisibleAnalyser.mainCanvas = CanvasTools.createCanvas(Laya.Laya.stage.width, Laya.Laya.stage.height);
  6824. CanvasTools.clearCanvas(VisibleAnalyser.mainCanvas);
  6825. VisibleAnalyser.tColor = 1;
  6826. VisibleAnalyser.resetCoverList();
  6827. WalkTools.walkTargetEX(Laya.Laya.stage, VisibleAnalyser.recVisibleWalker, null, VisibleAnalyser.filterFun);
  6828. if (!VisibleAnalyser.isTarRecOK) {
  6829. VisibleAnalyser.coverRate = 0;
  6830. }
  6831. else {
  6832. VisibleAnalyser.coverRate = CanvasTools.getDifferRate(VisibleAnalyser.preImageData, VisibleAnalyser.tarImageData);
  6833. }
  6834. console.log("coverRate:", VisibleAnalyser.coverRate);
  6835. }
  6836. static getRecArea(rec) {
  6837. return rec.width * rec.height;
  6838. }
  6839. static addCoverNode(node, coverRate) {
  6840. var data;
  6841. data = {};
  6842. data.path = node;
  6843. data.label = ClassTool.getNodeClassAndName(node) + ":" + coverRate;
  6844. data.coverRate = coverRate;
  6845. VisibleAnalyser._coverList.push(data);
  6846. console.log("coverByNode:", node, coverRate);
  6847. }
  6848. static resetCoverList() {
  6849. VisibleAnalyser._coverList.length = 0;
  6850. }
  6851. static recVisibleWalker(node) {
  6852. if (node == VisibleAnalyser._analyseTarget) {
  6853. VisibleAnalyser.isNodeWalked = true;
  6854. VisibleAnalyser.tarRec.copyFrom(NodeUtils.getGRec(node));
  6855. console.log("tarRec:", VisibleAnalyser.tarRec.toString());
  6856. if (VisibleAnalyser.tarRec.width > 0 && VisibleAnalyser.tarRec.height > 0) {
  6857. VisibleAnalyser.isTarRecOK = true;
  6858. VisibleAnalyser.tColor++;
  6859. CanvasTools.fillCanvasRec(VisibleAnalyser.mainCanvas, VisibleAnalyser.tarRec, ColorTool.toHexColor(VisibleAnalyser.tColor));
  6860. VisibleAnalyser.preImageData = CanvasTools.getImageDataFromCanvasByRec(VisibleAnalyser.mainCanvas, VisibleAnalyser.tarRec);
  6861. VisibleAnalyser.tarImageData = CanvasTools.getImageDataFromCanvasByRec(VisibleAnalyser.mainCanvas, VisibleAnalyser.tarRec);
  6862. }
  6863. else {
  6864. console.log("tarRec Not OK:", VisibleAnalyser.tarRec);
  6865. }
  6866. }
  6867. else {
  6868. if (VisibleAnalyser.isTarRecOK) {
  6869. var tRec;
  6870. tRec = NodeUtils.getGRec(node);
  6871. VisibleAnalyser.interRec = VisibleAnalyser.tarRec.intersection(tRec, VisibleAnalyser.interRec);
  6872. if (VisibleAnalyser.interRec && VisibleAnalyser.interRec.width > 0 && VisibleAnalyser.interRec.height > 0) {
  6873. VisibleAnalyser.tColor++;
  6874. CanvasTools.fillCanvasRec(VisibleAnalyser.mainCanvas, tRec, ColorTool.toHexColor(VisibleAnalyser.tColor));
  6875. VisibleAnalyser.tImageData = CanvasTools.getImageDataFromCanvasByRec(VisibleAnalyser.mainCanvas, VisibleAnalyser.tarRec);
  6876. var dRate;
  6877. dRate = CanvasTools.getDifferRate(VisibleAnalyser.preImageData, VisibleAnalyser.tImageData);
  6878. VisibleAnalyser.preImageData = VisibleAnalyser.tImageData;
  6879. VisibleAnalyser.addCoverNode(node, dRate);
  6880. }
  6881. }
  6882. }
  6883. }
  6884. static filterFun(node) {
  6885. if (node.visible == false)
  6886. return false;
  6887. if (node.alpha < 0)
  6888. return false;
  6889. if (DebugInfoLayer.I.isDebugItem(node))
  6890. return false;
  6891. return true;
  6892. }
  6893. }
  6894. VisibleAnalyser.tarRec = new Laya.Rectangle();
  6895. VisibleAnalyser.interRec = new Laya.Rectangle();
  6896. VisibleAnalyser._coverList = [];
  6897. class XML2Object {
  6898. static parse(node, isFirst = true) {
  6899. var obj = {};
  6900. if (isFirst)
  6901. obj.Name = node.localName;
  6902. var numOfChilds = node.children.length;
  6903. var childs = [];
  6904. var children = {};
  6905. obj.c = children;
  6906. obj.cList = childs;
  6907. for (var i = 0; i < numOfChilds; i++) {
  6908. var childNode = node.children[i];
  6909. var childNodeName = childNode.localName;
  6910. var value;
  6911. var numOfAttributes;
  6912. value = XML2Object.parse(childNode, true);
  6913. childs.push(value);
  6914. if (children[childNodeName]) {
  6915. if (XML2Object.getTypeof(children[childNodeName]) == "array") {
  6916. children[childNodeName].push(value);
  6917. }
  6918. else {
  6919. children[childNodeName] = [children[childNodeName], value];
  6920. }
  6921. }
  6922. else if (XML2Object.isArray(childNodeName)) {
  6923. children[childNodeName] = [value];
  6924. }
  6925. else {
  6926. children[childNodeName] = value;
  6927. }
  6928. }
  6929. numOfAttributes = 0;
  6930. if (node.attributes) {
  6931. numOfAttributes = node.attributes.length;
  6932. var prop = {};
  6933. obj.p = prop;
  6934. for (i = 0; i < numOfAttributes; i++) {
  6935. prop[node.attributes[i].name.toString()] = String(node.attributes[i].nodeValue);
  6936. }
  6937. }
  6938. if (numOfChilds == 0) {
  6939. if (numOfAttributes == 0) {
  6940. obj = "";
  6941. }
  6942. }
  6943. return obj;
  6944. }
  6945. static getArr(v) {
  6946. if (!v)
  6947. return [];
  6948. if (XML2Object.getTypeof(v) == "array")
  6949. return v;
  6950. return [v];
  6951. }
  6952. static get arrays() {
  6953. if (!XML2Object._arrays) {
  6954. XML2Object._arrays = [];
  6955. }
  6956. return XML2Object._arrays;
  6957. }
  6958. static set arrays(a) {
  6959. XML2Object._arrays = a;
  6960. }
  6961. static isArray(nodeName) {
  6962. var numOfArrays = XML2Object._arrays ? XML2Object._arrays.length : 0;
  6963. for (var i = 0; i < numOfArrays; i++) {
  6964. if (nodeName == XML2Object._arrays[i]) {
  6965. return true;
  6966. }
  6967. }
  6968. return false;
  6969. }
  6970. static getTypeof(o) {
  6971. if (typeof (o) == "object") {
  6972. if (o.length == null) {
  6973. return "object";
  6974. }
  6975. else if (typeof (o.length) == "number") {
  6976. return "array";
  6977. }
  6978. else {
  6979. return "object";
  6980. }
  6981. }
  6982. else {
  6983. return typeof (o);
  6984. }
  6985. }
  6986. }
  6987. class XML2ObjectNodejs {
  6988. static parse(node, isFirst = true) {
  6989. var obj = {};
  6990. if (isFirst)
  6991. obj.Name = node.localName;
  6992. var numOfChilds = node[XML2ObjectNodejs.ChildrenSign] ? node[XML2ObjectNodejs.ChildrenSign].length : 0;
  6993. var childs = [];
  6994. var children = {};
  6995. obj.c = children;
  6996. obj.cList = childs;
  6997. for (var i = 0; i < numOfChilds; i++) {
  6998. var childNode = node[XML2ObjectNodejs.ChildrenSign][i];
  6999. var childNodeName = childNode.localName;
  7000. var value;
  7001. var numOfAttributes;
  7002. if (!childNodeName)
  7003. continue;
  7004. value = XML2ObjectNodejs.parse(childNode, true);
  7005. childs.push(value);
  7006. if (children[childNodeName]) {
  7007. if (XML2ObjectNodejs.getTypeof(children[childNodeName]) == "array") {
  7008. children[childNodeName].push(value);
  7009. }
  7010. else {
  7011. children[childNodeName] = [children[childNodeName], value];
  7012. }
  7013. }
  7014. else if (XML2ObjectNodejs.isArray(childNodeName)) {
  7015. children[childNodeName] = [value];
  7016. }
  7017. else {
  7018. children[childNodeName] = value;
  7019. }
  7020. }
  7021. numOfAttributes = 0;
  7022. if (node.attributes) {
  7023. numOfAttributes = node.attributes.length;
  7024. var prop = {};
  7025. obj.p = prop;
  7026. for (i = 0; i < numOfAttributes; i++) {
  7027. prop[node.attributes[i].name.toString()] = String(node.attributes[i].nodeValue);
  7028. }
  7029. }
  7030. return obj;
  7031. }
  7032. static getArr(v) {
  7033. if (!v)
  7034. return [];
  7035. if (XML2ObjectNodejs.getTypeof(v) == "array")
  7036. return v;
  7037. return [v];
  7038. }
  7039. static get arrays() {
  7040. if (!XML2ObjectNodejs._arrays) {
  7041. XML2ObjectNodejs._arrays = [];
  7042. }
  7043. return XML2ObjectNodejs._arrays;
  7044. }
  7045. static set arrays(a) {
  7046. XML2ObjectNodejs._arrays = a;
  7047. }
  7048. static isArray(nodeName) {
  7049. var numOfArrays = XML2ObjectNodejs._arrays ? XML2ObjectNodejs._arrays.length : 0;
  7050. for (var i = 0; i < numOfArrays; i++) {
  7051. if (nodeName == XML2ObjectNodejs._arrays[i]) {
  7052. return true;
  7053. }
  7054. }
  7055. return false;
  7056. }
  7057. static getTypeof(o) {
  7058. if (typeof (o) == "object") {
  7059. if (o.length == null) {
  7060. return "object";
  7061. }
  7062. else if (typeof (o.length) == "number") {
  7063. return "array";
  7064. }
  7065. else {
  7066. return "object";
  7067. }
  7068. }
  7069. else {
  7070. return typeof (o);
  7071. }
  7072. }
  7073. }
  7074. XML2ObjectNodejs.ChildrenSign = "childNodes";
  7075. class Arrow extends Laya.Sprite {
  7076. constructor() {
  7077. super();
  7078. this.drawMe();
  7079. }
  7080. drawMe() {
  7081. var g;
  7082. g = this.graphics;
  7083. g.clear();
  7084. g.drawLine(0, 0, -1, -1, "#ff0000");
  7085. g.drawLine(0, 0, 1, -1, "#ff0000");
  7086. }
  7087. }
  7088. class AutoSizeRec extends Laya.Sprite {
  7089. constructor(type) {
  7090. super();
  7091. this._color = "#ffffff";
  7092. }
  7093. set height(value) {
  7094. super.height = value;
  7095. this.changeSize();
  7096. }
  7097. set width(value) {
  7098. super.width = value;
  7099. this.changeSize();
  7100. }
  7101. setColor(color) {
  7102. this._color = color;
  7103. this.reRender();
  7104. }
  7105. changeSize() {
  7106. this.reRender();
  7107. }
  7108. reRender() {
  7109. var g = this.graphics;
  7110. g.clear();
  7111. g.drawRect(0, 0, this.width, this.height, this._color);
  7112. }
  7113. record() {
  7114. this.preX = this.x;
  7115. this.preY = this.y;
  7116. }
  7117. getDx() {
  7118. return this.x - this.preX;
  7119. }
  7120. getDy() {
  7121. return this.y - this.preY;
  7122. }
  7123. }
  7124. class DInput extends Laya.Input {
  7125. constructor() {
  7126. super();
  7127. this.bgColor = "#11ff00";
  7128. }
  7129. }
  7130. class ClassCreateHook {
  7131. constructor() {
  7132. this.createInfo = {};
  7133. }
  7134. static get I() {
  7135. if (!ClassCreateHook._instance) {
  7136. ClassCreateHook._instance = new ClassCreateHook();
  7137. }
  7138. return ClassCreateHook._instance;
  7139. }
  7140. static set I(value) {
  7141. ClassCreateHook._instance = value;
  7142. }
  7143. hookClass(clz) {
  7144. if (ClassCreateHook.isInited)
  7145. return;
  7146. ClassCreateHook.isInited = true;
  7147. var createFun = function (sp) {
  7148. this.classCreated(sp, clz);
  7149. };
  7150. FunHook.hook(clz, "call", createFun);
  7151. }
  7152. classCreated(clz, oClass) {
  7153. var key;
  7154. key = ClassTool.getNodeClassAndName(clz);
  7155. var depth = 0;
  7156. var tClz;
  7157. tClz = clz;
  7158. while (tClz && tClz != oClass) {
  7159. tClz = tClz.prototype;
  7160. depth++;
  7161. }
  7162. if (!ClassCreateHook.I.createInfo[key]) {
  7163. ClassCreateHook.I.createInfo[key] = 0;
  7164. }
  7165. ClassCreateHook.I.createInfo[key] = ClassCreateHook.I.createInfo[key] + 1;
  7166. RunProfile.run(key, depth + 6);
  7167. }
  7168. getClassCreateInfo(clz) {
  7169. var key;
  7170. key = ClassTool.getClassName(clz);
  7171. return RunProfile.getRunInfo(key);
  7172. }
  7173. }
  7174. ClassCreateHook.isInited = false;
  7175. class FunctionTimeHook {
  7176. constructor() {
  7177. }
  7178. static hookFun(obj, funName) {
  7179. if (!obj)
  7180. return;
  7181. if (obj.timeHooked)
  7182. return;
  7183. var myKey;
  7184. FunctionTimeHook.HookID++;
  7185. myKey = ClassTool.getNodeClassAndName(obj) + "." + funName + "():" + FunctionTimeHook.HookID;
  7186. var timePreFun = function (...args) {
  7187. FunctionTimeHook.funBegin(myKey);
  7188. };
  7189. var timeEndFun = function (...args) {
  7190. FunctionTimeHook.funEnd(myKey);
  7191. };
  7192. obj.timeHooked = true;
  7193. FunHook.hook(obj, funName, timePreFun, timeEndFun);
  7194. }
  7195. static funBegin(funKey) {
  7196. FunctionTimeHook.funPre[funKey] = Laya.Browser.now();
  7197. }
  7198. static funEnd(funKey) {
  7199. if (!FunctionTimeHook.funPre[funKey])
  7200. FunctionTimeHook.funPre[funKey] = 0;
  7201. FunctionTimeHook.counter.add(funKey, Laya.Browser.now() - FunctionTimeHook.funPre[funKey]);
  7202. }
  7203. static fresh() {
  7204. FunctionTimeHook.funEnd(FunctionTimeHook.TotalSign);
  7205. FunctionTimeHook.counter.record();
  7206. FunctionTimeHook.funBegin(FunctionTimeHook.TotalSign);
  7207. }
  7208. }
  7209. FunctionTimeHook.HookID = 1;
  7210. FunctionTimeHook.counter = new CountTool();
  7211. FunctionTimeHook.funPre = {};
  7212. FunctionTimeHook.TotalSign = "TotalSign";
  7213. class LoaderHook extends Laya.LoaderManager {
  7214. constructor() {
  7215. super();
  7216. }
  7217. static init() {
  7218. if (LoaderHook.isInited)
  7219. return;
  7220. LoaderHook.isInited = true;
  7221. Laya.Laya.loader = new LoaderHook();
  7222. Laya.Laya.loader.on(Laya.Event.ERROR, null, LoaderHook.onFail);
  7223. LoaderHook.preFails = Laya.LocalStorage.getJSON(LoaderHook.FailSign);
  7224. if (!LoaderHook.preFails)
  7225. LoaderHook.preFails = {};
  7226. }
  7227. static onFail(failFile) {
  7228. LoaderHook.nowFails[failFile] = true;
  7229. Laya.LocalStorage.setJSON(LoaderHook.FailSign, LoaderHook.nowFails);
  7230. }
  7231. static resetFails() {
  7232. LoaderHook.nowFails = {};
  7233. Laya.LocalStorage.setJSON(LoaderHook.FailSign, LoaderHook.nowFails);
  7234. }
  7235. checkUrls(url) {
  7236. var tarUrl;
  7237. if (typeof (url) == 'string') {
  7238. tarUrl = url;
  7239. }
  7240. else {
  7241. tarUrl = url.url;
  7242. }
  7243. if (LoaderHook.preFails[tarUrl]) {
  7244. if (LoaderHook.enableFailDebugger) {
  7245. debugger;
  7246. }
  7247. }
  7248. }
  7249. chekUrlList(urls) {
  7250. var i, len;
  7251. len = urls.length;
  7252. for (i = 0; i < len; i++) {
  7253. this.checkUrls(urls[i]);
  7254. }
  7255. }
  7256. load(url, complete = null, progress = null, type = null, priority = 1, cache = true, group = null, ignoreCache = false, useWorkerLoader = false) {
  7257. if (url instanceof Array) {
  7258. this.chekUrlList(url);
  7259. }
  7260. else {
  7261. this.checkUrls(url);
  7262. }
  7263. return super.load(url, complete, progress, type, priority, cache, group, ignoreCache, useWorkerLoader);
  7264. }
  7265. }
  7266. LoaderHook.preFails = {};
  7267. LoaderHook.nowFails = {};
  7268. LoaderHook.enableFailDebugger = true;
  7269. LoaderHook.FailSign = "LoadFailItems";
  7270. LoaderHook.isInited = false;
  7271. class Observer {
  7272. constructor() {
  7273. }
  7274. static observe(obj, callBack) {
  7275. }
  7276. static unobserve(obj, callBack) {
  7277. }
  7278. static observeDiffer(obj, sign, msg = "obDiffer") {
  7279. var differFun = function () {
  7280. DifferTool.differ(sign, obj, msg);
  7281. };
  7282. Observer.observe(obj, differFun);
  7283. }
  7284. }
  7285. class Watch {
  7286. constructor() {
  7287. }
  7288. static watch(obj, name, callBack) {
  7289. obj.watch(name, callBack);
  7290. }
  7291. static unwatch(obj, name, callBack) {
  7292. obj.unwatch(name, callBack);
  7293. }
  7294. }
  7295. class Layouter {
  7296. constructor() {
  7297. this._sX = 0;
  7298. this._width = 0;
  7299. }
  7300. layout() {
  7301. this.layoutFun(this._width, this._items, this.data, this._sX);
  7302. }
  7303. set items(arr) {
  7304. this._items = arr;
  7305. this.calSize();
  7306. }
  7307. get items() {
  7308. return this._items;
  7309. }
  7310. set x(v) {
  7311. this._sX = v;
  7312. this.changed();
  7313. }
  7314. get x() {
  7315. return this._sX;
  7316. }
  7317. set width(v) {
  7318. this._width = v;
  7319. this.changed();
  7320. }
  7321. get width() {
  7322. return this._width;
  7323. }
  7324. changed() {
  7325. Laya.Laya.timer.callLater(this, this.layout);
  7326. }
  7327. calSize() {
  7328. var i, len;
  7329. var tItem;
  7330. tItem = this.items[0];
  7331. this._sX = tItem.x;
  7332. var maxX;
  7333. maxX = this._sX + tItem.width;
  7334. len = this.items.length;
  7335. for (i = 1; i < len; i++) {
  7336. tItem = this.items[i];
  7337. if (this._sX > tItem.x) {
  7338. this._sX = tItem.x;
  7339. }
  7340. if (maxX < tItem.x + tItem.width) {
  7341. maxX = tItem.x + tItem.width;
  7342. }
  7343. }
  7344. this._width = maxX - this._sX;
  7345. }
  7346. }
  7347. class LayoutFuns {
  7348. constructor() {
  7349. }
  7350. static sameWidth(totalWidth, items, data = null, sX = 0) {
  7351. var dWidth = 0;
  7352. if (data && data.dWidth)
  7353. dWidth = data.dWidth;
  7354. var perWidth;
  7355. perWidth = (totalWidth - (items.length - 1) * dWidth) / items.length;
  7356. var tItem;
  7357. var i, len;
  7358. var tX;
  7359. tX = sX;
  7360. len = items.length;
  7361. for (i = 0; i < len; i++) {
  7362. tItem = items[i];
  7363. tItem.x = tX;
  7364. tItem.width = perWidth;
  7365. tX += dWidth + perWidth;
  7366. }
  7367. }
  7368. static getSameWidthLayout(items, dWidth) {
  7369. var data;
  7370. data = {};
  7371. data.dWidth = dWidth;
  7372. return LayoutFuns.getLayouter(items, data, LayoutFuns.sameWidth);
  7373. }
  7374. static getLayouter(items, data, fun) {
  7375. var layouter;
  7376. layouter = new Layouter();
  7377. layouter.items = items;
  7378. layouter.data = data;
  7379. layouter.layoutFun = fun;
  7380. return layouter;
  7381. }
  7382. static sameDis(totalWidth, items, data = null, sX = 0) {
  7383. var dWidth;
  7384. dWidth = totalWidth;
  7385. var tItem;
  7386. var i, len;
  7387. len = items.length;
  7388. LayoutFuns.prepareForLayoutWidth(totalWidth, items);
  7389. for (i = 0; i < len; i++) {
  7390. tItem = items[i];
  7391. dWidth -= tItem.width;
  7392. }
  7393. if (items.length > 1)
  7394. dWidth = dWidth / (items.length - 1);
  7395. var tX;
  7396. tX = sX;
  7397. len = items.length;
  7398. for (i = 0; i < len; i++) {
  7399. tItem = items[i];
  7400. tItem.x = tX;
  7401. tX += dWidth + tItem.width;
  7402. }
  7403. }
  7404. static getSameDisLayout(items, rateSame = false) {
  7405. var data;
  7406. data = {};
  7407. if (rateSame) {
  7408. var i, len;
  7409. len = items.length;
  7410. var tItem;
  7411. var totalWidth;
  7412. totalWidth = 0;
  7413. for (i = 0; i < len; i++) {
  7414. tItem = items[i];
  7415. totalWidth += tItem.width;
  7416. }
  7417. totalWidth = tItem.x + tItem.width;
  7418. for (i = 0; i < len; i++) {
  7419. tItem = items[i];
  7420. LayoutFuns.setItemRate(tItem, tItem.width / totalWidth);
  7421. }
  7422. }
  7423. return LayoutFuns.getLayouter(items, data, LayoutFuns.sameDis);
  7424. }
  7425. static fullFill(totalWidth, items, data = null, sX = 0) {
  7426. var dL = 0, dR = 0;
  7427. if (data) {
  7428. if (data.dL)
  7429. dL = data.dL;
  7430. if (data.dR)
  7431. dR = data.dR;
  7432. }
  7433. var item;
  7434. var i, len;
  7435. len = items.length;
  7436. for (i = 0; i < len; i++) {
  7437. item = items[i];
  7438. item.x = sX + dL;
  7439. item.width = totalWidth - dL - dR;
  7440. }
  7441. }
  7442. static getFullFillLayout(items, dL = 0, dR = 0) {
  7443. var data;
  7444. data = {};
  7445. data.dL = dL;
  7446. data.dR = dR;
  7447. return LayoutFuns.getLayouter(items, data, LayoutFuns.fullFill);
  7448. }
  7449. static fixPos(totalWidth, items, data = null, sX = 0) {
  7450. var dLen = 0;
  7451. var poss = [];
  7452. var isRate = false;
  7453. if (data) {
  7454. if (data.dLen)
  7455. dLen = data.dLen;
  7456. if (data.poss)
  7457. poss = data.poss;
  7458. if (data.isRate)
  7459. isRate = data.isRate;
  7460. }
  7461. var item;
  7462. var i, len;
  7463. len = poss.length;
  7464. var tValue;
  7465. var preItem;
  7466. preItem = null;
  7467. for (i = 0; i < len; i++) {
  7468. item = items[i];
  7469. tValue = sX + poss[i];
  7470. if (isRate) {
  7471. tValue = sX + poss[i] * totalWidth;
  7472. }
  7473. item.x = tValue;
  7474. if (preItem) {
  7475. preItem.width = item.x - dLen - preItem.x;
  7476. }
  7477. preItem = item;
  7478. }
  7479. var lastItem;
  7480. lastItem = items[items.length - 1];
  7481. lastItem.width = sX + totalWidth - dLen - lastItem.x;
  7482. }
  7483. static getFixPos(items, dLen = 0, isRate = false, poss = null) {
  7484. var data;
  7485. data = {};
  7486. var layout;
  7487. layout = LayoutFuns.getLayouter(items, data, LayoutFuns.fixPos);
  7488. var i, len;
  7489. var sX;
  7490. var totalWidth;
  7491. sX = layout.x;
  7492. totalWidth = layout.width;
  7493. if (!poss) {
  7494. poss = [];
  7495. len = items.length;
  7496. var tValue;
  7497. for (i = 0; i < len; i++) {
  7498. tValue = items[i].x - sX;
  7499. if (isRate) {
  7500. tValue = tValue / totalWidth;
  7501. }
  7502. poss.push(tValue);
  7503. }
  7504. }
  7505. data.dLen = dLen;
  7506. data.poss = poss;
  7507. data.isRate = isRate;
  7508. return layout;
  7509. }
  7510. static clearItemsRelativeInfo(items) {
  7511. var i, len;
  7512. len = items.length;
  7513. for (i = 0; i < len; i++) {
  7514. LayoutFuns.clearItemRelativeInfo(items[i]);
  7515. }
  7516. }
  7517. static clearItemRelativeInfo(item) {
  7518. var Nan = "NaN";
  7519. item.left = Nan;
  7520. item.right = Nan;
  7521. }
  7522. static prepareForLayoutWidth(totalWidth, items) {
  7523. var i, len;
  7524. len = items.length;
  7525. for (i = 0; i < len; i++) {
  7526. LayoutFuns.prepareItemForLayoutWidth(totalWidth, items[i]);
  7527. }
  7528. }
  7529. static getSumWidth(items) {
  7530. var sum;
  7531. sum = 0;
  7532. var i, len;
  7533. len = items.length;
  7534. for (i = 0; i < len; i++) {
  7535. sum += items[i].width;
  7536. }
  7537. return sum;
  7538. }
  7539. static prepareItemForLayoutWidth(totalWidth, item) {
  7540. if (LayoutFuns.getItemRate(item) > 0) {
  7541. item.width = totalWidth * LayoutFuns.getItemRate(item);
  7542. }
  7543. }
  7544. static setItemRate(item, rate) {
  7545. item[LayoutFuns.RateSign] = rate;
  7546. }
  7547. static getItemRate(item) {
  7548. return item[LayoutFuns.RateSign] ? item[LayoutFuns.RateSign] : -1;
  7549. }
  7550. static setItemFreeSize(item, free = true) {
  7551. item[LayoutFuns.FreeSizeSign] = free;
  7552. }
  7553. static isItemFreeSize(item) {
  7554. return item[LayoutFuns.FreeSizeSign];
  7555. }
  7556. static lockedDis(totalWidth, items, data = null, sX = 0) {
  7557. var dists;
  7558. dists = data.dists;
  7559. var sumDis;
  7560. sumDis = data.sumDis;
  7561. var sumWidth;
  7562. var i, len;
  7563. var tItem;
  7564. var preItem;
  7565. LayoutFuns.prepareForLayoutWidth(totalWidth, items);
  7566. sumWidth = LayoutFuns.getSumWidth(items);
  7567. var dWidth;
  7568. dWidth = totalWidth - sumDis - sumWidth;
  7569. var freeItem;
  7570. freeItem = LayoutFuns.getFreeItem(items);
  7571. if (freeItem) {
  7572. freeItem.width += dWidth;
  7573. }
  7574. preItem = items[0];
  7575. preItem.x = sX;
  7576. len = items.length;
  7577. for (i = 1; i < len; i++) {
  7578. tItem = items[i];
  7579. tItem.x = preItem.x + preItem.width + dists[i - 1];
  7580. preItem = tItem;
  7581. }
  7582. }
  7583. static getFreeItem(items) {
  7584. var i, len;
  7585. len = items.length;
  7586. for (i = 0; i < len; i++) {
  7587. if (LayoutFuns.isItemFreeSize(items[i])) {
  7588. return items[i];
  7589. }
  7590. }
  7591. return null;
  7592. }
  7593. static getLockedDis(items) {
  7594. var data;
  7595. data = {};
  7596. var dists;
  7597. var i, len;
  7598. var tItem;
  7599. var preItem;
  7600. var sumDis;
  7601. sumDis = 0;
  7602. var tDis;
  7603. preItem = items[0];
  7604. dists = [];
  7605. len = items.length;
  7606. for (i = 1; i < len; i++) {
  7607. tItem = items[i];
  7608. tDis = tItem.x - preItem.x - preItem.width;
  7609. dists.push(tDis);
  7610. sumDis += tDis;
  7611. preItem = tItem;
  7612. }
  7613. data.dists = dists;
  7614. data.sumDis = sumDis;
  7615. return LayoutFuns.getLayouter(items, data, LayoutFuns.lockedDis);
  7616. }
  7617. }
  7618. LayoutFuns.RateSign = "layoutRate";
  7619. LayoutFuns.FreeSizeSign = "layoutFreeSize";
  7620. class AutoFillRec extends Laya.Sprite {
  7621. constructor(type) {
  7622. super();
  7623. }
  7624. set width(value) {
  7625. super.width = value;
  7626. this.changeSize();
  7627. }
  7628. set height(value) {
  7629. super.height = value;
  7630. this.changeSize();
  7631. }
  7632. changeSize() {
  7633. var g = this.graphics;
  7634. g.clear();
  7635. g.drawRect(0, 0, this.width, this.height, "#33c5f5");
  7636. }
  7637. record() {
  7638. this.preX = this.x;
  7639. this.preY = this.y;
  7640. }
  7641. getDx() {
  7642. return this.x - this.preX;
  7643. }
  7644. getDy() {
  7645. return this.y - this.preY;
  7646. }
  7647. }
  7648. class DisResizer {
  7649. constructor() {
  7650. }
  7651. static init() {
  7652. if (DisResizer._up)
  7653. return;
  7654. DisResizer._up = new AutoFillRec("T");
  7655. DisResizer._up.height = DisResizer.barWidth;
  7656. DisResizer._up.type = DisResizer.Horizon;
  7657. DisResizer._down = new AutoFillRec("T");
  7658. DisResizer._down.height = DisResizer.barWidth;
  7659. DisResizer._down.type = DisResizer.Horizon;
  7660. DisResizer._left = new AutoFillRec("R");
  7661. DisResizer._left.width = DisResizer.barWidth;
  7662. DisResizer._left.type = DisResizer.Vertical;
  7663. DisResizer._right = new AutoFillRec("R");
  7664. DisResizer._right.width = DisResizer.barWidth;
  7665. DisResizer._right.type = DisResizer.Vertical;
  7666. DisResizer._barList = [DisResizer._up, DisResizer._down, DisResizer._left, DisResizer._right];
  7667. DisResizer.addEvent();
  7668. }
  7669. static stageDown(e) {
  7670. var target;
  7671. target = e.target;
  7672. if (DisResizer._tar && DisControlTool.isInTree(DisResizer._tar, target)) {
  7673. return;
  7674. }
  7675. DisResizer.clear();
  7676. }
  7677. static clear() {
  7678. DisResizer._tar = null;
  7679. Laya.Laya.stage.off(Laya.Event.MOUSE_UP, null, DisResizer.stageDown);
  7680. DisControlTool.removeItems(DisResizer._barList);
  7681. DisResizer.clearDragEvents();
  7682. }
  7683. static addEvent() {
  7684. var i, len;
  7685. var tBar;
  7686. len = DisResizer._barList.length;
  7687. for (i = 0; i < len; i++) {
  7688. tBar = DisResizer._barList[i];
  7689. tBar.on(Laya.Event.MOUSE_DOWN, null, DisResizer.barDown);
  7690. }
  7691. }
  7692. static barDown(e) {
  7693. DisResizer.clearDragEvents();
  7694. DisResizer.tBar = e.target;
  7695. if (!DisResizer.tBar)
  7696. return;
  7697. var area;
  7698. area = new Laya.Rectangle();
  7699. if (DisResizer.tBar.type == DisResizer.Horizon) {
  7700. area.x = DisResizer.tBar.x;
  7701. area.width = 0;
  7702. area.y = DisResizer.tBar.y - 200;
  7703. area.height = 400;
  7704. }
  7705. else {
  7706. area.x = DisResizer.tBar.x - 200;
  7707. area.width = 400;
  7708. area.y = 0;
  7709. area.height = 0;
  7710. }
  7711. var option;
  7712. option = {};
  7713. option.area = area;
  7714. DisResizer.tBar.record();
  7715. DisResizer.tBar.startDrag(area);
  7716. DisResizer.tBar.on(Laya.Event.DRAG_MOVE, null, DisResizer.draging);
  7717. DisResizer.tBar.on(Laya.Event.DRAG_END, null, DisResizer.dragEnd);
  7718. }
  7719. static draging(e) {
  7720. console.log("draging");
  7721. if (!DisResizer.tBar)
  7722. return;
  7723. if (!DisResizer._tar)
  7724. return;
  7725. switch (DisResizer.tBar) {
  7726. case DisResizer._left:
  7727. DisResizer._tar.x += DisResizer.tBar.getDx();
  7728. DisResizer._tar.width -= DisResizer.tBar.getDx();
  7729. DisResizer._up.width -= DisResizer.tBar.getDx();
  7730. DisResizer._down.width -= DisResizer.tBar.getDx();
  7731. DisResizer._right.x -= DisResizer.tBar.getDx();
  7732. DisResizer.tBar.x -= DisResizer.tBar.getDx();
  7733. break;
  7734. case DisResizer._right:
  7735. DisResizer._tar.width += DisResizer.tBar.getDx();
  7736. DisResizer._up.width += DisResizer.tBar.getDx();
  7737. DisResizer._down.width += DisResizer.tBar.getDx();
  7738. break;
  7739. case DisResizer._up:
  7740. DisResizer._tar.y += DisResizer.tBar.getDy();
  7741. DisResizer._tar.height -= DisResizer.tBar.getDy();
  7742. DisResizer._right.height -= DisResizer.tBar.getDy();
  7743. DisResizer._left.height -= DisResizer.tBar.getDy();
  7744. DisResizer._down.y -= DisResizer.tBar.getDy();
  7745. DisResizer.tBar.y -= DisResizer.tBar.getDy();
  7746. break;
  7747. case DisResizer._down:
  7748. DisResizer._tar.height += DisResizer.tBar.getDy();
  7749. DisResizer._right.height += DisResizer.tBar.getDy();
  7750. DisResizer._left.height += DisResizer.tBar.getDy();
  7751. break;
  7752. }
  7753. DisResizer.tBar.record();
  7754. }
  7755. static dragEnd(e) {
  7756. console.log("dragEnd");
  7757. DisResizer.clearDragEvents();
  7758. DisResizer.updates();
  7759. }
  7760. static clearDragEvents() {
  7761. if (!DisResizer.tBar)
  7762. return;
  7763. DisResizer.tBar.off(Laya.Event.DRAG_MOVE, null, DisResizer.draging);
  7764. DisResizer.tBar.off(Laya.Event.DRAG_END, null, DisResizer.dragEnd);
  7765. }
  7766. static setUp(dis, force = false) {
  7767. if (force && dis == DisResizer._tar) {
  7768. return;
  7769. }
  7770. DisControlTool.removeItems(DisResizer._barList);
  7771. if (DisResizer._tar == dis) {
  7772. DisResizer._tar = null;
  7773. DisResizer.clearDragEvents();
  7774. if (!force)
  7775. return;
  7776. }
  7777. DisResizer._tar = dis;
  7778. DisResizer.updates();
  7779. DisControlTool.addItems(DisResizer._barList, dis);
  7780. Laya.Laya.stage.off(Laya.Event.MOUSE_UP, null, DisResizer.stageDown);
  7781. Laya.Laya.stage.on(Laya.Event.MOUSE_UP, null, DisResizer.stageDown);
  7782. }
  7783. static updates() {
  7784. var dis;
  7785. dis = DisResizer._tar;
  7786. if (!dis)
  7787. return;
  7788. var bounds;
  7789. bounds = new Laya.Rectangle(0, 0, dis.width, dis.height);
  7790. DisResizer._up.x = bounds.x;
  7791. DisResizer._up.y = bounds.y;
  7792. DisResizer._up.width = bounds.width;
  7793. DisResizer._down.x = bounds.x;
  7794. DisResizer._down.y = bounds.y + bounds.height - DisResizer.barWidth;
  7795. DisResizer._down.width = bounds.width;
  7796. DisResizer._left.x = bounds.x;
  7797. DisResizer._left.y = bounds.y;
  7798. DisResizer._left.height = bounds.height;
  7799. DisResizer._right.x = bounds.x + bounds.width - DisResizer.barWidth;
  7800. DisResizer._right.y = bounds.y;
  7801. DisResizer._right.height = bounds.height;
  7802. }
  7803. }
  7804. DisResizer.Side = 2;
  7805. DisResizer.Vertical = 1;
  7806. DisResizer.Horizon = 0;
  7807. DisResizer.barWidth = 2;
  7808. DisResizer.useGetBounds = false;
  7809. DisControlTool.resizeHandler = DisResizer.setUp;
  7810. class StyleConsts {
  7811. constructor() {
  7812. }
  7813. static setViewScale(view) {
  7814. view.scaleX = view.scaleY = StyleConsts.PanelScale;
  7815. }
  7816. }
  7817. StyleConsts.PanelScale = Laya.Browser.onPC ? 1 : Laya.Browser.pixelRatio;
  7818. exports.Arrow = Arrow;
  7819. exports.ArrowLine = ArrowLine;
  7820. exports.AtlasTools = AtlasTools;
  7821. exports.AutoFillRec = AutoFillRec;
  7822. exports.AutoSizeRec = AutoSizeRec;
  7823. exports.Axis = Axis;
  7824. exports.Base64Atlas = Base64Atlas;
  7825. exports.Base64AtlasManager = Base64AtlasManager;
  7826. exports.Base64ImageTool = Base64ImageTool;
  7827. exports.Base64Tool = Base64Tool;
  7828. exports.ByteEx = ByteEx;
  7829. exports.CacheAnalyser = CacheAnalyser;
  7830. exports.CallLaterTool = CallLaterTool;
  7831. exports.CanvasTools = CanvasTools;
  7832. exports.ClassCreateHook = ClassCreateHook;
  7833. exports.ClassTool = ClassTool;
  7834. exports.ClickSelectTool = ClickSelectTool;
  7835. exports.ColorTool = ColorTool;
  7836. exports.CommonTools = CommonTools;
  7837. exports.CountTool = CountTool;
  7838. exports.DButton = DButton;
  7839. exports.DInput = DInput;
  7840. exports.DTrace = DTrace;
  7841. exports.DebugConsts = DebugConsts;
  7842. exports.DebugInfoLayer = DebugInfoLayer;
  7843. exports.DebugPanel = DebugPanel;
  7844. exports.DebugTool = DebugTool;
  7845. exports.DebugTxt = DebugTxt;
  7846. exports.DifferTool = DifferTool;
  7847. exports.DisControlTool = DisControlTool;
  7848. exports.DisController = DisController;
  7849. exports.DisEditor = DisEditor;
  7850. exports.DisPool = DisPool;
  7851. exports.DisResizer = DisResizer;
  7852. exports.DisplayHook = DisplayHook;
  7853. exports.DivScripts = DivScripts;
  7854. exports.DragBox = DragBox;
  7855. exports.FilterTool = FilterTool;
  7856. exports.FunHook = FunHook;
  7857. exports.FunctionTimeHook = FunctionTimeHook;
  7858. exports.GetSetProfile = GetSetProfile;
  7859. exports.IDTools = IDTools;
  7860. exports.JSTools = JSTools;
  7861. exports.JsonTool = JsonTool;
  7862. exports.LayoutFuns = LayoutFuns;
  7863. exports.LayoutTools = LayoutTools;
  7864. exports.Layouter = Layouter;
  7865. exports.LoaderHook = LoaderHook;
  7866. exports.MathTools = MathTools;
  7867. exports.MouseEventAnalyser = MouseEventAnalyser;
  7868. exports.NodeConsts = NodeConsts;
  7869. exports.NodeInfoPanel = NodeInfoPanel;
  7870. exports.NodeInfosItem = NodeInfosItem;
  7871. exports.NodeRecInfo = NodeRecInfo;
  7872. exports.NodeUtils = NodeUtils;
  7873. exports.Notice = Notice;
  7874. exports.ObjTimeCountTool = ObjTimeCountTool;
  7875. exports.ObjectTools = ObjectTools;
  7876. exports.Observer = Observer;
  7877. exports.ReCacheRecInfo = ReCacheRecInfo;
  7878. exports.RecInfo = RecInfo;
  7879. exports.Rect = Rect;
  7880. exports.RenderAnalyser = RenderAnalyser;
  7881. exports.RenderSpriteHook = RenderSpriteHook;
  7882. exports.ResTools = ResTools;
  7883. exports.RunProfile = RunProfile;
  7884. exports.SimpleResizer = SimpleResizer;
  7885. exports.SingleTool = SingleTool;
  7886. exports.SpriteRenderHook = SpriteRenderHook;
  7887. exports.StringTool = StringTool;
  7888. exports.StyleConsts = StyleConsts;
  7889. exports.TimeTool = TimeTool;
  7890. exports.TimerControlTool = TimerControlTool;
  7891. exports.TouchDebugTools = TouchDebugTools;
  7892. exports.TraceTool = TraceTool;
  7893. exports.UVTools = UVTools;
  7894. exports.ValueChanger = ValueChanger;
  7895. exports.VarHook = VarHook;
  7896. exports.VisibleAnalyser = VisibleAnalyser;
  7897. exports.WalkTools = WalkTools;
  7898. exports.Watch = Watch;
  7899. exports.Watcher = Watcher;
  7900. exports.XML2Object = XML2Object;
  7901. exports.XML2ObjectNodejs = XML2ObjectNodejs;
  7902. }(window.Laya = window.Laya || {}, Laya));