{
  "code": "import { GameTools } from \"../Tool/GameTools\";\r\nimport InGameView from \"../View/InGameView\";\r\nimport { JsonManager } from \"../Tool/JsonManager\";\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        this.STAGE = 5;\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        Laya.timer.once(100, this, () => {\r\n            this.FallDown(50);\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        InGameView.Instance.prefabbox.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        InGameView.Instance.prefabbox.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    ProcessScore(_num) {\r\n        for (let i = 0; i < this.BallPrefab.length; i++) {\r\n            if (_num == Number(this.BallPrefab[i])) {\r\n                return Number(this.BallPrefab[i]);\r\n            }\r\n            if (_num > Number(this.BallPrefab[i]) && _num < Number(this.BallPrefab[i + 1])) {\r\n                return Number(this.BallPrefab[i]);\r\n            }\r\n        }\r\n    }\r\n    FallDown(_time = 2) {\r\n        let level = JsonManager.Level;\r\n        let stage = level[GameManager.Instance.STAGE - 1];\r\n        let edge = stage.edge.split(\";\");\r\n        let min = Number(edge[0]);\r\n        let minnext = Number(edge[1]);\r\n        let minball = Number(this.BallPrefab[min - 1]);\r\n        let minnextball = Number(this.BallPrefab[minnext - 1]);\r\n        InGameView.Instance.MinBall = minball;\r\n        InGameView.Instance.MinNextBall = minnextball;\r\n        let max = Number(edge[edge.length - 1]);\r\n        for (let j = 0; j < _time; j++) {\r\n            let num = GameTools.RandomANumber(min, max + 1);\r\n            let X = GameTools.RandomANumber(100, 500);\r\n            let pos = new Laya.Vector2(X, -30);\r\n            this.CreatPrefab2(num - 1, pos);\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",
    "E:/LayaProject/BlastToMerge/src/View/InGameView.ts",
    "E:/LayaProject/BlastToMerge/src/Tool/JsonManager.ts"
  ],
  "map": "{\"version\":3,\"file\":\"GameManager.js\",\"sourceRoot\":\"\",\"sources\":[\"../../../src/Main/GameManager.ts\"],\"names\":[],\"mappings\":\"AAAA,OAAO,EAAE,SAAS,EAAE,MAAM,mBAAmB,CAAC;AAE9C,OAAO,UAAU,MAAM,oBAAoB,C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