没做过3d,想自己研究一下,我创建了一个Cube预制体,现在想获取这个预制体实例的长宽高。不知道怎么弄。
@property({ type: Prefab })
public cubePrfb: Prefab = null;
start() {
this.generateRoad();
}
lateUpdate() {
}
generateRoad() {
this.node.removeAllChildren();
let cube1: Node = cc.instantiate(this.cubePrfb);
cube1.getContentSize();//结果是null
}
而且getContentSize方法获得的也是二维尺寸啊。
现在感觉一头雾水。