{
  "code": "import { LevelManager } from \"./LevelManager\";\r\nimport { AssetManager } from \"../Resources/AssetManager\";\r\nimport { MateMove } from \"../Game/MateMove\";\r\nimport { AccountManager } from \"../NetWork/AccountManager\";\r\nexport class PlayerManager {\r\n    constructor() {\r\n        this.canmove = false;\r\n        this.trun = true;\r\n        PlayerManager.ins = this;\r\n    }\r\n    static get Instance() {\r\n        if (PlayerManager.ins == null) {\r\n            return new PlayerManager();\r\n        }\r\n        return PlayerManager.ins;\r\n    }\r\n    Init() {\r\n        this.Direction = AccountManager.Instance.curplayerData.LevelDirection;\r\n        let playerpref = AssetManager.Instance.Character.get(1);\r\n        this.player = Laya.Sprite3D.instantiate(playerpref);\r\n        LevelManager.Instance.spritepool.addChild(this.player);\r\n        this.player.transform.position = AssetManager.Instance.playerpos.transform.position.clone();\r\n        this.player.transform.rotation = AssetManager.Instance.playerpos.transform.rotation.clone();\r\n        this.trun = true;\r\n    }\r\n    RefreshPro() {\r\n        let startpoint = AssetManager.Instance.playerpos.transform.position.clone();\r\n        let Z = startpoint.z;\r\n        let finishpoint = AssetManager.Instance.finishpoint.z;\r\n        let distance = finishpoint - Z;\r\n        let pro = this.player.transform.position.z / distance;\r\n        return pro;\r\n    }\r\n    EnablePlayer() {\r\n        let _move = this.player.addComponent(MateMove);\r\n        _move.Tag_Head = true;\r\n        this.ListenOn();\r\n    }\r\n    ListenOn() {\r\n        Laya.stage.on(Laya.Event.MOUSE_DOWN, this, this.OnMouseDown);\r\n    }\r\n    ListenOff() {\r\n        Laya.stage.off(Laya.Event.MOUSE_DOWN, this, this.OnMouseDown);\r\n    }\r\n    DisablePlayer() {\r\n        let _move = this.player.getComponent(MateMove);\r\n        if (_move) {\r\n            _move.destroy();\r\n        }\r\n    }\r\n    OnMouseDown() {\r\n        if (this.Direction == 1) {\r\n            if (this.trun) {\r\n                this.player.transform.rotationEuler = new Laya.Vector3(0, -90, 0);\r\n                this.trun = !this.trun;\r\n            }\r\n            else {\r\n                this.player.transform.rotationEuler = new Laya.Vector3(0, 0, 0);\r\n                this.trun = !this.trun;\r\n            }\r\n        }\r\n        else if (this.Direction == 2) {\r\n            if (this.trun) {\r\n                this.player.transform.rotationEuler = new Laya.Vector3(0, 90, 0);\r\n                this.trun = !this.trun;\r\n            }\r\n            else {\r\n                this.player.transform.rotationEuler = new Laya.Vector3(0, 0, 0);\r\n                this.trun = !this.trun;\r\n            }\r\n        }\r\n    }\r\n}\r\n//# sourceMappingURL=PlayerManager.js.map",
  "references": [
    "E:/LayaProject/DanceLine/RubikCube/src/Manager/LevelManager.ts",
    "E:/LayaProject/DanceLine/RubikCube/src/Resources/AssetManager.ts",
    "E:/LayaProject/DanceLine/RubikCube/src/Manager/MateManager.ts",
    "E:/LayaProject/DanceLine/RubikCube/src/Game/MateMove.ts",
    "E:/LayaProject/DanceLine/RubikCube/src/NetWork/AccountManager.ts"
  ],
  "map": "{\"version\":3,\"file\":\"PlayerManager.js\",\"sourceRoot\":\"\",\"sources\":[\"../../../src/Manager/PlayerManager.ts\"],\"names\":[],\"mappings\":\"AAAA,OAAO,EAAE,YAAY,EAAE,MAAM,gBAAgB,CAAC;AAC9C,OAAO,EAAE,YAAY,EAAE,MAAM,2BAA2B,CAAC;AAEzD,OAAO,EAAE,QAAQ,EAAE,MAAM,kBAAkB,CAAC;AAC5C,OAAO,EAAE,cAAc,EAAE,MAAM,2BAA2B,CAAC;AAE3D,MAAM,OAAO,aAAa;IAEtB;QAaO,YAAO,GAAW,KAAK,CAAC;QAsC/B,SAAI,GAAG,IAAI,CAAC;QAlDR,aAAa,CAAC,GAAG,GAAG,IAAI,CAAC;IAC7B,CAAC;IACM,MAAM,KAAK,QAAQ;QACtB,IAAG,aAAa,CAAC,GAAG,IAAI,IAAI,EAAC;YACzB,OAAO,IAAI,aAAa,EAAE,CAAC;SAC9B;QACD,OAAO,aAAa,CAAC,GAAG,CAAC;IAC7B,CAAC;IAQD,IAAI;QACA,IAAI,CAAC,SAAS,GAAG,cAAc,CAAC,QAAQ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