{
  "code": "import { GameTools } from \"../GameUtils/GameTools\";\r\nimport { PlayerManager } from \"./PlayerManager\";\r\nimport { DispatcherManager, StageState } from \"../GameUtils/EventManager\";\r\nimport { AccountManager } from \"../NetWork/AccountManager\";\r\nexport class CameraManager {\r\n    constructor() {\r\n        this.LeftPosition = new Laya.Vector3(3.65, 5.72, -4.52);\r\n        this.LeftRotate = new Laya.Vector3(-24, 145, 0);\r\n        this.RightPosition = new Laya.Vector3(-3.78, 4.87, -4.46);\r\n        this.RightRotate = new Laya.Vector3(-24, -145, 0);\r\n        this.poschazhi = new Laya.Vector3();\r\n        this.gengsuipos = new Laya.Vector3();\r\n        this.lllpos = new Laya.Vector3();\r\n        this.hights = 0;\r\n        this.wights = 0;\r\n        CameraManager.ins = this;\r\n        DispatcherManager.StageOn(StageState.Start, this, this.CameraFollow);\r\n        DispatcherManager.StageOn(StageState.Win, this, this.CameraCancelFollow);\r\n        DispatcherManager.StageOn(StageState.Lose, this, this.CameraCancelFollow);\r\n    }\r\n    static get Instance() {\r\n        if (CameraManager.ins == null) {\r\n            return new CameraManager();\r\n        }\r\n        return CameraManager.ins;\r\n    }\r\n    Init() {\r\n        let Direction = AccountManager.Instance.curplayerData.LevelDirection;\r\n        if (Direction == 1) {\r\n            this.camera.transform.position = this.LeftPosition;\r\n            this.camera.transform.rotationEuler = this.LeftRotate;\r\n        }\r\n        else {\r\n            this.camera.transform.position = this.RightPosition;\r\n            this.camera.transform.rotationEuler = this.RightRotate;\r\n        }\r\n        this.CameraFollow();\r\n    }\r\n    CameraFollow() {\r\n        this.hights = 0;\r\n        this.wights = 0;\r\n        Laya.Vector3.subtract(PlayerManager.Instance.player.transform.position, this.camera.transform.position, this.poschazhi);\r\n        Laya.timer.frameLoop(1, this, this.GenSui);\r\n    }\r\n    GenSui() {\r\n        Laya.Vector3.subtract(PlayerManager.Instance.player.transform.position, this.poschazhi, this.gengsuipos);\r\n        this.hights = GameTools.Instance.lerp(this.hights, 1, 0.03);\r\n        this.wights = GameTools.Instance.lerp(this.wights, 1, 0.05);\r\n        this.gengsuipos = new Laya.Vector3(this.gengsuipos.x, this.gengsuipos.y, this.gengsuipos.z);\r\n        Laya.Vector3.lerp(this.camera.transform.position, this.gengsuipos, 0.25, this.lllpos);\r\n        this.lllpos = new Laya.Vector3(this.gengsuipos.x, this.lllpos.y, this.lllpos.z);\r\n        this.camera.transform.position = this.lllpos;\r\n    }\r\n    CameraCancelFollow() {\r\n        Laya.timer.clear(this, this.GenSui);\r\n    }\r\n}\r\n//# sourceMappingURL=CameraManager.js.map",
  "references": [
    "E:/LayaProject/DanceLine/RubikCube/src/GameUtils/GameTools.ts",
    "E:/LayaProject/DanceLine/RubikCube/src/Manager/PlayerManager.ts",
    "E:/LayaProject/DanceLine/RubikCube/src/GameUtils/EventManager.ts",
    "E:/LayaProject/DanceLine/RubikCube/src/Resources/AssetManager.ts",
    "E:/LayaProject/DanceLine/RubikCube/src/NetWork/AccountManager.ts"
  ],
  "map": "{\"version\":3,\"file\":\"CameraManager.js\",\"sourceRoot\":\"\",\"sources\":[\"../../../src/Manager/CameraManager.ts\"],\"names\":[],\"mappings\":\"AAAA,OAAO,EAAE,SAAS,EAAE,MAAM,wBAAwB,CAAC;AACnD,OAAO,EAAE,aAAa,EAAE,MAAM,iBAAiB,CAAC;AAChD,OAAO,EAAE,iBAAiB,EAAE,UAAU,EAAE,MAAM,2BAA2B,CAAC;AAE1E,OAAO,EAAE,cAAc,EAAE,MAAM,2BAA2B,CAAC;AAE3D,MAAM,OAAO,aAAa;IAEtB;QAcO,iBAAY,GAAgB,IAAI,IAAI,CAAC,OAAO,CAAC,IAAI,EAAC,IAAI,EAAC,CAAC,IAAI,CAAC,CAAC;QAC9D,eAAU,GAAgB,IAAI,IAAI,CAAC,OAAO,CAAC,CAAC,EAAE,EAAC,GAAG,EAAC,CAAC,CAAC,CAAA;QACrD,kBAAa,GAAgB,IAAI,IAAI,CAAC,OAAO,CAAC,CAAC,IAAI,EAAC,IAAI,EAAC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