{
  "code": "import { LevelController } from \"../Game/LevelController\";\r\nimport { GlobalParam } from \"../Net/GlobalParam\";\r\nimport { MainRoleManager } from \"./MainRoleManager\";\r\nimport { MateManager } from \"./MateManager\";\r\nimport { RoleManager } from \"./RoleManager\";\r\nimport { DispatcherManager, EventType } from \"../Game/DispatcherManager\";\r\nimport { GameManager } from \"../Game/GameManager\";\r\nvar Sprite = Laya.Sprite;\r\nvar Text = Laya.Text;\r\nexport class PlaneManager {\r\n    constructor() {\r\n        this.airisshow = false;\r\n        this.danceindex = 0;\r\n    }\r\n    static get Instance() {\r\n        return this.instance || (this.instance = new PlaneManager());\r\n    }\r\n    Init(finalP) {\r\n        if (!finalP) {\r\n            console.error(\"飞机不存在\");\r\n            return;\r\n        }\r\n        this.finalTra = finalP.transform;\r\n        this.jumpCamTra = finalP.getChildByName(\"jumpCamPos\").transform;\r\n        this.FinalBlock = finalP.getChildAt(0);\r\n        this.EnemySpawnPoint = this.FinalBlock.getChildByName(\"EnemySpawnPoint\").transform;\r\n        this.PlayerDancePoint = this.FinalBlock.getChildByName(\"PlayerDancePoint\");\r\n        this.helicopter = this.FinalBlock.getChildByName(\"helicopter\");\r\n        this.toured = this.FinalBlock.getChildByName(\"toured\").transform;\r\n        this.FinalBlock.active = false;\r\n    }\r\n    SetAir() {\r\n        this.danceindex = 0;\r\n        this.airisshow = false;\r\n        this.FinalBlock.active = false;\r\n        let count = LevelController.Instance._level.road_list.length;\r\n        this.winPos = (count) * GlobalParam.barrierRoadLength;\r\n        this.finalTra.localPositionZ = this.winPos;\r\n        this.stageProLen = this.winPos - MainRoleManager.Instance.playerStartTra.localPositionZ;\r\n        let isgold = LevelController.Instance._level.isgold;\r\n        this.helicopter.active = isgold;\r\n        this.toured1 = this.FinalBlock.getChildByName(\"toured1\").transform.position.clone();\r\n        this.toured2 = this.FinalBlock.getChildByName(\"toured2\").transform.position.clone();\r\n    }\r\n    createDarkOrchidRect() {\r\n        var darkOrchidRect = new Sprite();\r\n        darkOrchidRect.name = \"暗紫色矩形容器\";\r\n        darkOrchidRect.graphics.drawRect(-100, -100, 200, 200, \"#9932CC\");\r\n        darkOrchidRect.pos(Laya.stage.width / 2, Laya.stage.height / 2);\r\n        Laya.stage.addChild(darkOrchidRect);\r\n        darkOrchidRect.mouseThrough = true;\r\n    }\r\n    createLogger() {\r\n        this.logger = new Text();\r\n        this.logger.size(Laya.stage.width, Laya.stage.height);\r\n        this.logger.align = 'right';\r\n        this.logger.fontSize = 20;\r\n        this.logger.color = \"#FFFFFF\";\r\n        Laya.stage.addChild(this.logger);\r\n    }\r\n    CheckPlayerRoadPos(_zp) {\r\n        let d = this.winPos - _zp;\r\n        if (d <= 60 && !this.airisshow) {\r\n            this.ShowAir();\r\n            return;\r\n        }\r\n        DispatcherManager.event(EventType.Event.SetStagePro, (this.stageProLen - d) / this.stageProLen);\r\n        if (d <= 0) {\r\n            this.NearDestination();\r\n        }\r\n    }\r\n    ShowAir() {\r\n        this.airisshow = true;\r\n        this.FinalBlock.active = true;\r\n    }\r\n    NearDestination() {\r\n        MainRoleManager.Instance.Destination();\r\n        if (LevelController.Instance._level.isgold) {\r\n            GameManager.Instance.Congratulate(true);\r\n        }\r\n        else {\r\n            let count = 0;\r\n            let isdesd = MainRoleManager.Instance.NearIsdead();\r\n            if (!isdesd) {\r\n                count++;\r\n            }\r\n            let num = MateManager.Instance.NearDestination();\r\n            count += num;\r\n            if (count == 0)\r\n                return;\r\n            MateManager.Instance.Near(count, this.toured.position.z);\r\n            if (!isdesd)\r\n                MainRoleManager.Instance.Near(count, this.toured.position.z);\r\n            Laya.timer.once(1300, this, this.CreateOpponent);\r\n        }\r\n    }\r\n    CreateOpponent() {\r\n        MainRoleManager.Instance.Attack();\r\n        MateManager.Instance.Attack();\r\n        RoleManager.Instance.CreateOpponent(this.EnemySpawnPoint.position.clone());\r\n    }\r\n    GetWuDaoPosition() {\r\n        if (this.danceindex > this.PlayerDancePoint.numChildren - 1)\r\n            return null;\r\n        let t = this.PlayerDancePoint.getChildAt(this.danceindex).transform;\r\n        this.danceindex++;\r\n        return t;\r\n    }\r\n}\r\n//# sourceMappingURL=PlaneManager.js.map",
  "references": [
    "E:/LayaProject/gungang/src/Game/LevelController.ts",
    "E:/LayaProject/gungang/src/Net/GlobalParam.ts",
    "E:/LayaProject/gungang/src/Manager/MainRoleManager.ts",
    "E:/LayaProject/gungang/src/Manager/MateManager.ts",
    "E:/LayaProject/gungang/src/Manager/RoleManager.ts",
    "E:/LayaProject/gungang/src/Game/DispatcherManager.ts",
    "E:/LayaProject/gungang/src/Game/GameManager.ts"
  ],
  "map": "{\"version\":3,\"file\":\"PlaneManager.js\",\"sourceRoot\":\"\",\"sources\":[\"../../../src/Manager/PlaneManager.ts\"],\"names\":[],\"mappings\":\"AAEA,OAAO,EAAC,eAAe,EAAC,MAAM,yBAAyB,CAAC;AACxD,OAAO,EAAE,WAAW,EAAE,MAAM,oBAAoB,CAAC;AACjD,OAAO,EAAC,eAAe,EAAC,MAAM,mBAAmB,CAAC;AAClD,OAAO,EAAC,WAAW,EAAC,MAAM,eAAe,CAAC;AAC1C,OAAO,EAAC,WAAW,EAAC,MAAM,eAAe,CAAC;AAE1C,OAAO,EAAE,iBAAiB,EAAE,SAAS,EAAE,MAAM,2BAA2B,CAAC;AACzE,OAAO,EAAC,WAAW,EAAC,MAAM,qBAAqB,CAAC;AAEhD,IAAO,MAAM,GAAG,IAAI,CAAC,MAAM,CAAC;AAE5B,IAAO,IAAI,GAAG,IAAI,CAAC,IAAI,CAAC;AAKxB,MAAM,OAAQ,YAAY;IAA1B;QA8BY,cAAS,GAAG,KAAK,CAAC;QA6ElB,eAAU,GAAG,CAAC,CAAC;IAQ3B,CAAC;IAjHU,MAAM,KAAK,QAAQ;QACtB,OAAO,IAAI,CAAC,QAAQ,IAAI,CAAC,IAAI,CAAC,QAAQ,GAAG,IAAI,YAAY,EAAE,CAAC,CAAC;IACjE,CAAC;IAWM,IAAI,CAAC,MAAgB;QACxB,IAAI,CAAC,M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