bundle.js 70 KB

1
  1. !function(){"use strict";class e{constructor(){}static init(){Laya.ClassUtils.regClass}}e.width=720,e.height=1280,e.scaleMode="fixedwidth",e.screenMode="none",e.alignV="top",e.alignH="left",e.startScene="LoadView.scene",e.sceneRoot="",e.debug=!1,e.stat=!1,e.physicsDebug=!1,e.exportSceneToJson=!1,e.init();var t,i,a;Laya.Vector3;class n{constructor(){n.ins=this}static get Instance(){return n.ins?n.ins:new n}lerp(e,t,i){return i<=0?e:i>=1?t:i*t+(1-i)*e}SetCollider(e,t){e.numChildren;for(var i=0;i<e.numChildren;i++){e.getChildAt(i).numChildren>1&&this.SetCollider(e.getChildAt(i),t);var a=e.getChildAt(i).getComponent(Laya.PhysicsCollider);a&&(a.collisionGroup=t)}}EnemySetCollider(e,t){var i=e.getChildByName("npcfrontcollider"),a=e.getChildByName("npcrearcollider"),n=i.getComponent(Laya.PhysicsCollider),s=a.getComponent(Laya.PhysicsCollider);n&&(n.collisionGroup=t),s&&(s.collisionGroup=t)}PlayerSetCollider(e,t){var i=e.getChildByName("playercollider").getComponent(Laya.PhysicsCollider);i&&(i.collisionGroup=t)}HostageSetCollider(e,t){var i=e.getChildByName("hostagecollider").getComponent(Laya.PhysicsCollider);i&&(i.collisionGroup=t)}static RandomNumber(e,t){if(e>=t)return 0;var i=t-e;return Math.random()*i+e}static RandomANumber(e,t){if(e>=t)return 0;var i=t-e,a=Math.random()*i+e;return Math.floor(a)}static GetMoney(e,t=null,i=null){if(0!=e){var a=new Laya.Box;a.width=400,a.height=100,a.pivotX=a.width/2,a.pivotY=a.height/2,null==t&&(t=new Laya.Vector2(Laya.stage.width/2,Laya.stage.height/2)),a.pos(t.x,t.y);var n=new Laya.Image;n.skin="game/qiandao_1_7.png",n.width=60,n.height=60,n.left=50,n.y=10,a.addChild(n);var s=new Laya.Text;s.width=300,s.height=50,s.align="center",s.valign="middle",s.font="Microsoft YaHei",s.fontSize=40,s.color="#FFFFFF",s.bold=!0,s.font="Microsoft YaHei",s.text="金币 +"+e,s.x=60,s.y=10,a.addChild(s),Laya.stage.addChild(a);var o=Laya.Tween.to(a,{y:a.y-200},1500,Laya.Ease.expoInOut,Laya.Handler.create(this,()=>{o.clear(),a.destroy(),i&&i.run()}),100)}}static TweenText(e,t,i=null,a=!0,n=500){var s=new Laya.Text;s.width=e.size.x,s.height=e.size.y,s.align="center",s.valign="middle",s.font="Microsoft YaHei",s.fontSize=e.fontSize,s.pivotX=s.width/2,s.pivotY=s.height/2,s.color="#5ad122",s.bold=!0,s.stroke=5,s.strokeColor="#ffffff",e.color&&(e.color=e.color),s.text=e.message,s.zOrder=1,Laya.stage.addChildAt(s,Laya.stage.numChildren-1),s.pos(e.pos.x,e.pos.y);var o=Laya.Tween.to(s,{y:s.y-t,update:new Laya.Handler(this,function(){})},n,Laya.Ease.expoInOut,Laya.Handler.create(this,function(){o.clear(),a&&s.destroy(),i&&i.run()}));return a&&Laya.Tween.to(s,{alpha:.4},500),s}static StationTweenText(e,t,i=null,a=!0,n=500){var s=new Laya.Text;s.width=e.size.x,s.height=e.size.y,s.align="center",s.valign="middle",s.font="Microsoft YaHei",s.fontSize=50,s.pivotX=s.width/2,s.pivotY=s.height/2,s.color="#5ad122",s.bold=!0,s.stroke=5,s.strokeColor="#ffffff",e.color&&(e.color=e.color),s.text=e.message,s.zOrder=1,Laya.stage.addChildAt(s,Laya.stage.numChildren-1),s.pos(e.pos.x,e.pos.y);var o=Laya.Tween.to(s,{y:s.y-t,update:new Laya.Handler(this,function(){})},n,Laya.Ease.expoInOut,Laya.Handler.create(this,function(){o.clear(),a&&s.destroy(),i&&i.run()}));return a&&Laya.Tween.to(s,{alpha:.4},1e4),s}static tweenMove(e,t,i,a,n){let s=e.position.clone();return Laya.Tween.to(s,{x:t.x,y:t.y,z:t.z,update:new Laya.Handler(this,()=>{e.position=s.clone()})},i,a,n)}static tweenRotate(e,t,i,a,n){let s=e.rotationEuler.clone();return Laya.Tween.to(s,{x:t.x,y:t.y,z:t.z,update:new Laya.Handler(this,()=>{e.rotationEuler=s.clone()})},i,a,n)}}!function(e){e[e.LoadComplete=0]="LoadComplete",e[e.SceneInit=1]="SceneInit",e[e.StageInit=2]="StageInit",e[e.ShowModel=3]="ShowModel"}(t||(t={})),function(e){e[e.Win=0]="Win",e[e.Lose=1]="Lose",e[e.Start=2]="Start",e[e.BackMain=3]="BackMain",e[e.StageCreateComPlete=4]="StageCreateComPlete",e[e.Over=5]="Over",e[e.Pause=6]="Pause",e[e.Resume=7]="Resume",e[e.RefreshPro=8]="RefreshPro"}(i||(i={})),function(e){e[e.Die=0]="Die",e[e.Sky=1]="Sky",e[e.OnLand=2]="OnLand",e[e.Land=3]="Land",e[e.Arriver=4]="Arriver"}(a||(a={}));class s{static EventOn(e,i,a,n=[]){s.instance.on(t[e],i,a,n)}static EventOff(e,i,a,n=[]){s.instance.off(t[e],i,a)}static EventTrigger(e,i=[]){s.instance.event(t[e],i)}static StageOn(e,t,a,n=[]){s.instance.on(i[e],t,a,n)}static StageOff(e,t,a,n=[]){s.instance.off(i[e],t,a)}static StageTrigger(e,t=[]){s.instance.event(i[e],t)}}s.instance=new Laya.EventDispatcher;class o{constructor(){this._items={},this.length=0}get container(){return this._items}has(e){return this._items.hasOwnProperty(e)}set(e,t){this.has(e)||this.length++,this._items[e]=t}delete(e){let t=null;return this.has(e)&&(t=this._items[e],delete this._items[e],this.length--),t}get(e){return this.has(e)?this._items[e]:null}values(){let e=[];for(let t in this._items)this.has(t)&&e.push(this._items[t]);return e}keys(){let e=[];for(let t in this._items)this.has(t)&&e.push(t);return e}clear(){this._items={},this.length=0}}class r{static GetChild(e,t){let i=[];for(let t=0;t<e.numChildren;t++)i.push(e.getChildAt(t));for(;i.length>0;){let e=i.shift();if(t(e))return e;for(let t=0;t<e.numChildren;t++)i.push(e.getChildAt(t))}return null}static GetChildByName(e,t){return r.GetChild(e,e=>e.name==t)}static getChildren(e,t){let i=[],a=[];for(let t=0;t<e.numChildren;t++)a.push(e.getChildAt(t));for(;a.length>0;){let e=a.shift();t(e)&&i.push(e);for(let t=0;t<e.numChildren;t++)a.push(e.getChildAt(t))}return i}static SetColliderInactive(e){r.getChildren(e,e=>e.getComponent(Laya.PhysicsCollider)).forEach(e=>{let t=e.getComponent(Laya.PhysicsCollider);t&&(t.enabled=!1)},this)}static SetColliderGroup(e,t){r.getChildren(e,e=>e.getComponent(Laya.PhysicsCollider)).forEach(e=>{let i=t;e.getComponent(Laya.PhysicsCollider).collisionGroup=i},this)}}r.All=Laya.Physics3DUtils.COLLISIONFILTERGROUP_ALLFILTER,r.Body=Laya.Physics3DUtils.COLLISIONFILTERGROUP_CUSTOMFILTER1,r.Head=Laya.Physics3DUtils.COLLISIONFILTERGROUP_CUSTOMFILTER2,r.Citizen=Laya.Physics3DUtils.COLLISIONFILTERGROUP_CUSTOMFILTER3;class h{static getForward(e){let t=new Laya.Vector3;return e.getForward(t),Laya.Vector3.scale(t,-1,t),Laya.Vector3.normalize(t,t),t}}class l{}l.Yan="yan",l.YanHua="yanhua",l.Nail1="Nail1",l.Nail2="Nail2",l.Nail3="Nail3",l.Nail4="Nail4",l.Nail5="Nail5",l.Nail6="Nail6",l.Nail7="Nail7",l.Coin="Coin",l.FinishCircle="FinishCircle",l.Speed="speed",l.Ramp="Ramp",l.mainscene="subpackage/res/mainscene/LayaScene_mainscene/Conventional/mainscene.ls",l.Character=["subpackage2/res/gameresources/LayaScene_gameresources/Conventional/Character1.lh","subpackage2/res/gameresources/LayaScene_gameresources/Conventional/Character2.lh","subpackage2/res/gameresources/LayaScene_gameresources/Conventional/Character3.lh","subpackage2/res/gameresources/LayaScene_gameresources/Conventional/Character4.lh"],l.Prop=["subpackage2/res/gameresources/LayaScene_gameresources/Conventional/FinishCircle.lh","subpackage2/res/gameresources/LayaScene_gameresources/Conventional/FinishCircle2.lh","subpackage2/res/gameresources/LayaScene_gameresources/Conventional/Nail1.lh","subpackage2/res/gameresources/LayaScene_gameresources/Conventional/Nail2.lh","subpackage2/res/gameresources/LayaScene_gameresources/Conventional/Nail3.lh","subpackage2/res/gameresources/LayaScene_gameresources/Conventional/Nail4.lh","subpackage2/res/gameresources/LayaScene_gameresources/Conventional/Nail5.lh","subpackage2/res/gameresources/LayaScene_gameresources/Conventional/Nail6.lh","subpackage2/res/gameresources/LayaScene_gameresources/Conventional/Nail7.lh","subpackage2/res/gameresources/LayaScene_gameresources/Conventional/yan.lh","subpackage2/res/gameresources/LayaScene_gameresources/Conventional/yanhua.lh","subpackage2/res/gameresources/LayaScene_gameresources/Conventional/flag.lh","subpackage2/res/gameresources/LayaScene_gameresources/Conventional/Coin.lh","subpackage2/res/gameresources/LayaScene_gameresources/Conventional/Ramp.lh","subpackage2/res/gameresources/LayaScene_gameresources/Conventional/speed.lh"],l.fogcolor=[new Laya.Vector3(.5803922,.8431373,1),new Laya.Vector3(216/255,142/255,247/255),new Laya.Vector3(180/255,1,217/255)];var c,p,d=Laya.Vector3;class g extends Laya.Script3D{constructor(){super(),this._hitres=new Laya.HitResult,this.crash=!1,this._hitres2=new Laya.HitResult}onAwake(){this._gameobject=this.owner}onStart(){var e=new d(this._gameobject.transform.position.x,this._gameobject.transform.position.y,this._gameobject.transform.position.z);let t=new Laya.Vector3(0,1,0);var i=new Laya.Ray(e,t);if(E.Instance.mainscene.physicsSimulation.rayCast(i,this._hitres,1)){if(2==this._hitres.collider.collisionGroup){let e=this._hitres.collider.owner.parent;if(this.crash){r.SetColliderInactive(this._gameobject);let e=E.Instance.getPref(l.Yan),t=Laya.Sprite3D.instantiate(e);D.Instance.spritepool.addChild(t),t.transform.position=this._gameobject.transform.position.clone(),t.transform.scale=new Laya.Vector3(.5,.5,.5),this.destroy(),this._gameobject.destroy()}else this.FallDown();e.addComponent(g)}}else if(this.crash){r.SetColliderInactive(this._gameobject);let e=E.Instance.getPref(l.Yan),t=Laya.Sprite3D.instantiate(e);D.Instance.spritepool.addChild(t),t.transform.position=this._gameobject.transform.position.clone(),t.transform.scale=new Laya.Vector3(.5,.5,.5),this.destroy(),this._gameobject.destroy()}}onUpdate(){if(this.crash){r.SetColliderInactive(this._gameobject);let e=E.Instance.getPref(l.Yan),t=Laya.Sprite3D.instantiate(e);return D.Instance.spritepool.addChild(t),t.transform.position=this._gameobject.transform.position.clone(),t.transform.scale=new Laya.Vector3(.5,.5,.5),this.destroy(),void this._gameobject.destroy()}this.Down()}Crash(){r.SetColliderInactive(this._gameobject);let e=E.Instance.getPref(l.Yan),t=Laya.Sprite3D.instantiate(e);D.Instance.spritepool.addChild(t),t.transform.position=this._gameobject.transform.position.clone(),t.transform.scale=new Laya.Vector3(.5,.5,.5),this.destroy(),this._gameobject.destroy()}FallDown(){Laya.timer.loop(1,this,this.Down)}Down(){var e=new d(this._gameobject.transform.position.x,this._gameobject.transform.position.y+.1,this._gameobject.transform.position.z);let t=new Laya.Vector3(0,-.1,0);var i=new Laya.Ray(e,t);if(E.Instance.mainscene.physicsSimulation.rayCast(i,this._hitres2,.2))if(null==this._hitres2||1!=this._hitres2.collider.collisionGroup&&2!=this._hitres2.collider.collisionGroup){let e=this._gameobject.transform.position.y-=.03;this._gameobject.transform.position=new Laya.Vector3(this._gameobject.transform.position.x,e,this._gameobject.transform.position.z)}else Laya.timer.clear(this,this.Down);else{let e=this._gameobject.transform.position.y-=.03;this._gameobject.transform.position=new Laya.Vector3(this._gameobject.transform.position.x,e,this._gameobject.transform.position.z)}}}!function(e){e[e.crashrole=0]="crashrole",e[e.crashwall=1]="crashwall",e[e.win=2]="win",e[e.lose=3]="lose",e[e.fly=4]="fly",e[e.speedup=5]="speedup",e[e.coin=6]="coin"}(c||(c={})),function(e){e[e.bgm=0]="bgm"}(p||(p={}));class m{static voiceres(e){return"subpackage2/res/music/"+c[e]+".mp3"}static bgmres(e){return"subpackage2/res/music/"+p[e]+".mp3"}static ClearAudio(){Laya.SoundManager.stopAllSound()}static StopMusic(){Laya.SoundManager.stopMusic()}static PlayBGM(e){this.play&&(Laya.SoundManager.playMusic(this.bgmres(e),0),Laya.SoundManager.musicVolume=.5)}static PlayVoice(e,t=!1){if(this.play){var i=t?0:1;Laya.SoundManager.playSound(this.voiceres(e),i)}}}m.play=!0;class u extends Laya.Script3D{constructor(){super()}onAwake(){this._gameobject=this.owner,Laya.timer.loop(1,this,this.Rotate)}OnTouch(){m.PlayVoice(c.coin),Laya.timer.clear(this,this.Rotate),this.destroy()}Rotate(){this._gameobject.transform.rotate(new Laya.Vector3(0,.05,0))}}var y=Laya.Vector3,f=Laya.Quaternion;class w extends Laya.Script3D{constructor(){super(),this._speed=.2,this.testspeed=.3,this.Tag_Head=!1,this.start=!1,this.isdead=!1,this.geted=!1,this._arriver=!1,this._destination=!1,this.GravityTime=0,this.ChargeSpeed=0,this.ChargeTime=0,this.Downhit=new Laya.HitResult,this.FowardHit=new Laya.HitResult,this._forward=new y(0,0,0),this._up=new y(0,1,0),this.CanJump=!1,this.JumpTime=0,this.JumpSpeed=.3,this.JumpSpeedUp=1,this.targetPos=new y(0,0,0),this.forW=new y(0,0,0),this.RoleList=[],this.MovePointList=[],this.MoveRotateList=[],this._foward=new Laya.Vector3(0,0,0),this._MovetarPos=new Laya.Vector3(0,0,0),this.curpos2=new y,this.offest2=new y,this.curspeed2=0,this.curpos=new y,this.offest=new y,this.curspeed=0,s.StageOn(i.Start,this,this.GameStart)}onAwake(){this._gameobject=this.owner,this._transform=this._gameobject.transform,this._quaternion=new f,this._animator=this._gameobject.getComponent(Laya.Animator)}onUpdate(){if(this.start){if(this.isdead)return this.RoleDie(),void this.ChangeState(a.Die);if(!this._destination){if(this.Tag_Head){if(this.RefreshUI(),this.DownRayCheck){if(this.curstate==a.OnLand)this._gameobject.transform.position=new y(this._gameobject.transform.position.x,this.Downhit.point.y,this._gameobject.transform.position.z),"speed"==this.Downhit.collider.owner.parent.name?(m.PlayVoice(c.speedup),this.SpeedUp(.6,.1)):"Ramp"==this.Downhit.collider.owner.parent.name&&(m.PlayVoice(c.fly),this.SpeedUp(.3,.2),this.Jump());else if(this.curstate==a.Sky){if(this._gameobject.transform.position.y-this.Downhit.point.y<.5){var e=new y(this._gameobject.transform.position.x,this.Downhit.point.y,this._gameobject.transform.position.z);y.lerp(this._gameobject.transform.position,e,.3,e),this._gameobject.transform.position=e,this.ChangeState(a.OnLand)}}}else this.ChangeState(a.Sky);this.FowardRayCheck;let t=h.getForward(this._gameobject.transform);this.Move(t),this.Gravity()}else{if(!this.geted)return;if(this._arriver){if(this.DownRayCheck){if(this.curstate==a.OnLand)this._gameobject.transform.position=new y(this._gameobject.transform.position.x,this.Downhit.point.y,this._gameobject.transform.position.z);else if(this.curstate==a.Sky){if(this._gameobject.transform.position.y-this.Downhit.point.y<.5){e=new y(this._gameobject.transform.position.x,this.Downhit.point.y,this._gameobject.transform.position.z);y.lerp(this._gameobject.transform.position,e,.3,e),this._gameobject.transform.position=e,this.ChangeState(a.OnLand)}}}else this.ChangeState(a.Sky);this.RoleMoveFun(),this.Gravity()}else this.MoveToGroup()}this._gameobject.transform.position.y<-15&&this.FallDown()}}}RefreshUI(){let e=L.Instance.RefreshPro(),t=this.RoleList.length,a={};a.pre=e,a.count=t,s.StageTrigger(i.RefreshPro,[a])}GameStart(){this.start=!0,this.Tag_Head&&this.ChangeState(a.OnLand),Laya.timer.loop(2,this,this.SetNewMovePoint,[this._transform])}Start(e){this.geted||(this.targetmodel=e.getChildByName("followpos"),this.geted=!0,this.ChangeState(a.OnLand))}ChangeState(e){if(this.curstate!=e)switch(this.curstate=e,this.curstate){case a.Die:this.DIE();break;case a.Sky:this.SKY();break;case a.OnLand:this.ONLAND();break;case a.Arriver:this.ARRIVER()}}ONLAND(){this.Tag_Head?(this._animator.play("run"),this._animator.speed=2):this.geted?(this._animator.play("run"),this._animator.speed=2):this._animator.play("idle")}SKY(){this._animator.play("sky")}ARRIVER(){if(this._destination=!0,Laya.timer.clear(this,this.SetNewMovePoint),this._animator.play("win"),this.Tag_Head){O.Instance.GameWin();for(let e=0;e<this.RoleList.length;e++){let t=this.RoleList[e].getComponent(w);t&&t.ARRIVER()}}}DIE(){Laya.timer.clear(this,this.SetNewMovePoint),this._gameobject.active=!1,this.Tag_Head&&0==this.RoleList.length&&O.Instance.GameLose(),this.destroy()}FallDown(){Laya.timer.clear(this,this.SetNewMovePoint),O.Instance.GameLose(),m.PlayVoice(c.lose),j.Shake(!0),this.destroy()}SetMoveTarger(e,t){e&&(this._MovetarPos=e,this._gameobject.transform.position=this._MovetarPos.clone(),this._gameobject.transform.rotationEuler=t.clone(),this.MovePointList.push(e),this.MovePointList.length>100&&this.MovePointList.shift(),this.MoveRotateList.push(t),this.MoveRotateList.length>100&&this.MoveRotateList.shift())}RoleMoveFun(){f.lookAt(this._MovetarPos,this._transform.position,this._up,this._quaternion),this._quaternion.invert(this._quaternion),f.slerp(this._transform.rotation,this._quaternion,.1,this._quaternion),this._transform.rotation=this._quaternion.clone();let e=this._transform.rotationEuler.clone();e.x=0,e.z=0,this._transform.rotationEuler=e}SetNewMovePoint(e){if(this.Tag_Head){var t=e.position.clone(),i=new Laya.Vector3(t.x,t.y,t.z),a=e.rotationEuler.clone();this.MovePointList.push(i),this.MovePointList.length>200&&this.MovePointList.shift(),this.MoveRotateList.push(a),this.MoveRotateList.length>200&&this.MoveRotateList.shift();for(let e=0;e<this.RoleList.length;e++){var n=this.RoleList[e].getComponent(w);if(n){var s=this.MovePointList.length-1-10*(e+1);n.SetMoveTarger(this.MovePointList[s],this.MoveRotateList[s])}}}}RoleDie(){if(0!=this.RoleList.length){var e=this.RoleList[0].getComponent(w);if(e){e._gameobject.transform.rotationEuler=this._gameobject.transform.rotationEuler.clone(),e.Tag_Head=!0,L.Instance.player=e._gameobject,e.RoleList=[];for(let t=1;t<this.RoleList.length;t++)e.RoleList.push(this.RoleList[t])}}}MoveToGroup(){this.targetPos=this.targetmodel.transform.position;let e=this.targetPos;y.subtract(e,this._transform.position,this._forward),y.normalize(this._forward,this._forward),this._forward=new y(.05*this._forward.x,.05*this._forward.y,.05*this._forward.z),this._transform.translate(this._forward,!1),y.distance(this._transform.position,e)<.1?this.ArriverTargetPos():(f.lookAt(e,this._transform.position,this._up,this._quaternion),this._quaternion.invert(this._quaternion),f.slerp(this._transform.rotation,this._quaternion,.1,this._quaternion),this._transform.rotation=this._quaternion.clone())}Move(e){let t=this.testspeed;if(this.ChargeTime>0?(this.ChargeTime-=.01,t+=this.ChargeSpeed):(this.ChargeSpeed=n.Instance.lerp(this.ChargeSpeed,0,.1),t+=this.ChargeSpeed,this.ChargeTime=0),this.curspeed=n.Instance.lerp(this.curspeed,t,.1),y.scale(e,this.curspeed,this.offest),y.add(this._gameobject.transform.position,this.offest,this.curpos),y.lerp(this._gameobject.transform.position,this.curpos,.15,this.curpos),this.CanJump){this.JumpTime+=.8;var i=this.JumpSpeed*this.JumpTime*1.9-this.JumpTime*this.JumpTime*this.JumpSpeedUp;i>0?this.curpos=new y(this.curpos.x,this.curpos.y+i,this.curpos.z):this.CanJump=!1,this.curpos=new y(this.curpos.x,this.curpos.y+.8,this.curpos.z),this._gameobject.transform.position=this.curpos}else this.curpos=new y(this.curpos.x,this.curpos.y,this.curpos.z),this._gameobject.transform.position=this.curpos}ArriverTargetPos(){this._gameobject.transform.position=this.targetmodel.transform.position.clone(),this._gameobject.transform.rotationEuler=this.targetmodel.transform.rotationEuler.clone(),this._arriver=!0}get DownRayCheck(){var e=new y(this._gameobject.transform.position.x,this._gameobject.transform.position.y+.1,this._gameobject.transform.position.z);let t=new Laya.Vector3(0,-1,0);var i=new Laya.Ray(e,t),a=!1;return E.Instance.mainscene.physicsSimulation.rayCast(i,this.Downhit,1)&&null!=this.Downhit&&1==this.Downhit.collider.collisionGroup&&(a=!0),a}get FowardRayCheck(){var e=!1,t=new y(this._gameobject.transform.position.x,this._gameobject.transform.position.y+.1,this._gameobject.transform.position.z);let i=h.getForward(this._gameobject.transform);var n=new Laya.Ray(t,i);if(E.Instance.mainscene.physicsSimulation.rayCast(n,this.FowardHit,.1))if(this.FowardHit&&(console.log(this.FowardHit.collider.owner.parent.name),console.log("前方有物体")),100==this.FowardHit.collider.collisionGroup){console.log("射线打到npc了"),this.ForwardTarget=this.FowardHit.collider,e=!0;let t=this.FowardHit.collider.owner.parent.getComponent(w);if(t){let e;e=this.RoleList.length>0?this.RoleList[this.RoleList.length-1]:this._gameobject,t.Start(e);let i=this.FowardHit.collider.owner.parent;this.JudgeEqual(i)||this.RoleList.push(i)}m.PlayVoice(c.crashrole),j.Shake()}else if(2==this.FowardHit.collider.collisionGroup){this.isdead=!0;let e=this.FowardHit.collider.owner.parent,t=e.getComponent(g);t?t.Crash():(t=e.addComponent(g)).crash=!0,m.PlayVoice(c.crashwall),j.Shake()}else 3==this.FowardHit.collider.collisionGroup?this.Crash():200==this.FowardHit.collider.collisionGroup&&(this.ChangeState(a.Arriver),m.PlayVoice(c.win),j.Shake(!0));return e}Crash(){let e=this.FowardHit.collider.owner.parent;switch(e.name){case"Ramp":m.PlayVoice(c.fly),this.SpeedUp(.8,.3),this.Jump();break;case"Coin":let t=e.getComponent(u);t&&t.OnTouch(),e.destroy()}}Gravity(){if(this.curstate==a.Sky){this.ChargeSpeed>.001?this.GravityTime+=.008:this.GravityTime+=.01;var e=this.GravityTime*this.GravityTime;this._gameobject.transform.position=new y(this._gameobject.transform.position.x,this._gameobject.transform.position.y-e,this._gameobject.transform.position.z+e/2)}}Jump(){this.CanJump=!0,this.JumpTime=0}SpeedUp(e,t){this.ChargeTime<t&&(this.ChargeTime+=.1),this.ChargeSpeed<e&&(this.ChargeSpeed+=.2)}JudgeEqual(e){for(let t=0;t<this.RoleList.length;t++){if(this.RoleList[t]==e)return!0}return!1}}class L{constructor(){this.canmove=!1,this.trun=!0,L.ins=this}static get Instance(){return null==L.ins?new L:L.ins}Init(){this.Direction=A.Instance.curplayerData.LevelDirection;let e=E.Instance.Character.get(1);this.player=Laya.Sprite3D.instantiate(e),D.Instance.spritepool.addChild(this.player),this.player.transform.position=E.Instance.playerpos.transform.position.clone(),this.player.transform.rotation=E.Instance.playerpos.transform.rotation.clone(),this.trun=!0}RefreshPro(){let e=E.Instance.playerpos.transform.position.clone().z,t=E.Instance.finishpoint.z-e;return this.player.transform.position.z/t}EnablePlayer(){this.player.addComponent(w).Tag_Head=!0,this.ListenOn()}ListenOn(){Laya.stage.on(Laya.Event.MOUSE_DOWN,this,this.OnMouseDown)}ListenOff(){Laya.stage.off(Laya.Event.MOUSE_DOWN,this,this.OnMouseDown)}DisablePlayer(){let e=this.player.getComponent(w);e&&e.destroy()}OnMouseDown(){1==this.Direction?this.trun?(this.player.transform.rotationEuler=new Laya.Vector3(0,-90,0),this.trun=!this.trun):(this.player.transform.rotationEuler=new Laya.Vector3(0,0,0),this.trun=!this.trun):2==this.Direction&&(this.trun?(this.player.transform.rotationEuler=new Laya.Vector3(0,90,0),this.trun=!this.trun):(this.player.transform.rotationEuler=new Laya.Vector3(0,0,0),this.trun=!this.trun))}}var I,S=Laya.ClassUtils.regClass;!function(e){class t extends Laya.Scene{constructor(){super()}createChildren(){super.createChildren(),this.createView(t.uiView)}}t.uiView={type:"Scene",props:{width:720,height:1280},compId:2,child:[{type:"Image",props:{top:0,skin:"Main/chunhei.png",sizeGrid:"12,13,14,10",right:0,name:"bg",left:0,bottom:0},compId:29},{type:"Image",props:{y:210,x:90.5,var:"WinBox",skin:"Main/lanshandi.png",alpha:1},compId:4,child:[{type:"Image",props:{y:-140,x:24,skin:"Main/shenglilo.png"},compId:5},{type:"Image",props:{y:151,x:52.5,skin:"Main/shangkuan.png"},compId:6,child:[{type:"Image",props:{y:150,x:90.5,skin:"Main/jinbidi.png"},compId:7,child:[{type:"Image",props:{y:27,x:86,skin:"Main/jinbihud.png"},compId:8},{type:"Image",props:{y:20,x:30,skin:"Main/jinbi.png"},compId:9},{type:"Text",props:{y:-101,x:6,width:241,var:"Win_GoldNum",valign:"middle",text:"888",height:69,fontSize:92,font:"Microsoft YaHei",color:"#92501d",bold:!0,align:"center",runtime:"laya.display.Text"},compId:10}]}]},{type:"Button",props:{y:470,x:82,var:"Win_VideoBtn",stateNum:1,skin:"Main/dihong.png"},compId:12,child:[{type:"Image",props:{y:39,x:45,skin:"Main/shipin.png"},compId:13},{type:"Image",props:{y:40.5,x:158,skin:"Main/sanbeilingqu.png"},compId:14}]},{type:"Button",props:{y:631,x:185,var:"Win_BackBtn",stateNum:1,skin:"Main/buyongxieix.png"},compId:15}]},{type:"Image",props:{y:210,x:90.5,var:"FailBox",skin:"Main/beijing.png",alpha:1},compId:17,child:[{type:"Image",props:{y:-140,x:24,skin:"Main/tongguanshi-lo.png"},compId:18},{type:"Image",props:{y:151,x:52.5,skin:"Main/shangshudi.png"},compId:19,child:[{type:"Image",props:{y:150,x:90.5,skin:"Main/qinandi.png"},compId:20,child:[{type:"Image",props:{y:27,x:86,skin:"Main/jinbihud.png"},compId:21},{type:"Image",props:{y:20,x:30,skin:"Main/jinbi.png"},compId:22},{type:"Text",props:{y:-101,x:6,width:241,var:"Fail_GoldNum",valign:"middle",text:"888",height:69,fontSize:92,font:"Microsoft YaHei",color:"#3660ab",bold:!0,align:"center",runtime:"laya.display.Text"},compId:23}]}]},{type:"Button",props:{y:470,x:82,var:"Fail_VideoBtn",stateNum:1,skin:"Main/ludi.png"},compId:24,child:[{type:"Image",props:{y:39,x:45,skin:"Main/shipin.png"},compId:25},{type:"Image",props:{y:39,x:157,skin:"Main/sanbeilingqu.png"},compId:26}]},{type:"Button",props:{y:631,x:185,var:"Fail_BackBtn",stateNum:1,skin:"Main/buyongxeixie.png"},compId:27}]}],loadList:["Main/chunhei.png","Main/lanshandi.png","Main/shenglilo.png","Main/shangkuan.png","Main/jinbidi.png","Main/jinbihud.png","Main/jinbi.png","Main/dihong.png","Main/shipin.png","Main/sanbeilingqu.png","Main/buyongxieix.png","Main/beijing.png","Main/tongguanshi-lo.png","Main/shangshudi.png","Main/qinandi.png","Main/ludi.png","Main/buyongxeixie.png"],loadList3D:[]},e.GameResultViewUI=t,S("ui.GameResultViewUI",t);class i extends Laya.Scene{constructor(){super()}createChildren(){super.createChildren(),this.createView(i.uiView)}}i.uiView={type:"Scene",props:{width:720,height:1280},compId:2,child:[{type:"Button",props:{y:963,x:204,var:"StartBtn",stateNum:1,skin:"Main/dianjikaishi.png"},compId:7,child:[{type:"Image",props:{y:72,x:209,width:86,var:"shou",skin:"Main/shou.png",scaleY:1,scaleX:1,pivotY:46,pivotX:43,height:92},compId:19}]},{type:"Button",props:{y:754,x:0,stateNum:1,skin:"Main/gengduo.png",name:"MoreFunBtn"},compId:9},{type:"Button",props:{y:754,x:605,var:"SkinBtn",stateNum:1,skin:"Main/shangdain.png"},compId:10},{type:"Button",props:{y:630,x:605,var:"SignBtn",stateNum:1,skin:"Main/qiandao.png"},compId:11},{type:"Image",props:{y:95,x:557,width:164,skin:"Main/qiandi.png",height:55},compId:13,child:[{type:"Image",props:{y:0,x:0,skin:"Main/qian.png"},compId:15},{type:"Text",props:{y:0,x:54,width:110,var:"GoldNum",valign:"middle",text:"99999",height:55,fontSize:40,color:"#ffffff",bold:!0,align:"center",runtime:"laya.display.Text"},compId:18}]},{type:"Box",props:{y:160.5,x:127.5,width:487,var:"ProBox",height:81},compId:21,child:[{type:"ProgressBar",props:{y:30,x:68,width:352,value:0,skin:"Main/guandi-3.png",height:22},compId:20},{type:"Image",props:{y:11.5,x:20,skin:"Main/guandi.png"},compId:22,child:[{type:"Text",props:{y:9,x:1,width:56,var:"NowLevelNum",valign:"middle",text:"10",height:40,fontSize:30,color:"#ffffff",align:"center",runtime:"laya.display.Text"},compId:23}]},{type:"Image",props:{y:12,x:414,skin:"Main/zhongdian.png"},compId:24}]},{type:"Button",props:{y:36,x:32,var:"SetBtn",stateNum:1,skin:"Main/shezhi.png"},compId:26},{type:"Image",props:{visible:!1,var:"SetPanel",top:0,skin:"Main/chunhei.png",sizeGrid:"13,15,15,15",right:0,left:0,bottom:0},compId:48,child:[{type:"Image",props:{y:466,x:118.5,skin:"Main/Background Pop up ads.png"},compId:29,child:[{type:"Image",props:{y:40,x:73,skin:"Main/Bouton policy privacy.png",name:"shake"},compId:30,child:[{type:"Image",props:{y:15,x:43,skin:"Main/zhenfu.png"},compId:33},{type:"Image",props:{y:25,x:121,skin:"Main/kaigdi.png"},compId:35,child:[{type:"Image",props:{y:9,x:94,skin:"Main/OFF.png"},compId:38},{type:"Image",props:{y:9,x:23,skin:"Main/ON.png"},compId:39}]},{type:"Image",props:{y:25,x:206,skin:"Main/bodong.png",name:"on"},compId:41},{type:"Image",props:{y:25,x:121,skin:"Main/boodong-2.png",name:"off"},compId:40},{type:"Button",props:{y:26,x:121,width:171,var:"shakebtn",height:41},compId:49}]},{type:"Image",props:{y:151.5,x:73,skin:"Main/Bouton policy privacy.png",name:"sound"},compId:31,child:[{type:"Image",props:{y:20,x:47,skin:"Main/yinfu.png"},compId:34},{type:"Image",props:{y:25,x:121,skin:"Main/kaigdi.png"},compId:42,child:[{type:"Image",props:{y:9,x:94,skin:"Main/OFF.png"},compId:43},{type:"Image",props:{y:9,x:23,skin:"Main/ON.png"},compId:44}]},{type:"Image",props:{y:25,x:206,skin:"Main/bodong.png",name:"on"},compId:45},{type:"Image",props:{y:25,x:121,skin:"Main/boodong-2.png",name:"off"},compId:46},{type:"Button",props:{y:26,x:121,width:171,var:"soundbtn",height:41},compId:50}]},{type:"Button",props:{y:-46,x:-35,var:"CloseSetBtn",stateNum:1,skin:"Main/guanbi.png"},compId:47}]}]}],animations:[{nodes:[{target:19,keyframes:{scaleY:[{value:1,tweenMethod:"linearNone",tween:!0,target:19,key:"scaleY",index:0},{value:.8,tweenMethod:"linearNone",tween:!0,target:19,key:"scaleY",index:5},{value:1,tweenMethod:"linearNone",tween:!0,target:19,key:"scaleY",index:10},{value:.8,tweenMethod:"linearNone",tween:!0,target:19,key:"scaleY",index:15},{value:1,tweenMethod:"linearNone",tween:!0,target:19,key:"scaleY",index:20}],scaleX:[{value:1,tweenMethod:"linearNone",tween:!0,target:19,key:"scaleX",index:0},{value:.8,tweenMethod:"linearNone",tween:!0,target:19,key:"scaleX",index:5},{value:1,tweenMethod:"linearNone",tween:!0,target:19,key:"scaleX",index:10},{value:.8,tweenMethod:"linearNone",tween:!0,target:19,key:"scaleX",index:15},{value:1,tweenMethod:"linearNone",tween:!0,target:19,key:"scaleX",index:20}]}}],name:"handclick",id:1,frameRate:24,action:0}],loadList:["Main/dianjikaishi.png","Main/shou.png","Main/gengduo.png","Main/shangdain.png","Main/qiandao.png","Main/qiandi.png","Main/qian.png","Main/guandi-3.png","Main/guandi.png","Main/zhongdian.png","Main/shezhi.png","Main/chunhei.png","Main/Background Pop up ads.png","Main/Bouton policy privacy.png","Main/zhenfu.png","Main/kaigdi.png","Main/OFF.png","Main/ON.png","Main/bodong.png","Main/boodong-2.png","Main/yinfu.png","Main/guanbi.png"],loadList3D:[]},e.HomeViewUI=i,S("ui.HomeViewUI",i);class a extends Laya.Scene{constructor(){super()}createChildren(){super.createChildren(),this.createView(a.uiView)}}a.uiView={type:"Scene",props:{width:720,height:1280},compId:2,child:[{type:"Box",props:{y:123,x:116.5,width:487,visible:!0,var:"ProBox",height:81},compId:8,child:[{type:"ProgressBar",props:{y:30,x:68,width:352,var:"jindupro",value:0,skin:"Main/guandi-3.png",height:22},compId:9},{type:"Image",props:{y:11.5,x:20,skin:"Main/guandi.png"},compId:10,child:[{type:"Text",props:{y:9,x:1,width:56,var:"NowLevelNum",valign:"middle",text:"10",height:40,fontSize:30,color:"#ffffff",align:"center",runtime:"laya.display.Text"},compId:11}]},{type:"Image",props:{y:12,x:414,skin:"Main/zhongdian.png"},compId:12}]},{type:"Image",props:{y:181.5,x:251.5,visible:!0,skin:"Main/shuliandi.png"},compId:13,child:[{type:"Text",props:{y:0,x:28,width:161,var:"CountTxt",valign:"middle",text:"小人数量:22",height:45,fontSize:24,color:"#ffffff",align:"center",runtime:"laya.display.Text"},compId:14}]}],loadList:["Main/guandi-3.png","Main/guandi.png","Main/zhongdian.png","Main/shuliandi.png"],loadList3D:[]},e.InGameViewUI=a,S("ui.InGameViewUI",a);class n extends Laya.Scene{constructor(){super()}createChildren(){super.createChildren(),this.createView(n.uiView)}}n.uiView={type:"Scene",props:{width:720,height:1280},compId:2,child:[{type:"Image",props:{top:0,skin:"Load/beijing.png",sizeGrid:"10,14,12,10",right:0,name:"bg",left:0,bottom:0},compId:4},{type:"ProgressBar",props:{y:1018,x:165,var:"jindupro",skin:"Load/ss.png"},compId:3},{type:"Image",props:{y:160,x:105,skin:"Load/title.png"},compId:5},{type:"Image",props:{y:1062,x:292.5,skin:"Load/jiazaizhon.png"},compId:7}],loadList:["Load/beijing.png","Load/ss.png","Load/title.png","Load/jiazaizhon.png"],loadList3D:[]},e.LoadViewUI=n,S("ui.LoadViewUI",n);class s extends Laya.Scene{constructor(){super()}createChildren(){super.createChildren(),this.createView(s.uiView)}}s.uiView={type:"Scene",props:{width:720,height:1280},compId:2,child:[{type:"Image",props:{y:0,x:0,top:0,skin:"Main/chunhei.png",sizeGrid:"12,13,14,10",right:0,name:"bg",left:0,bottom:0},compId:15},{type:"Button",props:{y:711,x:172.5,var:"ReviveBtn",stateNum:1,skin:"Main/dihong.png"},compId:4,child:[{type:"Image",props:{y:39,x:41,skin:"Main/shipin.png"},compId:5},{type:"Image",props:{y:39,x:162,skin:"Main/fuhuowenzi.png"},compId:6}]},{type:"Button",props:{y:888,x:294,var:"BackBtn",stateNum:1,skin:"Main/fanhuiwenzi.png"},compId:7},{type:"Box",props:{y:315,x:116.5,width:487,var:"ProBox",height:81},compId:8,child:[{type:"ProgressBar",props:{y:30,x:68,width:352,skin:"Main/guandi-3.png",height:22},compId:9},{type:"Image",props:{y:11.5,x:20,skin:"Main/guandi.png"},compId:10,child:[{type:"Text",props:{y:9,x:1,width:56,var:"NowLevelNum",valign:"middle",text:"10",height:40,fontSize:30,color:"#ffffff",align:"center",runtime:"laya.display.Text"},compId:11}]},{type:"Image",props:{y:12,x:414,skin:"Main/zhongdian.png"},compId:12}]},{type:"Image",props:{y:192,x:80.5,skin:"Main/wenzi.png"},compId:13}],loadList:["Main/chunhei.png","Main/dihong.png","Main/shipin.png","Main/fuhuowenzi.png","Main/fanhuiwenzi.png","Main/guandi-3.png","Main/guandi.png","Main/zhongdian.png","Main/wenzi.png"],loadList3D:[]},e.ReviveViewUI=s,S("ui.ReviveViewUI",s);class o extends Laya.Scene{constructor(){super()}createChildren(){super.createChildren(),this.createView(o.uiView)}}o.uiView={type:"Scene",props:{width:720,height:1280},compId:2,child:[{type:"Image",props:{y:0,x:0,top:0,skin:"Main/chunhei.png",right:0,name:"bg",left:0,bottom:0},compId:72},{type:"Image",props:{y:143,x:60.5,skin:"Main/qinad-d.png"},compId:5,child:[{type:"Image",props:{y:12,x:188,skin:"Main/qiriqiandao.png"},compId:6},{type:"Box",props:{y:102,x:18,width:180,height:200},compId:7,child:[{type:"Image",props:{y:0,x:4.5,skin:"Main/pitongkuan.png"},compId:8,child:[{type:"Text",props:{y:10,x:9,width:153,valign:"middle",text:"第1天",height:33,fontSize:28,font:"Microsoft YaHei",color:"#ffffff",align:"center",runtime:"laya.display.Text"},compId:9}]},{type:"Image",props:{y:76,x:67,skin:"Main/jinbi.png",name:"icon"},compId:12,child:[{type:"Text",props:{y:69,x:-11,width:68,valign:"middle",text:"x100",name:"coinnum",height:32,fontSize:28,color:"#ffffff",align:"center",runtime:"laya.display.Text"},compId:14}]},{type:"Image",props:{y:0,x:4.5,skin:"Main/heizha.png",name:"complete"},compId:11,child:[{type:"Image",props:{y:63,x:29,skin:"Main/yihuode.png"},compId:10}]},{type:"Button",props:{top:0,right:0,name:"btn",left:0,bottom:0},compId:15}]},{type:"Box",props:{y:102,x:209.5,width:180,height:200},compId:17,child:[{type:"Image",props:{y:0,x:4.5,skin:"Main/pitongkuan.png"},compId:18,child:[{type:"Text",props:{y:10,x:9,width:153,valign:"middle",text:"第2天",height:33,fontSize:28,font:"Microsoft YaHei",color:"#ffffff",align:"center",runtime:"laya.display.Text"},compId:19}]},{type:"Image",props:{y:76,x:67,skin:"Main/jinbi.png",name:"icon"},compId:20,child:[{type:"Text",props:{y:69,x:-11,width:68,valign:"middle",text:"x100",name:"coinnum",height:32,fontSize:28,color:"#ffffff",align:"center",runtime:"laya.display.Text"},compId:21}]},{type:"Image",props:{y:0,x:4.5,skin:"Main/heizha.png",name:"complete"},compId:22,child:[{type:"Image",props:{y:63,x:29,skin:"Main/yihuode.png"},compId:23}]},{type:"Button",props:{top:0,right:0,name:"btn",left:0,bottom:0},compId:24}]},{type:"Box",props:{y:102,x:402,width:180,height:200},compId:25,child:[{type:"Image",props:{y:0,x:4.5,skin:"Main/pitongkuan.png"},compId:26,child:[{type:"Text",props:{y:10,x:9,width:153,valign:"middle",text:"第3天",height:33,fontSize:28,font:"Microsoft YaHei",color:"#ffffff",align:"center",runtime:"laya.display.Text"},compId:27}]},{type:"Image",props:{y:76,x:67,skin:"Main/jinbi.png",name:"icon"},compId:28,child:[{type:"Text",props:{y:69,x:-11,width:68,valign:"middle",text:"x100",name:"coinnum",height:32,fontSize:28,color:"#ffffff",align:"center",runtime:"laya.display.Text"},compId:29}]},{type:"Image",props:{y:0,x:4.5,skin:"Main/heizha.png",name:"complete"},compId:30,child:[{type:"Image",props:{y:63,x:29,skin:"Main/yihuode.png"},compId:31}]},{type:"Button",props:{top:0,right:0,name:"btn",left:0,bottom:0},compId:32}]},{type:"Box",props:{y:318,x:18,width:180,height:200},compId:33,child:[{type:"Image",props:{y:0,x:4.5,skin:"Main/pitongkuan.png"},compId:36,child:[{type:"Text",props:{y:10,x:9,width:153,valign:"middle",text:"第4天",height:33,fontSize:28,font:"Microsoft YaHei",color:"#ffffff",align:"center",runtime:"laya.display.Text"},compId:37}]},{type:"Image",props:{y:76,x:67,skin:"Main/jinbi.png",name:"icon"},compId:38,child:[{type:"Text",props:{y:69,x:-11,width:68,valign:"middle",text:"x100",name:"coinnum",height:32,fontSize:28,color:"#ffffff",align:"center",runtime:"laya.display.Text"},compId:39}]},{type:"Image",props:{y:0,x:4.5,skin:"Main/heizha.png",name:"complete"},compId:40,child:[{type:"Image",props:{y:63,x:29,skin:"Main/yihuode.png"},compId:41}]},{type:"Button",props:{top:0,right:0,name:"btn",left:0,bottom:0},compId:42}]},{type:"Box",props:{y:318,x:209,width:180,height:200},compId:34,child:[{type:"Image",props:{y:0,x:4.5,skin:"Main/pitongkuan.png"},compId:43,child:[{type:"Text",props:{y:10,x:9,width:153,valign:"middle",text:"第5天",height:33,fontSize:28,font:"Microsoft YaHei",color:"#ffffff",align:"center",runtime:"laya.display.Text"},compId:44}]},{type:"Image",props:{y:76,x:67,skin:"Main/jinbi.png",name:"icon"},compId:45,child:[{type:"Text",props:{y:69,x:-11,width:68,valign:"middle",text:"x100",name:"coinnum",height:32,fontSize:28,color:"#ffffff",align:"center",runtime:"laya.display.Text"},compId:46}]},{type:"Image",props:{y:0,x:4.5,skin:"Main/heizha.png",name:"complete"},compId:47,child:[{type:"Image",props:{y:63,x:29,skin:"Main/yihuode.png"},compId:48}]},{type:"Button",props:{top:0,right:0,name:"btn",left:0,bottom:0},compId:49}]},{type:"Box",props:{y:318,x:402,width:180,height:200},compId:35,child:[{type:"Image",props:{y:0,x:4.5,skin:"Main/pitongkuan.png"},compId:50,child:[{type:"Text",props:{y:10,x:9,width:153,valign:"middle",text:"第6天",height:33,fontSize:28,font:"Microsoft YaHei",color:"#ffffff",align:"center",runtime:"laya.display.Text"},compId:51}]},{type:"Image",props:{y:76,x:67,skin:"Main/jinbi.png",name:"icon"},compId:52,child:[{type:"Text",props:{y:69,x:-11,width:68,valign:"middle",text:"x100",name:"coinnum",height:32,fontSize:28,color:"#ffffff",align:"center",runtime:"laya.display.Text"},compId:53}]},{type:"Image",props:{y:0,x:4.5,skin:"Main/heizha.png",name:"complete"},compId:54,child:[{type:"Image",props:{y:63,x:29,skin:"Main/yihuode.png"},compId:55}]},{type:"Button",props:{top:0,right:0,name:"btn",left:0,bottom:0},compId:56}]},{type:"Box",props:{y:536,x:23,width:553,height:196},compId:57,child:[{type:"Image",props:{y:-2,x:77,skin:"Main/qitiankuang.png"},compId:58,child:[{type:"Text",props:{y:42,x:42,width:78,valign:"middle",text:"第7天",rotation:-45,pivotY:17,pivotX:39,height:33,fontSize:28,font:"Microsoft YaHei",color:"#ffffff",align:"center",runtime:"laya.display.Text"},compId:59}]},{type:"Image",props:{y:66.5,x:276.5,skin:"Main/jinbi.png",name:"icon"},compId:60,child:[{type:"Text",props:{y:69,x:-11,width:68,valign:"middle",text:"x100",name:"coinnum",height:32,fontSize:28,color:"#ffffff",align:"center",runtime:"laya.display.Text"},compId:61}]},{type:"Image",props:{y:-2,x:76,width:433,skin:"Main/heizha.png",sizeGrid:"63,54,82,55",name:"complete",height:198},compId:62,child:[{type:"Image",props:{y:42.5,x:160,skin:"Main/yihuode.png"},compId:63}]},{type:"Button",props:{y:0,x:77,width:431,name:"btn",height:196},compId:64}]}]},{type:"Image",props:{y:70,x:556,width:164,skin:"Main/qiandi.png",height:55},compId:65,child:[{type:"Image",props:{y:0,x:0,skin:"Main/qian.png"},compId:66},{type:"Text",props:{y:0,x:54,width:110,var:"GoldNum",valign:"middle",text:"99999",height:55,fontSize:40,color:"#ffffff",bold:!0,align:"center",runtime:"laya.display.Text"},compId:67}]},{type:"Button",props:{y:921,x:172.5,var:"VideoSign",stateNum:1,skin:"Main/bd-d.png"},compId:68,child:[{type:"Image",props:{y:39,x:42,skin:"Main/ship.png"},compId:69},{type:"Image",props:{y:39,x:156,skin:"Main/minf.png"},compId:70}]},{type:"Button",props:{y:1074,x:274,stateNum:1,skin:"Main/buyong.png",name:"NoBtn"},compId:71}],loadList:["Main/chunhei.png","Main/qinad-d.png","Main/qiriqiandao.png","Main/pitongkuan.png","Main/jinbi.png","Main/heizha.png","Main/yihuode.png","Main/qitiankuang.png","Main/qiandi.png","Main/qian.png","Main/bd-d.png","Main/ship.png","Main/minf.png","Main/buyong.png"],loadList3D:[]},e.SignViewUI=o,S("ui.SignViewUI",o)}(I||(I={}));class v extends I.InGameViewUI{constructor(){super(),v.ins=this}static get Instance(){return null==v.ins?new v:v.ins}OnShow(){console.log("游戏界面"),this.on(Laya.Event.MOUSE_DOWN,this,this.ClickStart),this.RefreshUI(),this.height=Laya.stage.height,Laya.stage.on(Laya.Event.RESIZE,this,()=>{this.height=Laya.stage.height}),s.StageOn(i.RefreshPro,this,this.SetProValue)}ClickStart(){this.off(Laya.Event.MOUSE_DOWN,this,this.ClickStart)}RefreshUI(){let e=A.Instance.curplayerData.STAGE;this.NowLevelNum.text=e+""}SetProValue(e){this.jindupro.value=e.pre,this.CountTxt.text="小人数量:"+(Number(e.count)+1)}OnHide(){s.StageOff(i.RefreshPro,this,this.SetProValue)}}class x{}x.VERSION="1.0.0",x.CFG="123";var C=Laya.HttpRequest,b=Laya.Event;const k="https://waveapi.xwxgame.com/";class M{}M.DengLu="user/login",M.KaiShi="game/start",M.JieShu="game/play",M.QianDao="sign/sign",M.Chengjiu="achievement/getRewards",M.Config="config/table",M.FenXiang="fission/share",M.LiXian="fission/offline",M.vd="fission/vd",M.FuHuo="game/revival",M.gadagdag="treasure/click",M.Invite="invite/getRewards",M.Lottery="lottery/lottery",M.ShareGetSkin="theme/fission",M.WearEquip="theme/equip",M.BuyEquip="theme/buy",M.ShouQuan="user/auth",M.JinBi="user/sync";class _{constructor(){}static get Instance(){return _.ins?_.ins:new _}Login(e,t,i){var a=A.Instance,n=x.VERSION;let s=`code=${a.code}&nickname=${a.nickName}&avatar=${a.avatarUrl}&gender=${a.gender}&country=${a.country}&province=${a.province}&city=${a.city}& device=${a.device}$&share_id=${a.share_id}&scene=${a.scene}&v=${n}`,o=new C;o.once(b.PROGRESS,this,this.Progress,[e,o]),o.once(b.COMPLETE,this,this.Complete,[t,o]),o.once(b.ERROR,this,this.Errorcb,[i,o]),o.send(k+M.DengLu,s,"post","text")}Progress(e,t){e&&e.run()}Complete(e,t){let i=JSON.parse(t.data);console.log(i),"0"==i.code?(console.log("-----------sss",i.t),A.Instance.SFSFSF=i.t,this.RessetConfig(i,e)):console.log("登录异常错误!错误信息sssssssss:",t.data.code)}RessetConfig(e,t){A.Instance.ReSetting(e,i=>{i?t.runWith(e):this.RessetConfig(e,t)})}Errorcb(e,t){null!=e&&e.runWith(t)}SendHttp(e,t,i,a,n=!0){let s="",o=k+e;if(1==n&&(s=`token=${A.Instance.curplayerData.zhengshu}&`),e==M.KaiShi||e==M.JieShu||e==M.vd||e==M.Lottery||e==M.ShareGetSkin){let e="abcdefghijkimnopqrstuvwxyz0123456789",i="{",a="";for(let t=0;t<4;t++)a+=e[Math.floor(100*Math.random())%e.length];for(let e=0;e<t.length;e++){for(let a in t[e])i+=`"${a}":"${t[e][a]}"`;e<t.length-1?i+=",":i+="}"}s+="_r="+a+this.SFGSGSG(i)}else if(null!=t)for(let e=0;e<t.length;e++)for(let i in t[e]){s+=`${i}=${t[e][i]}`,e<t.length-1&&(s+="&")}let r=new C;r.once(b.COMPLETE,this,this.onHttpRequestComplete,[i,a,r]),r.once(b.ERROR,this,this.Errorcb,[a,r]),r.send(o,s,"post","text")}onHttpRequestComplete(e,t,i){let a=JSON.parse(i.data);0==a.code?(A.Instance.ReSetting(a),null!=e&&e.runWith(a)):(null!=t&&t.runWith(a),console.log("Error! Http request complete error, code: "+a.code+" message: "+a.message))}SFGSGSG(e){for(var t,i,a,n="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",s=0,o=e.length,r="";s<o;){if(t=255&e.charCodeAt(s++),s==o){r+=n.charAt(t>>2),r+=n.charAt((3&t)<<4),r+="==";break}if(i=e.charCodeAt(s++),s==o){r+=n.charAt(t>>2),r+=n.charAt((3&t)<<4|(240&i)>>4),r+=n.charAt((15&i)<<2),r+="=";break}a=e.charCodeAt(s++),r+=n.charAt(t>>2),r+=n.charAt((3&t)<<4|(240&i)>>4),r+=n.charAt((15&i)<<2|(192&a)>>6),r+=n.charAt(63&a)}return r}}class B extends I.HomeViewUI{constructor(){super(),B.ins=this}static get Instance(){return null==B.ins?new B:B.ins}OnShow(){console.log("主界面"),this.RefreshUI(),this.RegButton(),this.handclick.play(null,!0)}RegButton(){this.StartBtn.clickHandler=new Laya.Handler(this,this.Start),this.SetBtn.clickHandler=new Laya.Handler(this,this.ShowSetPanel),this.CloseSetBtn.clickHandler=new Laya.Handler(this,this.HideSetPanel),this.shakebtn.clickHandler=new Laya.Handler(this,this.ClickShake),this.soundbtn.clickHandler=new Laya.Handler(this,this.ClickSound),this.height=Laya.stage.height,Laya.stage.on(Laya.Event.RESIZE,this,()=>{this.height=Laya.stage.height})}RefreshUI(){let e=A.Instance.curplayerData.STAGE;this.NowLevelNum.text=e+"",this.GoldNum.text=A.Instance.curplayerData.GainAccount("money")}Start(){var e=[{t:A.Instance.ServerTime.toString()}];_.Instance.SendHttp(M.KaiShi,e,Laya.Handler.create(this,e=>{O.play_id=e.play_id,L.Instance.EnablePlayer(),this.handclick.stop(),this.shou.visible=!1,G.Instance.ShowView(T.InGameView),s.StageTrigger(i.Start)}),null)}GameStart(){}ShowSetPanel(){this.SetPanel.visible=!0;let e=this.SetPanel.getChildAt(0).getChildByName("shake").getChildByName("on"),t=this.SetPanel.getChildAt(0).getChildByName("shake").getChildByName("off"),i=this.SetPanel.getChildAt(0).getChildByName("sound").getChildByName("on"),a=this.SetPanel.getChildAt(0).getChildByName("sound").getChildByName("off");i.visible=m.play,a.visible=!i.visible,e.visible=j.shake,t.visible=!e.visible}HideSetPanel(){this.SetPanel.visible=!1}ClickSound(){let e=this.SetPanel.getChildAt(0).getChildByName("sound").getChildByName("on"),t=this.SetPanel.getChildAt(0).getChildByName("sound").getChildByName("off");m.play=!m.play,e.visible=m.play,t.visible=!e.visible,m.play?m.PlayBGM(p.bgm):m.StopMusic()}ClickShake(){let e=this.SetPanel.getChildAt(0).getChildByName("shake").getChildByName("on"),t=this.SetPanel.getChildAt(0).getChildByName("shake").getChildByName("off");j.shake=!j.shake,e.visible=j.shake,t.visible=!e.visible}OnHide(){}}class R extends I.ReviveViewUI{constructor(){super(),R.ins=this}static get Instance(){return null==R.ins?new R:R.ins}OnShow(){this.height=Laya.stage.height,Laya.stage.on(Laya.Event.RESIZE,this,()=>{this.height=Laya.stage.height})}OnHide(){}}class V extends I.GameResultViewUI{constructor(){super(),V.ins=this}static get Instance(){return null==V.ins?new V:V.ins}OnShow(e){this._result=e,e?(this.WinBox.visible=!0,this.FailBox.visible=!1):(this.WinBox.visible=!1,this.FailBox.visible=!0),D.Instance.BackMain(),this.RefreshUI(),this.RegButton(),this.height=Laya.stage.height,Laya.stage.on(Laya.Event.RESIZE,this,()=>{this.height=Laya.stage.height})}RegButton(){this.Win_BackBtn.clickHandler=new Laya.Handler(this,this.BackHome),this.Win_VideoBtn.clickHandler=new Laya.Handler(this,this.WinVideoGet),this.Fail_BackBtn.clickHandler=new Laya.Handler(this,this.BackHome),this.Fail_VideoBtn.clickHandler=new Laya.Handler(this,this.LoseVideoGet)}RefreshUI(){this.Win_GoldNum.text=A.Instance.curplayerData.LevelReward(this._result)+"",this.Fail_GoldNum.text=A.Instance.curplayerData.LevelReward(this._result)+""}WinVideoGet(){}LoseVideoGet(){}BackHome(){A.Instance.curplayerData.STAGE;var e=this._result?"1":"0",t=A.Instance.curplayerData.LevelReward(this._result)+"",i=[{t:A.Instance.ServerTime.toString()},{play_id:O.play_id},{win:e},{money:t}];_.Instance.SendHttp(M.JieShu,i,Laya.Handler.create(this,this.Success),null)}Success(){O.Instance.GameOver()}OnHide(){}}var T,P;!function(e){e[e.InGameView=0]="InGameView",e[e.HomeView=1]="HomeView",e[e.GameResultView=2]="GameResultView",e[e.SkinView=3]="SkinView",e[e.TrialView=4]="TrialView",e[e.ReviveView=5]="ReviveView"}(T||(T={}));class G{constructor(){this.showexportview=0,this.popViewDic=[],this.ViewSprite=new Laya.Sprite,this.OtherViewSprite=new Laya.Sprite,G.ins=this,Laya.stage.addChild(this.ViewSprite),Laya.stage.addChild(this.OtherViewSprite)}static get Instance(){return G.ins?G.ins:new G}ShowView(e,t=null){null!=this.curView&&(this.curView.OnHide(),this.curView.destroy(),this.curView.removeSelf()),this.curView=this.CreateView(e),this.curView.name=T[e],this.ViewSprite.addChild(this.curView),this.curView.OnShow(t)}CloseView(){null!=this.curView&&(this.curView.OnHide(),this.curView.destroy(),this.curView.removeSelf())}OpenPopView(e,t=null){var i;this.popViewDic[e]?(i=this.popViewDic[e],this.OtherViewSprite.setChildIndex(i,this.OtherViewSprite.numChildren-1),i.visible=!0):(i=this.CreateView(e),this.OtherViewSprite.addChild(i),this.popViewDic[e]=i),i.OnOpen(t)}ClosePopView(e){var t=this.popViewDic[e];null!=t&&(t.OnHide(),t.visible=!1)}ClearPopViews(){}CreateView(e){switch(e){case T.InGameView:return new v;case T.HomeView:return new B;case T.ReviveView:return new R;case T.GameResultView:return new V}return null}}class N{constructor(){this.LeftPosition=new Laya.Vector3(3.65,5.72,-4.52),this.LeftRotate=new Laya.Vector3(-24,145,0),this.RightPosition=new Laya.Vector3(-3.78,4.87,-4.46),this.RightRotate=new Laya.Vector3(-24,-145,0),this.poschazhi=new Laya.Vector3,this.gengsuipos=new Laya.Vector3,this.lllpos=new Laya.Vector3,this.hights=0,this.wights=0,N.ins=this,s.StageOn(i.Start,this,this.CameraFollow),s.StageOn(i.Win,this,this.CameraCancelFollow),s.StageOn(i.Lose,this,this.CameraCancelFollow)}static get Instance(){return null==N.ins?new N:N.ins}Init(){1==A.Instance.curplayerData.LevelDirection?(this.camera.transform.position=this.LeftPosition,this.camera.transform.rotationEuler=this.LeftRotate):(this.camera.transform.position=this.RightPosition,this.camera.transform.rotationEuler=this.RightRotate),this.CameraFollow()}CameraFollow(){this.hights=0,this.wights=0,Laya.Vector3.subtract(L.Instance.player.transform.position,this.camera.transform.position,this.poschazhi),Laya.timer.frameLoop(1,this,this.GenSui)}GenSui(){Laya.Vector3.subtract(L.Instance.player.transform.position,this.poschazhi,this.gengsuipos),this.hights=n.Instance.lerp(this.hights,1,.03),this.wights=n.Instance.lerp(this.wights,1,.05),this.gengsuipos=new Laya.Vector3(this.gengsuipos.x,this.gengsuipos.y,this.gengsuipos.z),Laya.Vector3.lerp(this.camera.transform.position,this.gengsuipos,.25,this.lllpos),this.lllpos=new Laya.Vector3(this.gengsuipos.x,this.lllpos.y,this.lllpos.z),this.camera.transform.position=this.lllpos}CameraCancelFollow(){Laya.timer.clear(this,this.GenSui)}}class D{constructor(){D.ins=this}static get Instance(){return null==D.ins?new D:D.ins}RegEvent(){s.StageOn(i.Lose,this,this.GameLose),s.StageOn(i.Win,this,this.GameWin),s.StageOn(i.Pause,this,this.GamePause),s.StageOn(i.Resume,this,this.GameResume),s.StageOn(i.Over,this,this.GameStart)}GameStart(){L.Instance.Init(),N.Instance.Init(),G.Instance.ShowView(T.HomeView),m.PlayBGM(p.bgm)}GameLose(){L.Instance.ListenOff(),Laya.timer.once(500,this,()=>{G.Instance.ShowView(T.GameResultView,!1)}),m.StopMusic()}GameWin(){L.Instance.ListenOff(),Laya.timer.once(500,this,()=>{G.Instance.ShowView(T.GameResultView,!0)}),m.StopMusic()}GamePause(){}GameResume(){}BackMain(){for(let e=this.spritepool.numChildren-1;e>=0;e--){let t=this.spritepool.getChildAt(e),i=t.getComponent(g);i&&i.destroy();let a=t.getComponent(w);a&&a.destroy(),t.removeSelf(),t.destroy(),t=null}}}class E{constructor(){this.Prop=new o,this.Character=new o,E.ins=this,s.EventOn(t.LoadComplete,this,this.Init)}static get Instance(){return null==E.ins?new E:E.ins}Init(){this.mainscene.enableFog=!0,this.mainscene.fogStart=25,this.mainscene.fogRange=40,this.mainscene.fogColor=new Laya.Vector3(138/255,78/255,188/255),Laya.stage.addChild(this.mainscene),this.maincamera=this.mainscene.getChildByName("Main Camera"),this.maincamera.clearColor=new Laya.Vector4(138/255,78/255,188/255,1),this.maincamera.enableHDR=!1,N.Instance.camera=this.maincamera,this.camerapos=this.maincamera.transform.position.clone(),this.camerarotate=this.maincamera.transform.rotationEuler.clone();let e=new Laya.Sprite3D;this.mainscene.addChild(e),D.Instance.spritepool=e,this.SetCharacterPos(),D.Instance.RegEvent(),D.Instance.GameStart()}getPref(e){return this.Prop.get(e)}getRolePref(e){return this.Character.get(e)}SetCharacterPos(){O.STAGE=-1;let e=this.mainscene.getChildByName("levelgg"),t="level"+A.Instance.curplayerData.STAGE;for(let i=0;i<e.numChildren;i++){let a=e.getChildAt(i);a.name!=t?a.active=!1:(a.active=!0,this.curstage=a)}for(let e=0;e<this.curstage.numChildren;e++){let t=this.curstage.getChildAt(e);if("player"==t.name)this.playerpos=Laya.Sprite3D.instantiate(t);else if("barrier"==t.name){let e=this.getPref(l.Nail2),i=Laya.Sprite3D.instantiate(e);D.Instance.spritepool.addChild(i),i.transform.position=t.transform.position.clone(),i.transform.rotation=t.transform.rotation.clone(),i.transform.scale=t.transform.scale.clone(),i.name=l.Nail2,r.SetColliderGroup(i,2)}else if("role"==t.name){let e=this.getRolePref(1),i=Laya.Sprite3D.instantiate(e);D.Instance.spritepool.addChild(i),i.transform.position=t.transform.position.clone(),i.transform.rotation=t.transform.rotation.clone();i.addComponent(w);r.SetColliderGroup(i,100)}else if("speed"==t.name){let e=this.getPref(l.Speed),i=Laya.Sprite3D.instantiate(e);D.Instance.spritepool.addChild(i),i.transform.position=t.transform.position.clone(),i.transform.rotation=t.transform.rotation.clone(),i.transform.scale=t.transform.scale.clone(),i.name=l.Speed,r.SetColliderGroup(t,1)}else if("Ramp"==t.name){let e=this.getPref(l.Ramp),i=Laya.Sprite3D.instantiate(e);D.Instance.spritepool.addChild(i),i.transform.position=t.transform.position.clone(),i.transform.rotation=t.transform.rotation.clone(),i.transform.scale=t.transform.scale.clone(),i.name=l.Ramp,r.SetColliderGroup(t,1)}else if("bridge"==t.name)r.SetColliderGroup(t,1);else if("Coin"==t.name){let e=this.getPref(l.Coin),i=Laya.Sprite3D.instantiate(e);D.Instance.spritepool.addChild(i),i.transform.position=t.transform.position.clone(),i.transform.rotation=t.transform.rotation.clone(),i.transform.scale=t.transform.scale.clone(),i.name=l.Coin;i.addComponent(u);r.SetColliderGroup(i,3)}else if("FinishCircle"==t.name){let e=this.getPref(l.FinishCircle),i=Laya.Sprite3D.instantiate(e);D.Instance.spritepool.addChild(i),i.transform.position=t.transform.position.clone(),i.transform.rotation=t.transform.rotation.clone(),i.transform.scale=t.transform.scale.clone(),i.name=l.FinishCircle,this.finishpoint=t.transform.position.clone(),r.SetColliderGroup(i,200)}}}}class O{constructor(){O.ins=this}static get Instance(){return null==O.ins?new O:O.ins}GameLose(){s.StageTrigger(i.Lose)}GameWin(){s.StageTrigger(i.Win)}GameOver(){E.Instance.SetCharacterPos(),s.StageTrigger(i.Over)}}O.STAGE=-1,function(e){e[e.buyed_kun=0]="buyed_kun",e[e.diamond=1]="diamond",e[e.equip_themes=2]="equip_themes",e[e.favorite_times=3]="favorite_times",e[e.game_times=4]="game_times",e[e.get_themes=5]="get_themes",e[e.list_kun=6]="list_kun",e[e.moeny=7]="moeny",e[e.progress_themes=8]="progress_themes",e[e.revival=9]="revival",e[e.stage=10]="stage"}(P||(P={}));class H{constructor(e,t,i,a,n,s,o=null,r,h,l){this.openid="",this.userId="",this.zhengshu=e,this.netzheshe=i,this.account=a,this.accountssss=n,this.qiandao=r,this.renwu=h,this.userId=this.account.user_id,this.openid=this.accountssss.openid,this.m_invite=s,this.lottery=l,console.log("user_id:"+this.userId)}GainCollocation(e){return this.peizhis[e]}GainAccount(e){return this.account[e]}get fenxiang(){return"1"==this.netzheshe.share}get CheckScene(){return"1"==this.netzheshe.checkscene}get Cheat(){return"1"==this.netzheshe.cheat}get Banner(){return"1"==this.netzheshe.Banner}get wudaoshijian(){return Number(this.netzheshe.wudaoshijian)}LevelReward(e){let t=Number(this.GainAccount("stage"))+1,i=this.GainCollocation("mission");for(var a in i){let n=i[a];if(n.ID==t)return e?Number(n.win):Number(n.lose)}return null}get LevelDirection(){let e=this.STAGE,t=this.GainCollocation("mission");for(var i in t){let a=t[i];if(a.ID==e)return Number(a.direction)}return null}get STAGE(){return-1==O.STAGE&&(O.STAGE=Number(this.GainAccount("stage"))+1,O.STAGE>30&&(O.STAGE=n.RandomANumber(1,30))),O.STAGE}GetUser(e){var t=P[e];return this.account[t]}HasGun(e){for(var t=this.GainAccount("get_themes"),i=0;i<t.length;i++){if(e==t[i])return!0}return!1}GetProgress(e){var t=this.account.progress_themes;return t[e]?t[e]:0}get ShareTxt(){return this.netzheshe.sharecontent}}class A{constructor(e,t,i,a,n,s,o,r,h,l,c,p){this.createTime=Laya.timer.currTimer,A.ins=this,this.code=e,this.userInfo=t,this.nickName=i,this.avatarUrl=a,this.gender=n,this.province=s,this.city=o,this.country=r,this.device=h,this.share_id=l,this.scene=c,this.v=p}static get Instance(){return null==A.ins&&new A("222222","你找谁?","1233","123",1,"中国","上海","上海","iphone6s","123","123","123"),A.ins}ReSetting(e,t=null){var i=e.token,a=e.app_setting,n=e.user,s=e.user_base,o=e.user_sign,r=e.user_achievement,h=e.user_invite,l=e.user_lottery;null==this.curplayerData?(this.curplayerData=new H(i,null,a,n,s,h,null,o,r,l),this.JundgCfg(e.table_version,t)):(a&&(this.curplayerData.netzheshe=a),n&&(this.curplayerData.account=n),s&&(this.curplayerData.accountssss=s),o&&(this.curplayerData.qiandao=o),r&&(this.curplayerData.renwu=r))}JundgCfg(e,t){var i=Laya.LocalStorage.getJSON(x.CFG);i?i.VER==e?(console.log("已经拥有,不用更新"),this.SetCfg(i),t&&t(!0)):(console.log("cfg存在但是过期了"),Laya.LocalStorage.removeItem(x.CFG),_.Instance.SendHttp(M.Config,null,Laya.Handler.create(this,i=>{i.configs.VER=e,Laya.LocalStorage.setJSON(x.CFG,i.configs),this.SetCfg(i.configs),t&&t(!0)}),Laya.Handler.create(this,e=>{console.log("配置获取失败"+e),t&&t(!1)}))):(console.log("本地没有cfg"),_.Instance.SendHttp(M.Config,null,Laya.Handler.create(this,i=>{i.configs.VER=e,Laya.LocalStorage.setJSON(x.CFG,i.configs),this.SetCfg(i.configs),t&&t(!0)}),Laya.Handler.create(this,e=>{console.log("配置获取失败"+e)})))}SetCfg(e){this.curplayerData.peizhis=e}RessetConfig(){_.Instance.SendHttp(M.Config,null,Laya.Handler.create(this,e=>{this.curplayerData.peizhis=e.configs}),null)}get ServerTime(){let e=Laya.timer.currTimer;return this.SFSFSF+Math.ceil((e-this.createTime)/1e3)}}class z{beginShare(e){z.beginShareTime=(new Date).getTime(),console.log("分享点击时间="+z.beginShareTime),z.isSharing=!0,z.callback=e}onRegister(){null!=Laya.Browser.window.wx&&Laya.Browser.window.wx.onShow(function(e){if(console.log("onshow share start"),z.isSharing){z.isSharing=!1;let e=(new Date).getTime();console.log("分享回到游戏时间"+e);let i=(e-z.beginShareTime)/1e3;if(console.log("分享停留时间为:"+i),i<3)Laya.Browser.window.wx.showToast({title:"请重试一次"}),z.callback(!1);else if(Math.random()<=.3){var t=["你已分享过该群","请重新换个群分享!","请分享到30人大群中!"][n.RandomANumber(0,2)];Laya.Browser.window.wx.showToast({title:t}),z.callback(!1)}else Laya.Browser.window.wx.showToast({title:"分享成功!"}),z.callback(!0)}})}static ShareMessage(){if(Laya.Browser.onWeiXin){var e=A.Instance.ServerTime,t=A.Instance.curplayerData.ShareTxt;t=""!=t&&t?t:"组团一起浪";Laya.Browser.window.wx.onShareAppMessage(()=>({title:t,imageUrl:"subpackage2/res/share/shareimage.png",query:"shareid="+A.Instance.curplayerData.userId+"_"+e+"_"+Math.floor(9999*Math.random()).toString()}))}}static shareImage(e,t=null,i){if(null!=Laya.Browser.window.wx){var a=A.Instance.ServerTime,n=A.Instance.curplayerData.ShareTxt;n=""!=n&&n?n:"组团一起浪";Laya.Browser.window.wx.aldShareAppMessage({title:n,imageUrl:"subpackage2/res/share/shareimage.png",query:"userId="+A.Instance.curplayerData.userId+"_"+i+"_"+a+"_"+Math.floor(9999*Math.random()).toString()}),t&&z.Instance.beginShare(t)}}}z.Instance=new z,z.shareSuccessTime=0,z.isSharing=!1;class j{constructor(){j.ins=this}static get Instance(){return j.ins?j.ins:new j}static Init(){}static DengLu(e){var t=this;Laya.Browser.window.wx.login({success:function(i){i.code?(z.Instance.onRegister(),console.log("微信登陆成功----"),t.codeValue=i.code,console.log("shareid:"+j.shareOpenId),new A(i.code,"","","",0,"","","","",j.shareOpenId,j.shareOpenId,x.VERSION),e(i)):(j.DengLu(j.DengLu),console.log("wx no code"+i.errMsg))},fail:function(e){console.log("wx.login: failed, res="+e)}})}static ShowTxt(e){Laya.Browser.onWeiXin?Laya.Browser.window.wx.showToast({title:e}):console.log(e)}static OnShow(e){Laya.Browser.onWeiXin&&Laya.Browser.window.wx.onShow(e)}static OffShow(e){Laya.Browser.onWeiXin&&Laya.Browser.window.wx.offShow(e)}static OnHide(e){Laya.Browser.onWeiXin&&Laya.Browser.window.wx.onHide(e)}static OffHide(e){Laya.Browser.onWeiXin&&Laya.Browser.window.wx.offHide(e)}static ShortShake(){Laya.Browser.window.wx.vibrateShort({})}static LongShake(){Laya.Browser.window.wx.vibrateLong({})}static Shake(e=!0){Laya.Browser.onWeiXin&&j.shake&&(e?this.ShortShake():this.LongShake())}static LoadSubPackage(e,t){if(Laya.Browser.onWeiXin){Laya.Browser.window.wx.loadSubpackage({name:"subpackage",success:function(e){t&&t(!0),console.log("分包加载成功")},fail:function(e){t&&t(!1),console.log("分包加载失败")}})}else console.log("未进行分包加载"),t&&t(!0)}static stageShake(e=null,t=32){if(!this.isShake&&this.canshakestage){this.isShake=!0;var i=new Laya.Vector2(Laya.stage.x,Laya.stage.y);Laya.stage.timerLoop(t,this,this.shakeObject,[i,e])}}static shakeObject(e,t){var i=this.num++%4;this.offsetArr[this.num%2]=i<2?0:this.offset,Laya.stage.x=this.offsetArr[0]+e.x,Laya.stage.y=this.offsetArr[1]+e.y,this.num>4*this.times+1&&(Laya.stage.clearTimer(this,this.shakeObject),Laya.stage.pos(0,0),this.num=0,this.isShake=!1,null!=t&&t())}static UpdateGuide(e=0){var t=new Array;let i=(new Date).getTime();var a=JSON.stringify({guide:{ShowGuide:e,update_time:i.toString()}});t.push({key:"ShowGuide",value:a}),Laya.Browser.window.wx&&Laya.Browser.window.wx.setUserCloudStorage({KVDataList:t,success:i=>{console.log("KVDATALIST---",t),console.log("上传新手指引成功:"+e)}})}static UpdateScore(e){var t=new Array;let i=(new Date).getTime();var a=JSON.stringify({wxgame:{max_score:e,update_time:i.toString()}});t.push({key:"max_score",value:a}),Laya.Browser.window.wx&&Laya.Browser.window.wx.setUserCloudStorage({KVDataList:t,success:i=>{console.log("KVDATALIST---",t),console.log("上传分数成功:"+e)}})}static fengxiangtupian(e){if(null!=Laya.Browser.window.wx){var t=A.Instance.ServerTime;Laya.Browser.window.wx.aldShareAppMessage({title:"组团一起浪",imageUrl:"subpackage2/res/share/shareimage.png",query:"userId="+A.Instance.curplayerData.userId+"_"+t+"_"+Math.floor(9999*Math.random()).toString()})}}static AldEvent(e,t="用户id",i=""){}static AldStart(e){}static AldEnd(e,t){}}j.codeValue="",j.shareOpenId="",j.openId=0,j.shareScene="",j.uid="123",j.querychannel="",j.referrerInfoappId="",j.shake=!0,j.times=1.3,j.num=0,j.offsetArr=[0,0],j.offset=14,j.canshakestage=!1;class F{constructor(){F.ins=this}static get Instance(){return F.ins?F.ins:new F}static InitVideo(){Laya.Browser.onWeiXin&&(console.log(this.bannerAdUnitId),this.fsaasfafssfa=Laya.Browser.window.wx.createRewardedVideoAd({adUnitId:this.videlAdUnitId}),this.fsaasfafssfa.onLoad(()=>{console.log("激励视频 广告加载成功"),this.asfasfsaffsa=!0}),this.fsaasfafssfa.onError(e=>{console.log("激励视屏加载失败:"+e),this.asfasfsaffsa=!1}),this.afsfsaafsfsa=!0)}static ShowVideo(e){this.asfasfsaffsa&&(console.log("showVideoAd:"+this.asfasfsaffsa),this.SetVideoCallBack(e),this.fsaasfafssfa.show().catch(t=>{this.fsaasfafssfa.load().then(()=>{this.SetVideoCallBack(e),this.fsaasfafssfa.show()})}))}static SetVideoCallBack(e){this.fsaasfafssfa.offClose(),this.fsaasfafssfa.onClose(t=>{console.log("激励视频关闭:"+t.isEnded),t&&t.isEnded||void 0===t?e&&e(!0):e&&e(!1),this.fsaasfafssfa.offClose()})}static OpenBanner(e=0,t=null,i=!1){if(!Laya.Browser.onWeiXin)return void(t&&t(null));this.canshowbanner=!0;var a=this.bannerAdUnitId;console.log("adUnitId:"+a);let n=Laya.Browser.window.wx.createBannerAd({adUnitId:a,style:{left:0,top:0,width:460}});n.onError(e=>{console.log("广告错误onerror--"),console.log(e),t(null)}),n.onLoad(()=>{this.curbanner&&this.curbanner.destroy(),this.curbanner=n;var a=this.GetRealHight(e);null!=t&&t(a),this.canshowbanner&&!i?this.curbanner.show():this.curbanner.hide()})}static GetRealHight(e){if(this.curbanner){let t=Laya.Browser.window.wx.getSystemInfoSync();return this.curbanner.style.width=t.windowWidth,this.curbanner.style.top=t.windowHeight-this.curbanner.style.realHeight-e,Laya.stage.height/t.windowHeight*this.curbanner.style.realHeight}}static Clear(){Laya.timer.clearAll(this),Laya.Tween.clearAll(this),this.canshowbanner=!1,this.curbanner&&this.curbanner.hide()}static hidebanner(){Laya.Browser.onWeiXin&&this.curbanner&&this.curbanner.hide()}static showbanner(){Laya.Browser.onWeiXin&&this.curbanner&&this.curbanner.show()}static get cancheat(){return!1}static SetPosBanner(e,t){if(Laya.Browser.onPC)return void t(!1);let i=Laya.Browser.window.wx.getSystemInfoSync();var a=e.y*i.windowHeight/Laya.stage.height,n=this.bannerAdUnitId;console.log("adUnitId:"+n),this.curbanner&&this.curbanner.destroy();let s=Laya.Browser.window.wx.createBannerAd({adUnitId:n,style:{left:0,top:0,width:720}});s.onError(e=>{console.log(e),t(!1)}),s.onLoad(()=>{this.curbanner=s,this.curbanner.style.top=a,this.curbanner&&(console.log("banner show"),this.curbanner.show(),Laya.timer.once(2300,this,()=>{this.curbanner.style.top=i.windowHeight-F.bannerhigt,t(!0)}))}),s.onResize(e=>{F.bannerhigt=e.height,this.curbanner.style.width=i.windowWidth,this.curbanner.style.top=a})}static CheatBanner(e,t=null,i=0){A.Instance.curplayerData.Cheat?(e.y=Laya.stage.height-e.height-100,F.OpenBanner(i,i=>{if(null==i);else{console.log("cheatstart","bottom:100"),e.mouseEnabled=!1;var a=Laya.stage.height-i-e.height-20;console.log("y:"+a),Laya.timer.once(1e3,this,()=>{e.mouseEnabled=!0,this.showbanner(),Laya.Tween.to(e,{y:a},500,null,Laya.Handler.create(this,()=>{null!=t&&t()}))})}},!0)):(console.log("ignorecheat"),F.OpenBanner(0,e=>{null==e&&console.log("banner高度为null---")}))}showBanner(e=null,t=null){if(!Laya.Browser.onWeiXin)return;n.RandomANumber(0,3);let i=F.bannerAdUnitId,a=Laya.Browser.window.wx.createBannerAd({adUnitId:i,style:{left:0,top:0,width:460}});a.onLoad(()=>{console.log("[LOG] Banner广告加载成功"),this.hideBanner(),this._bannerAd=a;let t=Laya.Browser.window.wx.getSystemInfoSync();this._bannerAd.style.width=t.windowWidth,this._bannerAd.style.top=t.windowHeight-this._bannerAd.style.realHeight-20,this._bannerAd.show(),e&&e(this._bannerAd)}),a.onError(e=>{console.log("[LOG] Banner广告加载失败"),console.log(e),t&&t()})}hideBanner(){Laya.Browser.onWeiXin&&this._bannerAd&&(this._bannerAd.hide(),this._bannerAd.destroy(),this._bannerAd=null)}}F.videlAdUnitId="adunit-8feb4e40536601ff",F.bannerAdUnitId="adunit-426c9d6299d18f7e",F.afsfsaafsfsa=!1,F.asfasfsaffsa=!1,F.canshowbanner=!0,F.bannerhigt=0;class U extends I.LoadViewUI{constructor(){super(),this.progressnum=0,this.fast=.07,this.slow=.005,this.End=!1,this.EndProgress=!1,U.ins=this,Laya.stage.addChild(this),this.Init()}static get Instance(){return null==U.ins?new U:U.ins}Init(){this.Login(),Laya.timer.loop(1,this,this.UpdateProgress),this.height=Laya.stage.height,Laya.stage.on(Laya.Event.RESIZE,this,()=>{this.height=Laya.stage.height})}UpdateProgress(){this.progressnum<=.7?this.progressnum+=this.fast:this.progressnum>.7&&this.progressnum<.99?this.progressnum+=this.slow:this.End&&(this.progressnum+=this.slow),!this.EndProgress&&this.progressnum>=1&&(this.EndProgress=!0,this.progressnum=1,Laya.timer.clear(this,this.UpdateProgress),this.LoadComplete()),this.jindupro.value=this.progressnum}Login(){j.AldEvent("开始登陆"),Laya.Browser.onWeiXin?this.LoginWx():this.LoginLocal()}LoginWx(){Laya.Browser.onWeiXin?j.DengLu(e=>{"error"!=e?(j.AldEvent("微信登陆成功"),console.log("1微信登录成功:"+e),this.LoginLocal()):this.LoginWx()}):this.LoginLocal()}LoginLocal(){_.Instance.Login(null,Laya.Handler.create(this,this.LoginComplete),Laya.Handler.create(this,this.LoginFail))}LoginComplete(){j.AldEvent("本地服务器登陆成功"),console.log("本地服务器登陆成功"),F.InitVideo(),Laya.Browser.onWeiXin?this.LoadSubPackage():this.LoadScene()}LoginFail(){console.log("本地服务器登陆失败")}LoadSubPackage(){Laya.Browser.window.wx.loadSubpackage({name:"subpackage",success:e=>{j.AldEvent("分包1加载成功"),this.LoadSubPackage2()},fail:e=>{this.LoadSubPackage()}})}LoadSubPackage2(){Laya.Browser.window.wx.loadSubpackage({name:"subpackage2",success:e=>{j.AldEvent("分包2加载成功"),this.LoadScene()},fail:e=>{this.LoadSubPackage2()}})}LoadScene(){Laya.Scene3D.load(l.mainscene,Laya.Handler.create(this,e=>{this.mainscene=e,E.Instance.mainscene=this.mainscene,j.AldEvent("场景资源加载完毕"),this.LoadRole()})),console.log("场景资源加载成功")}LoadRole(){var e=[];for(let t=0;t<l.Character.length;t++){let i=l.Character[t];e.push(i)}Laya.loader.create(e,Laya.Handler.create(this,()=>{for(let e=0;e<l.Character.length;e++){let t=Laya.loader.getRes(l.Character[e]);E.Instance.Character.set(e+1,t),Laya.loader.clearRes(l.Character[e])}console.log("玩家模型加载成功"),j.AldEvent("玩家模型加载完毕"),this.LoadResources()}))}LoadResources(){var e=[];for(let t=0;t<l.Prop.length;t++){let i=l.Prop[t];e.push(i)}Laya.loader.create(e,Laya.Handler.create(this,()=>{e.forEach(e=>{if(1==e.progress){let t=Laya.loader.getRes(e.url);E.Instance.Prop.set(t.name,t)}else console.log(`[LOG]${e.url}加载失败`)},this),console.log("道具模型加载成功"),j.AldEvent("道具模型加载完毕"),this.complete()}))}complete(){this.End=!0,this.slow=this.fast,s.EventTrigger(t.LoadComplete)}LoadComplete(){this.destroy()}}class q{constructor(){if(window.Laya3D?Laya3D.init(e.width,e.height):Laya.init(e.width,e.height,Laya.WebGL),Laya.Physics&&Laya.Physics.enable(),Laya.DebugPanel&&Laya.DebugPanel.enable(),Laya.stage.scaleMode=e.scaleMode,Laya.stage.screenMode=e.screenMode,Laya.stage.alignV=e.alignV,Laya.stage.alignH=e.alignH,Laya.URL.exportSceneToJson=e.exportSceneToJson,(e.debug||"true"==Laya.Utils.getQueryString("debug"))&&Laya.enableDebugPanel(),e.physicsDebug&&Laya.PhysicsDebugDraw&&Laya.PhysicsDebugDraw.enable(),e.stat&&Laya.Stat.show(),Laya.alertGlobalError=!0,Laya.Browser.onWeiXin){if(Laya.Browser.window.wx.showShareMenu({withShareTicket:!0}),Laya.Browser.window.wx.onShareAppMessage(function(){return{title:"组团一起浪",imageUrl:"subpackage2/res/share/shareimage.png"}}),Laya.Browser.window.wx.onShow(e=>{e.shareTicket,e.query.userId,e.query.shareTitle;q.SceneNum=e.scene,j.querychannel=e.query.channel,j.shareOpenId=e.query.userId,console.log("scene:",e.scene),null!=j.querychannel&&console.log("onShow channel is:",j.querychannel),e.referrerInfo&&(j.referrerInfoappId=e.referrerInfo.appId,console.log("onShow appId is:",e.referrerInfo.appId))}),!Laya.Browser.onWeiXin)return;const e=Laya.Browser.window.wx.getUpdateManager();e.onCheckForUpdate(function(e){console.log("最新版本:"+e.hasUpdate)}),e.onUpdateReady(function(){Laya.Browser.window.wx.showModal({showCancel:!1,title:"更新提示",content:"新版本已经准备好,是否重启应用?",success(t){e.applyUpdate()},fail(t){e.applyUpdate()}})})}Laya.ResourceVersion.enable("version.json",Laya.Handler.create(this,this.onVersionLoaded),Laya.ResourceVersion.FILENAME_VERSION)}onVersionLoaded(){Laya.AtlasInfoManager.enable("fileconfig.json",Laya.Handler.create(this,this.onConfigLoaded))}onConfigLoaded(){new U}}q.SceneNum="123",new q}();