{
  "code": "import { DispatcherManager, StageState } from \"../GameUtils/EventManager\";\r\nimport HpBarBehav from \"./HpBarBehav\";\r\nimport { AnimatorManager } from \"../Manager/AnimatorManager\";\r\nimport { MateMove } from \"./MateMove\";\r\nexport default class BossBehav extends Laya.Script3D {\r\n    constructor() {\r\n        super();\r\n        this.dead = false;\r\n        this.canmove = true;\r\n        this.start = false;\r\n        this.play = false;\r\n        this._up = new Laya.Vector3(0, 1, 0);\r\n        this.quaternion1 = new Laya.Quaternion();\r\n    }\r\n    onAwake() {\r\n        this._gameobject = this.owner;\r\n        this._animator = this._gameobject.getComponent(Laya.Animator);\r\n        this.health = 100;\r\n        this.maxhealth = 100;\r\n        DispatcherManager.StageOn(StageState.ArriverAttack, this, this.Start);\r\n    }\r\n    onUpdate() {\r\n        if (!this.start)\r\n            return;\r\n        if (this.canmove) {\r\n            this.Attack();\r\n        }\r\n    }\r\n    Attack() {\r\n        if (!this.play) {\r\n            this.play = true;\r\n            AnimatorManager.Play(true, this._animator, \"atk\", false, Laya.Handler.create(this, () => {\r\n                this.play = false;\r\n                this._Attack();\r\n            }));\r\n        }\r\n    }\r\n    _Attack() {\r\n        if (this.target) {\r\n            let _matemove = this.target.getComponent(MateMove);\r\n            if (_matemove) {\r\n                _matemove.Killed();\r\n            }\r\n        }\r\n    }\r\n    Injured(_damega) {\r\n        if (this.health == 0)\r\n            return;\r\n        this.health -= _damega;\r\n        if (this.health <= 0) {\r\n            this.health = 0;\r\n            this.dead = true;\r\n        }\r\n    }\r\n    BossDie() {\r\n        this._animator.play(\"die2\");\r\n        this.canmove = false;\r\n    }\r\n    Start() {\r\n        this.start = true;\r\n        let _hp = this._gameobject.addComponent(HpBarBehav);\r\n    }\r\n    HideHpBar() {\r\n        let _hp = this._gameobject.getComponent(HpBarBehav);\r\n        if (_hp) {\r\n            _hp.destroy();\r\n        }\r\n    }\r\n    SetTarRotate(_trans) {\r\n        this.target = _trans;\r\n        this.targetpos = _trans.transform.position;\r\n        Laya.Quaternion.lookAt(this.targetpos, this._gameobject.transform.position, this._up, this.quaternion1);\r\n        this.quaternion1.invert(this.quaternion1);\r\n        this._gameobject.transform.rotation = this.quaternion1.clone();\r\n    }\r\n}\r\n//# sourceMappingURL=BossBehav.js.map",
  "references": [
    "E:/LayaProject/DanceLine/RubikCube/src/GameUtils/EventManager.ts",
    "E:/LayaProject/DanceLine/RubikCube/src/Game/HpBarBehav.ts",
    "E:/LayaProject/DanceLine/RubikCube/src/Manager/AnimatorManager.ts",
    "E:/LayaProject/DanceLine/RubikCube/src/Game/MateMove.ts"
  ],
  "map": "{\"version\":3,\"file\":\"BossBehav.js\",\"sourceRoot\":\"\",\"sources\":[\"../../../src/Game/BossBehav.ts\"],\"names\":[],\"mappings\":\"AAAA,OAAO,EAAE,iBAAiB,EAAE,UAAU,EAAE,MAAM,2BAA2B,CAAC;AAC1E,OAAO,UAAU,MAAM,cAAc,CAAC;AACtC,OAAO,EAAE,eAAe,EAAE,MAAM,4BAA4B,CAAC;AAC7D,OAAO,EAAE,QAAQ,EAAE,MAAM,YAAY,CAAC;AAEtC,MAAM,CAAC,OAAO,OAAO,SAAU,SAAQ,IAAI,CAAC,QAAQ;IAChD;QACI,KAAK,EAAE,CAAC;QAML,SAAI,GAAW,KAAK,CAAC;QACrB,YAAO,GAAW,IAAI,CAAC;QAEtB,UAAK,GAAW,KAAK,CAAC;QAgB9B,SAAI,GAAG,KAAK,CAAC;QA4Cb,QAAG,GAAgB,IAAI,IAAI,CAAC,OAAO,CAAC,CAAC,EAAC,CAAC,EAAC,CAAC,CAAC,CAAC;QACnC,gBAAW,GAAmB,IAAI,IAAI,CAAC,UAAU,EAAE,CAAC;IArE5D,CAAC;IASM,OAAO;QAEV,IAAI,CAAC,WAAW,GAAG,IAAI,CAAC,KAAsB,CAAC;QAC/C,IAAI,CAAC,SAAS,GAAG,IAAI,CAAC,WAAW,CAAC,YAAY,CAAC,IAAI,CAAC,QAAQ,CAAkB,CAAC;QAC/E,IAAI,CAAC,MA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