{
  "code": "import { GameTools } from \"../Tool/GameTools\";\r\nexport default class GameManager extends Laya.Script {\r\n    constructor() {\r\n        super();\r\n        this.prafabbox = new Laya.Sprite();\r\n        this.BallPrefab = new Array(\"2\", \"4\", \"8\", \"16\", \"32\", \"64\", \"128\", \"256\", \"512\", \"1024\", \"2048\", \"4096\", \"8192\", \"16384\");\r\n        this.Cloned = false;\r\n        this.PrefabControl = [];\r\n        this.ScoreRecord = 0;\r\n        this.ScoreProgress = 0;\r\n        GameManager.ins = this;\r\n        Laya.stage.addChild(this.prafabbox);\r\n    }\r\n    static get Instance() {\r\n        if (GameManager.ins) {\r\n            return GameManager.ins;\r\n        }\r\n        else {\r\n            return new GameManager();\r\n        }\r\n    }\r\n    onAwake() {\r\n        for (let i = 0; i < 14; i++) {\r\n            this.ReadJSON(i);\r\n        }\r\n    }\r\n    ReadJSON(i) {\r\n        Laya.loader.create(\"Prefab/\" + this.BallPrefab[i] + \".json\", Laya.Handler.create(this, this.creat));\r\n    }\r\n    creat(Prefab) {\r\n        let obj = new Laya.Prefab();\r\n        obj.json = Prefab;\r\n        this.PrefabControl.push(obj);\r\n    }\r\n    CreatPrefab(id, _pos) {\r\n        let ball = this.PrefabControl[id];\r\n        let pre = Laya.Pool.getItemByCreateFun(this.BallPrefab[id], ball.create, ball);\r\n        pre.pos(_pos.x, _pos.y);\r\n        this.prafabbox.addChild(pre);\r\n        this.Cloned = true;\r\n    }\r\n    CreatPrefab2(id, _pos) {\r\n        let ball = this.PrefabControl[id];\r\n        let pre = Laya.Pool.getItemByCreateFun(this.BallPrefab[id], ball.create, ball);\r\n        pre.pos(_pos.x, _pos.y);\r\n        this.prafabbox.addChild(pre);\r\n    }\r\n    PrecossData(_num) {\r\n        for (let i = 0; i < this.BallPrefab.length; i++) {\r\n            if (_num == Number(this.BallPrefab[i])) {\r\n                return i;\r\n            }\r\n            if (_num > Number(this.BallPrefab[i]) && _num < Number(this.BallPrefab[i + 1])) {\r\n                return i;\r\n            }\r\n        }\r\n    }\r\n    FallDown() {\r\n        for (let i = 0; i < 2; i++) {\r\n            let num = Math.random();\r\n            let X = GameTools.RandomANumber(100, 300);\r\n            let pos = new Laya.Vector2(X, -30);\r\n            if (num <= 0.3) {\r\n                this.CreatPrefab2(1, pos);\r\n            }\r\n            else if (num > 0.3 && num < 0.6) {\r\n                this.CreatPrefab2(2, pos);\r\n            }\r\n            else if (num >= 0.6) {\r\n                this.CreatPrefab2(3, pos);\r\n            }\r\n        }\r\n    }\r\n    onKeyDown(e) {\r\n        if (e.keyCode == 32) {\r\n            let num = Math.random();\r\n            let pos = new Laya.Vector2(100, -30);\r\n            if (num <= 0.3) {\r\n                this.CreatPrefab2(1, pos);\r\n            }\r\n            else if (num > 0.3 && num < 0.6) {\r\n                this.CreatPrefab2(2, pos);\r\n            }\r\n            else if (num >= 0.6) {\r\n                this.CreatPrefab2(3, pos);\r\n            }\r\n        }\r\n    }\r\n}\r\n//# sourceMappingURL=GameManager.js.map",
  "references": [
    "E:/LayaProject/BlastToMerge/src/Tool/GameTools.ts",
    "E:/LayaProject/BlastToMerge/src/Tool/EventManager.ts"
  ],
  "map": "{\"version\":3,\"file\":\"GameManager.js\",\"sourceRoot\":\"\",\"sources\":[\"../../../src/Main/GameManager.ts\"],\"names\":[],\"mappings\":\"AAAA,OAAO,EAAE,SAAS,EAAE,MAAM,mBAAmB,CAAC;AAG9C,MAAM,CAAC,OAAO,OAAO,WAAY,SAAQ,IAAI,CAAC,MAAM;IAiBhD;QACI,KAAK,EAAE,CAAC;QAdL,cAAS,GAAe,IAAI,IAAI,CAAC,MAAM,EAAE,CAAC;QAC1C,eAAU,GAAY,IAAI,KAAK,CAAS,GAAG,EAAC,GAAG,EAAC,GAAG,EAAC,IAAI,EAAC,IAAI,EAAC,IAAI,EAAC,KAAK,EAAC,KAAK,EAAC,KAAK,EAAC,MAAM,EAAC,MAAM,EAAC,MAAM,EAAC,MAAM,EAAC,OAAO,CAAC,CAAC;QAE1H,WAAM,GAAW,KAAK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