acaa08dc-4be1-43d6-994e-e9f635084f73.js 3.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104
  1. "use strict";
  2. cc._RF.push(module, 'acaa0jcS+FD1plO6fY1CE9z', 'GuideLayer');
  3. // scripts/UI/GuideLayer.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 (b.hasOwnProperty(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. var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
  19. var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
  20. if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
  21. else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
  22. return c > 3 && r && Object.defineProperty(target, key, r), r;
  23. };
  24. Object.defineProperty(exports, "__esModule", { value: true });
  25. exports.guideLayer = void 0;
  26. var _a = cc._decorator, ccclass = _a.ccclass, property = _a.property;
  27. exports.guideLayer = null;
  28. var GuideLayer = /** @class */ (function (_super) {
  29. __extends(GuideLayer, _super);
  30. function GuideLayer() {
  31. var _this = _super !== null && _super.apply(this, arguments) || this;
  32. _this.bgLoadNode = null;
  33. _this.points = null;
  34. _this.fjLoadNode = null;
  35. _this.fjAni = null;
  36. /////////////////////// 过渡动画 ///////////////////////////////
  37. _this.curIndex = 0;
  38. return _this;
  39. }
  40. GuideLayer.prototype.onLoad = function () {
  41. exports.guideLayer = this;
  42. cc.game.addPersistRootNode(this.node);
  43. this.node.setPosition(cc.winSize.width / 2, cc.winSize.height / 2);
  44. this.node.setContentSize(cc.winSize);
  45. };
  46. GuideLayer.prototype.start = function () {
  47. this.showPoint();
  48. this.schedule(this.showPoint, 0.5);
  49. };
  50. /** 点变化效果 */
  51. GuideLayer.prototype.showPoint = function () {
  52. for (var i = 0; i < this.points.childrenCount; i++) {
  53. if (i <= this.curIndex) {
  54. this.points.children[i].opacity = 255;
  55. }
  56. else {
  57. this.points.children[i].opacity = 0;
  58. }
  59. }
  60. if (++this.curIndex > this.points.childrenCount) {
  61. this.curIndex = 0;
  62. }
  63. };
  64. /** 显示过渡动画 */
  65. GuideLayer.prototype.showBgAni = function () {
  66. this.bgLoadNode.active = true;
  67. this.curIndex = 0;
  68. };
  69. /** 隐藏过度动画 */
  70. GuideLayer.prototype.hideBgAni = function () {
  71. this.bgLoadNode.active = false;
  72. };
  73. /////////////////////// 加载动画(直升机) ///////////////////////////////
  74. /** 显示飞机动画 */
  75. GuideLayer.prototype.showFjAni = function () {
  76. this.fjLoadNode.active = true;
  77. this.fjAni.setAnimation(0, "jiazai", false);
  78. this.fjAni.addAnimation(0, "jiazai2", true);
  79. };
  80. /** 隐藏飞机动画 */
  81. GuideLayer.prototype.hideFjAni = function () {
  82. this.fjLoadNode.active = false;
  83. };
  84. __decorate([
  85. property(cc.Node)
  86. ], GuideLayer.prototype, "bgLoadNode", void 0);
  87. __decorate([
  88. property(cc.Node)
  89. ], GuideLayer.prototype, "points", void 0);
  90. __decorate([
  91. property(cc.Node)
  92. ], GuideLayer.prototype, "fjLoadNode", void 0);
  93. __decorate([
  94. property(sp.Skeleton)
  95. ], GuideLayer.prototype, "fjAni", void 0);
  96. GuideLayer = __decorate([
  97. ccclass
  98. ], GuideLayer);
  99. return GuideLayer;
  100. }(cc.Component));
  101. exports.default = GuideLayer;
  102. cc._RF.pop();