{
  "code": "import { LevelManager } from \"./LevelManager\";\r\nimport { AssetManager } from \"../Resources/AssetManager\";\r\nimport { MateMove } from \"../Game/MateMove\";\r\nexport class PlayerManager {\r\n    constructor() {\r\n        this.canmove = false;\r\n        this.trun = true;\r\n        this.first = 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        if (this.player == null) {\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        }\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    }\r\n    EnablePlayer() {\r\n        let _move = this.player.addComponent(MateMove);\r\n        _move.Tag_Head = true;\r\n        Laya.stage.on(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        Laya.stage.off(Laya.Event.MOUSE_DOWN, this, this.OnMouseDown);\r\n    }\r\n    OnMouseDown() {\r\n        if (this.first) {\r\n            this.first = false;\r\n            return;\r\n        }\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//# 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/RubikC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