LayerManager.js 2.3 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061
  1. var t = require;
  2. var e = module;
  3. var i = exports;
  4. var s,
  5. o =
  6. (this && this.__decorate) ||
  7. function (t, e, i, s) {
  8. var o,
  9. a = arguments.length,
  10. n = a < 3 ? e : null === s ? (s = Object.getOwnPropertyDescriptor(e, i)) : s;
  11. if ("object" == typeof Reflect && "function" == typeof Reflect.decorate) n = Reflect.decorate(t, e, i, s);
  12. else
  13. for (var r = t.length - 1; 0 <= r; r--)
  14. (o = t[r]) && (n = (a < 3 ? o(n) : 3 < a ? o(e, i, n) : o(e, i)) || n);
  15. return 3 < a && n && Object.defineProperty(e, i, n), n;
  16. };
  17. Object.defineProperty(i, "__esModule", {value: !0});
  18. const {ccclass: a, property: n} = cc._decorator;
  19. e = s = class extends cc.Component {
  20. constructor() {
  21. super(...arguments), (this.layerBg = null), (this.effectMovie = null);
  22. }
  23. showChangeSceneEffect() {
  24. return new Promise(t => {
  25. (this.effectMovie.active = !0),
  26. cc.tween(this.effectMovie.getChildByName("LoadReel")).by(2, {angle: 360}).repeatForever().start(),
  27. t();
  28. });
  29. }
  30. hideChangeSceneEffect() {
  31. this.effectMovie.active &&
  32. (this.effectMovie.getChildByName("LoadReel").stopAllActions(), (this.effectMovie.active = !1));
  33. }
  34. onLoad() {
  35. (s.ins = this),
  36. cc.game.addPersistRootNode(this.node),
  37. cc.game.addPersistRootNode(this.effectMovie),
  38. (this.effectMovie.active = !1),
  39. this.layerBg &&
  40. ((s.layerBg = cc.instantiate(this.layerBg)),
  41. s.layerBg.on(cc.Node.EventType.TOUCH_END, s.onTouchBg, this));
  42. }
  43. static reset() {
  44. cc.isValid(s.layerBg) ||
  45. ((s.layerBg = cc.instantiate(this.layerBg)), s.layerBg.on(cc.Node.EventType.TOUCH_END, s.onTouchBg, this));
  46. }
  47. static onTouchBg() {
  48. s.curBgView && s.curBgView.onTouchBg && s.curBgView.onTouchBg();
  49. }
  50. };
  51. (e.Game_Main = 0),
  52. (e.UI_Main = 50),
  53. (e.UI_Popup = 100),
  54. (e.UI_Tips = 150),
  55. (e.UI_Guide = 200),
  56. (e.UI_High_Tips = 250),
  57. (e.layerBg = null),
  58. o([n(cc.Prefab)], e.prototype, "layerBg", void 0),
  59. o([n(cc.Node)], e.prototype, "effectMovie", void 0),
  60. (e = s = o([a], e)),
  61. (i.default = e = s);