bundle.js 178 KB

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