"use strict"; cc._RF.push(module, 'fb0ffXEM+BJ+KXoHyQq3bMR', 'Singleton'); // Script/Framework/Utils/Singleton.ts "use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.Singleton = void 0; /** * 单例类父类 */ var Singleton = /** @class */ (function () { function Singleton() { } Singleton.getInstance = function () { if (this.instance == null) { var Class = this; this.instance = new Class(); } return this.instance; }; Singleton.ins = function () { if (this.instance == null) { var Class = this; this.instance = new Class(); } return this.instance; }; Singleton.createInstance = function () { if (this.instance == null) { var Class = this; this.instance = new Class(); this.instance.init(); } }; Singleton.destroyInstance = function () { if (this.instance != null) { this.instance.unInit(); this.instance = null; } }; Singleton.prototype.init = function () { }; ; //资源初始化 Singleton.prototype.unInit = function () { }; ; //资源释放 return Singleton; }()); exports.Singleton = Singleton; cc._RF.pop();