bundle.js 173 KB

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