自己折腾了一个 CCData,发现这样可以
export function CCData(className) {
return function (constructor) {
let uuid = getUUID();
if (defined[uuid]) return definedClass[uuid];
constructor.$super = cc.Object;
let cls = define(className, constructor, currentMixins[uuid], void 0, {});
declareProperties(cls, className, currentProperties[uuid], constructor, void 0);
currentProperties = {};
currentMixins = {};
currentEditor = {};
defined[uuid] = true;
definedClass[uuid] = cls;
return cls;
}
}