212dc105-1ae7-44fd-b313-c38d0a751f49.js 3.6 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485
  1. "use strict";
  2. cc._RF.push(module, '212dcEFGudE/bMTw40KdR9J', 'fuhuo1');
  3. // Script/fuhuo1.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. 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. var _a = cc._decorator, ccclass = _a.ccclass, property = _a.property;
  26. var NewClass = /** @class */ (function (_super) {
  27. __extends(NewClass, _super);
  28. function NewClass() {
  29. return _super !== null && _super.apply(this, arguments) || this;
  30. }
  31. // LIFE-CYCLE CALLBACKS:
  32. NewClass.prototype.onLoad = function () {
  33. this.node.getChildByName("cd").getChildByName("RankScene").active = false;
  34. this.node.getChildByName("zl").getChildByName("rePlay").active = false;
  35. this.node.getChildByName("fh").getChildByName("rePlay").active = true;
  36. };
  37. NewClass.prototype.start = function () {
  38. };
  39. NewClass.prototype.update = function (dt) {
  40. var self = this;
  41. var Ani;
  42. var Anistate;
  43. var PlayOver = false;
  44. var Countdown = this.node.getChildByName("fh").getChildByName("Countdown").getComponent(cc.Label);
  45. var time = parseInt(Countdown.string);
  46. var scheduler = cc.director.getScheduler();
  47. // scheduler.schedule(aniplayer,this,1,10,1,false);
  48. this.scheduleOnce(aniplayer, 1); //完成使用schedule的情况下,提示warning的问题。
  49. /**
  50. * 结束页面的动画播放
  51. */
  52. function aniplayer() {
  53. var self = this;
  54. if (time > 0) {
  55. time--;
  56. }
  57. if (time == 0) {
  58. this.isScheduled = false;
  59. Ani = self.getComponent(cc.Animation);
  60. Anistate = Ani.play();
  61. Countdown.string = time.toString();
  62. self.node.getChildByName("cd").getChildByName("RankScene").active = true;
  63. self.node.getChildByName("zl").getChildByName("rePlay").active = true;
  64. self.node.getChildByName("fh").getChildByName("rePlay").active = false;
  65. scheduler.pauseTarget(this);
  66. PlayOver = true;
  67. }
  68. Countdown.string = time.toString();
  69. if (PlayOver) {
  70. self.scheduleOnce(function () {
  71. scheduler.resumeTargets(self);
  72. scheduler.pauseAllTargets();
  73. }, 0.47);
  74. }
  75. }
  76. };
  77. NewClass = __decorate([
  78. ccclass
  79. ], NewClass);
  80. return NewClass;
  81. }(cc.Component));
  82. exports.default = NewClass;
  83. cc._RF.pop();