1e871f2d-10f5-43b5-8f40-47c9cb8fec06.js 1.5 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546
  1. "use strict";
  2. cc._RF.push(module, '1e8718tEPVDtY9AR8nLj+wG', 'SingleClass');
  3. // Script/Manager/SingleClass.ts
  4. "use strict";
  5. var __extends = (this && this.__extends) || (function () {
  6. var extendStatics = function (d, b) {
  7. extendStatics = Object.setPrototypeOf ||
  8. ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
  9. function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };
  10. return extendStatics(d, b);
  11. };
  12. return function (d, b) {
  13. extendStatics(d, b);
  14. function __() { this.constructor = d; }
  15. d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
  16. };
  17. })();
  18. Object.defineProperty(exports, "__esModule", { value: true });
  19. exports.SingleClass = void 0;
  20. var BaseView_1 = require("../../lightMVC/core/base/BaseView");
  21. /**
  22. * 单例基类
  23. * @author xiongjian
  24. * @date 2016/10/11
  25. */
  26. var SingleClass = /** @class */ (function (_super) {
  27. __extends(SingleClass, _super);
  28. function SingleClass() {
  29. return _super !== null && _super.apply(this, arguments) || this;
  30. }
  31. /**
  32. * 获取一个单例
  33. */
  34. SingleClass.getInstance = function () {
  35. var Class = this;
  36. if (Class.instance == null) {
  37. Class.instance = new Class();
  38. }
  39. return Class.instance;
  40. };
  41. return SingleClass;
  42. }(BaseView_1.BaseView));
  43. exports.SingleClass = SingleClass;
  44. cc._RF.pop();