6d7cd813-fe9c-4a68-a1aa-0ed46cd985b8.js 2.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869
  1. "use strict";
  2. cc._RF.push(module, '6d7cdgT/pxKaKGqDtRs2YW4', 'SmallPanel');
  3. // Script/view/smallPanel/SmallPanel.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 BaseView_1 = require("../../../lightMVC/core/base/BaseView");
  26. var App_1 = require("../../Manager/App");
  27. var player_1 = require("../../player");
  28. var _a = cc._decorator, ccclass = _a.ccclass, property = _a.property;
  29. var SmallPanel = /** @class */ (function (_super) {
  30. __extends(SmallPanel, _super);
  31. function SmallPanel() {
  32. var _this = _super !== null && _super.apply(this, arguments) || this;
  33. _this.progressBar = null;
  34. _this.currentTime = 0;
  35. return _this;
  36. }
  37. SmallPanel.prototype.drawView = function () {
  38. console.log('SmallPanel~~~~~~~~~~');
  39. var progress = this.ui.getNode("progress");
  40. this.progressBar = progress.getComponent(cc.ProgressBar);
  41. this.currentTime = App_1.App.DataManager.SmallTime;
  42. var label = this.ui.getNode("label");
  43. var action = cc.sequence(cc.scaleTo(0.5, 1.2), cc.scaleTo(0.5, 1));
  44. action.repeatForever();
  45. label.runAction(action);
  46. };
  47. SmallPanel.prototype.update = function (dt) {
  48. if (!this.progressBar || this.currentTime <= 0)
  49. return;
  50. this.currentTime -= dt;
  51. var progress = this.currentTime / App_1.App.DataManager.SmallTime;
  52. this.progressBar.progress = (progress < 0) ? 0 : progress;
  53. if (progress <= 0) {
  54. player_1.default.getInstance().SetSmallBack();
  55. this.closeView();
  56. }
  57. };
  58. SmallPanel.path = function () {
  59. return "prefabs/SmallPanel";
  60. };
  61. SmallPanel = __decorate([
  62. ccclass
  63. ], SmallPanel);
  64. return SmallPanel;
  65. }(BaseView_1.BaseView));
  66. exports.default = SmallPanel;
  67. cc._RF.pop();