{
  "code": "import { ui } from \"../ui/layaMaxUI\";\r\nimport { GameManager, GameState } from \"../Scripts/Game/GameManager\";\r\nimport { ResourcesManager } from \"../Scripts/Game/ResourcesManager\";\r\nimport PoolManager from \"../Scripts/Game/PoolManager\";\r\nimport WxApi from \"../WXSDK/wxsdk\";\r\nimport { Player } from \"../Scripts/Game/Player\";\r\nimport { LevelManager } from \"../Scripts/Game/LevelManager\";\r\nimport ADPlayer from \"../WXSDK/ADPlayer\";\r\nimport { Main } from \"../Main\";\r\nimport { WindowManager, WindowType } from \"./WindowManager\";\r\nimport { RecommendWindow } from \"./RecommendWindow\";\r\nexport class ReviveWindow extends ui.Window.ReviveWindowUI {\r\n    constructor() {\r\n        super();\r\n        ReviveWindow.instance = this;\r\n    }\r\n    static get Instance() {\r\n        return ReviveWindow.instance;\r\n    }\r\n    OnOpen(_data = null) {\r\n        WxApi.Instance.recordAldEvent(\"进入复活界面\", \"1\");\r\n        this.passBtn.clickHandler = Laya.Handler.create(this, this.OnPassRevive);\r\n        this.reviveBtn.clickHandler = Laya.Handler.create(this, this.OnRevive, null, false);\r\n        this.stagepre.value = Player.Instance.CurLevelPrecent;\r\n        this.stagetex.value = LevelManager.Instance.curLevel.levelid.toString();\r\n        this.stageClip.value = Math.floor(Player.Instance.CurLevelPrecent * 100).toString();\r\n        this.getmoney.value = GameManager.Instance.gamegold.toString();\r\n        WindowManager.Instance.OpenPopView(WindowType.RecommendWindow);\r\n        RecommendWindow.Instance.ShowRecommendWindow(false, false, false, true, false);\r\n        ADPlayer.showBannerAd();\r\n        this.height = Laya.stage.height;\r\n    }\r\n    OnPassRevive() {\r\n        WxApi.Instance.recordAldEvent(\"点击跳过复活\", \"1\");\r\n        GameManager.Instance.ChangeState(GameState.End, false);\r\n    }\r\n    ReadyShow() {\r\n        this.showcarCamera = new Laya.Camera();\r\n        this.showScence.addChild(this.showcarCamera);\r\n        this.showlight = new Laya.DirectionLight();\r\n        this.showScence.addChild(this.showlight);\r\n        this.curstage = new Laya.Sprite3D();\r\n        this.showScence.addChild(this.curstage);\r\n        this.showcarCamera.viewport = new Laya.Viewport(this.showpan.x, this.showpan.y, this.showpan.width, this.showpan.height);\r\n        this.showcarCamera.clearFlag = 2;\r\n        this.showcarCamera.fieldOfView = 30;\r\n        this.showcarCamera.transform.position = new Laya.Vector3(0, 0.5, 1.1);\r\n        ResourcesManager.Instance.LoadPlayer(1, Laya.Handler.create(this, this.OnPlayerLoad, [1]));\r\n    }\r\n    OnPlayerLoad(_id, _model) {\r\n        var cursprite = _model.getChildAt(0);\r\n        this.cursprite = PoolManager.Instance.CreatMeshSprite3D(cursprite, \"\");\r\n        this.curanimator = this.cursprite.getChildAt(0).getComponent(Laya.Animator);\r\n        this.curstage.addChild(this.cursprite);\r\n        this.cursprite.transform.localPosition = new Laya.Vector3(0, 0, 0);\r\n        this.cursprite.transform.rotationEuler = new Laya.Vector3(-10, 0, 0);\r\n        var lookpos = new Laya.Vector3(this.cursprite.transform.position.x, this.cursprite.transform.position.y + 0.3, this.cursprite.transform.position.z + 0.01);\r\n        this.showcarCamera.transform.lookAt(lookpos, new Laya.Vector3(0, 1, 0));\r\n        Laya.timer.once(500, this, () => {\r\n            this.curanimator.play(\"lose\");\r\n        });\r\n    }\r\n    OnRevive() {\r\n        if (!Main.OnWx) {\r\n            GameManager.Instance.ReviveGame();\r\n            return;\r\n        }\r\n        WxApi.Instance.recordAldEvent(\"点击复活\", \"1\");\r\n        ADPlayer.showVideoAd((flag) => {\r\n            if (flag) {\r\n                WxApi.Instance.recordAldEvent(\"复活成功\", \"1\");\r\n                GameManager.Instance.ReviveGame();\r\n            }\r\n            else {\r\n                WxApi.Instance.recordAldEvent(\"复活失败\", \"1\");\r\n            }\r\n        });\r\n    }\r\n    OnHide() {\r\n    }\r\n}\r\n",
  "references": [
    "C:/Users/admin/Desktop/runner/src/Window/Component/IWindow.ts",
    "C:/Users/admin/Desktop/runner/src/ui/layaMaxUI.ts",
    "C:/Users/admin/Desktop/runner/src/Scripts/Game/GameManager.ts",
    "C:/Users/admin/Desktop/runner/src/Scripts/Game/ResourcesManager.ts",
    "C:/Users/admin/Desktop/runner/src/Scripts/Game/PoolManager.ts",
    "C:/Users/admin/Desktop/runner/src/WXSDK/wxsdk.ts",
    "C:/Users/admin/Desktop/runner/src/Scripts/Game/Player.ts",
    "C:/Users/admin/Desktop/runner/src/Scripts/Game/LevelManager.ts",
    "C:/Users/admin/Desktop/runner/src/WXSDK/ADPlayer.ts",
    "C:/Users/admin/Desktop/runner/src/Main.ts",
    "C:/Users/admin/Desktop/runner/src/Window/WindowManager.ts",
    "C:/Users/admin/Desktop/runner/src/Window/RecommendWindow.ts",
    "C:/Users/admin/Desktop/runner/src/Window/FriendPlayingWindow.ts"
  ]
}
