{
  "code": "import { GameManager } from \"./GameManager\";\r\nvar Vector2 = Laya.Vector2;\r\nexport default class Ball extends Laya.Script {\r\n    constructor() {\r\n        super();\r\n        this.TargetArray = [];\r\n        this.clear = false;\r\n        Ball.ins = this;\r\n    }\r\n    static get Instance() {\r\n        if (Ball.ins) {\r\n            return Ball.ins;\r\n        }\r\n        else {\r\n            return new Ball();\r\n        }\r\n    }\r\n    onAwake() {\r\n    }\r\n    onEnable() {\r\n        this.TargetArray = [];\r\n        this.owner.on(Laya.Event.CLICK, this, this.ClickBall);\r\n    }\r\n    onUpdate() {\r\n        if (this.clear) {\r\n            let _rig = this.owner.getComponent(Laya.RigidBody);\r\n            let _collider = this.owner.getComponent(Laya.CircleCollider);\r\n            _collider.onEnable = false;\r\n            _rig.onEnable = false;\r\n            this.Move(GameManager.Instance.TargetPosition);\r\n        }\r\n    }\r\n    onDestroy() {\r\n        this.owner.off(Laya.Event.CLICK, this, this.TweenMerge);\r\n    }\r\n    onTriggerEnter(other) {\r\n    }\r\n    onTriggerStay(other) {\r\n        let targetparent = other.owner;\r\n        this.TargetArray.push(targetparent);\r\n    }\r\n    onTriggerExit(other) {\r\n    }\r\n    Move(_position) {\r\n        console.log(\"移动方法执行---\");\r\n        let owner = this.owner;\r\n        let move = Laya.Tween.to(this.owner, {\r\n            x: _position.x, y: _position.y, update: new Laya.Handler(this, function () {\r\n            })\r\n        }, 500, Laya.Ease.linearInOut, Laya.Handler.create(this, () => {\r\n            move.clear();\r\n            this.owner.removeSelf();\r\n            this.owner.destroy();\r\n        }));\r\n    }\r\n    TweenMerge() {\r\n    }\r\n    ClickBall() {\r\n        console.log(\"点击到球了--\");\r\n        for (let i = 0; i < this.TargetArray.length; i++) {\r\n            if (this.TargetArray[i].name == \"RightCollider\" || this.TargetArray[i].name == \"LeftCollider\" || this.TargetArray[i].name == \"BottomCollider\") {\r\n                continue;\r\n            }\r\n            if (this.TargetArray[i] == null)\r\n                return;\r\n            let targetnum = this.TargetArray[i].getChildByName(\"num\");\r\n            console.log(\"目标数值为--\", Number(targetnum.value));\r\n            let ownernum = this.owner.getChildByName(\"num\");\r\n            console.log(\"点击到的数值为--\", Number(ownernum.value));\r\n            if (Number(targetnum.value) == Number(ownernum.value)) {\r\n                let owner = this.owner;\r\n                GameManager.Instance.TargetPosition = new Vector2(owner.x, owner.y);\r\n                let ball = this.TargetArray[i].getComponent(Ball);\r\n                ball.clear = true;\r\n            }\r\n        }\r\n    }\r\n}\r\n//# sourceMappingURL=Ball.js.map",
  "references": [
    "E:/LayaProject/BlastToMerge/src/Tool/GameTools.ts",
    "E:/LayaProject/BlastToMerge/src/Main/GameManager.ts"
  ],
  "map": "{\"version\":3,\"file\":\"Ball.js\",\"sourceRoot\":\"\",\"sources\":[\"../../../src/Main/Ball.ts\"],\"names\":[],\"mappings\":\"AACA,OAAO,EAAE,WAAW,EAAE,MAAM,eAAe,CAAC;AAC5C,IAAO,OAAO,GAAG,IAAI,CAAC,OAAO,CAAC;AAC9B,MAAM,CAAC,OAAO,OAAO,IAAK,SAAQ,IAAI,CAAC,MAAM;IAMzC;QACI,KAAK,EAAE,CAAC;QAJL,gBAAW,GAAG,EAAE,CAAC;QAEhB,UAAK,GAAG,KAAK,CAAC;QAGlB,IAAI,CAAC,GAAG,GAAG,IAAI,CAAC;IACpB,CAAC;IACM,MAAM,KAAK,QAAQ;QACtB,IAAG,IAAI,CAAC,GAAG,EAAC;YACR,OAAO,IAAI,CAAC,GAAG,CAAA;SAClB;aACG;YACA,OAAO,IAAI,IAAI,EAAE,CAAC;SACrB;IACL,CAAC;IACD,OAAO;IAEP,CAAC;IACD,QAAQ;QACJ,IAAI,CAAC,WAAW,GAAG,EAAE,CAAC;QACtB,IAAI,CAAC,KAAK,CAAC,EAAE,CAAC,IAAI,CAAC,KAAK,CAAC,KAAK,EAAC,IAAI,EAAC,IAAI,CAAC,SAAS,CAAC,CAAC;IAIxD,CAAC;IACD,QAAQ;QACJ,IAAG,IAAI,CAAC,KAAK,EAAC;Y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