bundle.js 184 KB

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