| 12345678910111213141516171819202122232425262728293031323334 |
- import gameUI from "../UIFace/gameUI";
- const {ccclass, property} = cc._decorator;
- @ccclass
- export default class TowerData {
- static _instance: TowerData = null!;
- public static instance()
- {
- if (!this._instance)
- {
- this._instance = new TowerData();
- }
- return this._instance;
- }
- public getTowerPos(level:number):cc.Vec2[]
- {
- let levelpos1 = [];
- let leth = gameUI.instance.myDataObj.LevelData.coordinate_x.length;
- for (let i = 0; i < leth; i++) {
- const xxx = gameUI.instance.myDataObj.LevelData.coordinate_x[i];
- const yyy = gameUI.instance.myDataObj.LevelData.coordinate_y[i];
- let onepos = cc.v2(xxx,yyy);
- levelpos1.push(onepos);
- }
-
- return levelpos1;
- }
-
- }
|