-
Creator 版本:2.4
-
目标平台:
-
重现方式:
-
首个报错:
-
之前哪个版本是正常的:
-
手机型号:
-
手机浏览器:
-
编辑器操作系统:
-
重现概率:
@property(cc.TiledMap)
tiledMap: cc.TiledMap = null;
start () {
console.log(this.tiledMap);
let tiledSize = this.tiledMap.getTileSize();
let layer = this.tiledMap.getLayer('wall');
let layerSize = layer.getLayerSize();
}
报错Uncaught TypeError: Cannot read property ‘getTileSize’ of null。已经关联成功了。并且我作为debug的 console.log(this.tiledMap);在控制台也输出了tildmap的属性。而且很奇怪的是控制台里面也展示了tildmap的大小,但是为什么getTileSize就是获取不了呢?