AAA.js
var AAA = cc.Class({
properties: {
vec: [AAA]
},
…
});
module.exports=AAA;
但是这样编译不过.
The “type” attribute of “.vec” is undefined when loading script.
AAA.js
var AAA = cc.Class({
properties: {
vec: [AAA]
},
…
});
module.exports=AAA;
但是这样编译不过.
The “type” attribute of “.vec” is undefined when loading script.
需要用属性延迟定义( http://www.cocos.com/docs/creator/scripting/reference/class.html#-a-name-deferred-definition-a- )
var AAA = cc.Class({
properties: () => ({
vec: [AAA]
})
});
module.exports=AAA;
可不可以只验证声明一部分啊
比如
properties: () => ({
vec: [AAA]
}),
properties: () {
size: 3,
},
我想size 不用延迟声明
不可以,别把设计复杂化
谢谢哈, 但是现在有个警告, 怎么处理比较好
Can not serialize “.vec” because the specified type is anonymous, please provide a class name or set the “serializable” attribute of “.vec” to “false”.
给AAA一个名字:
var AAA = cc.Class({
name: "AAA",
properties: ...
});