请教,我想定义一个保存数据的类,js 的版本如下
export default cc.Class({
name: "SpineInfo",
properties: {
effectName: {
default: ""
},
animationName: {
default: "animation",
},
skeleton: {
default: null,
type: sp.SkeletonData,
}
},
});
然后在另外一个类里引用他
export default cc.Class({
extends: cc.Component,
properties: {
effects: {
default: [],
type: [SpineInfo],
},
},
那么在 TypeScript 里应该怎样实现 SpineInfo 这个类呢?
@??? // 这里用什么
export default class SpineInfo {
@CCProperty(string)
public effectName: string;
@CCProperty({default: "animation", type: cc.String})
public animationName: string;
@CCProperty({ default: null, type: sp.SkeletonData }
public skeleton: sp.SkeletonData;
}