为何我的项目从2.0.10升级到2.1.3以后,以前显示在地图上的对象位置全部错乱了
这是之前位置计算的代码片段
initOrchard(data) {
let datapots = data;
let _orchardArray = this.orchardObjectGroup.getObjects();
let height = this.orchardObjectGroup.node.getContentSize().height;
for (let i = 0; i < _orchardArray.length; i++) {
let property = _orchardArray[i];
let id = parseInt(property["name"].split("orchard")[1]);
property.y = height - property.y;
let idx = id - 1;
let pos = cc.v2(property.x / property.width, property.y / property.height);
pos = this.floorLayer.getPositionAt(pos);
let newPlant = cc.instantiate(this.orchardPre);
newPlant.setPosition(pos);
newPlant.name = property["name"];
this.spriteLayer.addChild(newPlant);
}
},