58 lines
1.5 KiB
JavaScript
58 lines
1.5 KiB
JavaScript
System.register(["cc"], function (_export, _context) {
|
|
"use strict";
|
|
|
|
var _cclegacy, __checkObsolete__, __checkObsoleteInNamespace__, _decorator, Component, _dec, _class, _class2, _crd, ccclass, property, SingletonBase;
|
|
|
|
return {
|
|
setters: [function (_cc) {
|
|
_cclegacy = _cc.cclegacy;
|
|
__checkObsolete__ = _cc.__checkObsolete__;
|
|
__checkObsoleteInNamespace__ = _cc.__checkObsoleteInNamespace__;
|
|
_decorator = _cc._decorator;
|
|
Component = _cc.Component;
|
|
}],
|
|
execute: function () {
|
|
_crd = true;
|
|
|
|
_cclegacy._RF.push({}, "983a7Fa7u9CALdO3YvO3QLZ", "SingletonBase", undefined);
|
|
|
|
__checkObsolete__(['_decorator', 'Component']);
|
|
|
|
({
|
|
ccclass,
|
|
property
|
|
} = _decorator);
|
|
|
|
_export("SingletonBase", SingletonBase = (_dec = ccclass('SingletonBase'), _dec(_class = (_class2 = class SingletonBase extends Component {
|
|
static getInstance() {
|
|
if (this._instance === null) {
|
|
return null;
|
|
}
|
|
|
|
return this._instance;
|
|
}
|
|
|
|
onLoad() {
|
|
if (this.constructor._instance) {
|
|
this.node.destroy();
|
|
return;
|
|
}
|
|
|
|
this.constructor._instance = this;
|
|
}
|
|
|
|
onDestroy() {
|
|
if (this.constructor._instance === this) {
|
|
this.constructor._instance = null;
|
|
}
|
|
}
|
|
|
|
}, _class2._instance = null, _class2)) || _class));
|
|
|
|
_cclegacy._RF.pop();
|
|
|
|
_crd = false;
|
|
}
|
|
};
|
|
});
|
|
//# sourceMappingURL=d2fe8f613eaa9369920a8fa74ab19eccb4860b54.js.map
|