在code中這樣寫:
properties: {
stopRollLoc: {
default: [],
type: [][cc.Integer]
},
}
會出現以下的警告:
The ‘type’ attribute of ‘roll.stopRollLoc’ is undefined when loading script
請問有大大遇到同樣的情況嗎?
在code中這樣寫:
properties: {
stopRollLoc: {
default: [],
type: [][cc.Integer]
},
}
會出現以下的警告:
The ‘type’ attribute of ‘roll.stopRollLoc’ is undefined when loading script
請問有大大遇到同樣的情況嗎?
js中没有x = [ ][ ] 定义二维数组的语法吧!
你想定义二维数组属性可以尝试先定义一个类比如MyClass,这个类中有一个维数组的属性定义,
再将这个MyClass定义为你的组件类的一个属性
let MyClass = cc.Class({
properties: {
item: [cc.Integer]
}
});
cc.Class({
extends: cc.Component,
properties: {
itemArray: [MyClass]
}
});
在属性编辑器中如下所示
可以用了~ 感謝你^^
现在这种3.x用 ts 怎么写