d1080978-b182-4f96-b359-0ae030c2f75e.js 3.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172
  1. "use strict";
  2. cc._RF.push(module, 'd1080l4sYJPlrNZCuAwwvde', 'XProcess');
  3. // Script/Manager/XProcess.ts
  4. "use strict";
  5. // Learn TypeScript:
  6. // - https://docs.cocos.com/creator/manual/en/scripting/typescript.html
  7. // Learn Attribute:
  8. // - https://docs.cocos.com/creator/manual/en/scripting/reference/attributes.html
  9. // Learn life-cycle callbacks:
  10. // - https://docs.cocos.com/creator/manual/en/scripting/life-cycle-callbacks.html
  11. var __extends = (this && this.__extends) || (function () {
  12. var extendStatics = function (d, b) {
  13. extendStatics = Object.setPrototypeOf ||
  14. ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
  15. function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };
  16. return extendStatics(d, b);
  17. };
  18. return function (d, b) {
  19. extendStatics(d, b);
  20. function __() { this.constructor = d; }
  21. d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
  22. };
  23. })();
  24. var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
  25. var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
  26. if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
  27. 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;
  28. return c > 3 && r && Object.defineProperty(target, key, r), r;
  29. };
  30. Object.defineProperty(exports, "__esModule", { value: true });
  31. var _a = cc._decorator, ccclass = _a.ccclass, property = _a.property;
  32. var XProcess = /** @class */ (function (_super) {
  33. __extends(XProcess, _super);
  34. function XProcess() {
  35. var _this = _super !== null && _super.apply(this, arguments) || this;
  36. _this.process = null;
  37. _this.processLabel = null;
  38. _this.ProcessWidth = 0;
  39. return _this;
  40. // update (dt) {}
  41. }
  42. XProcess.prototype.onLoad = function () {
  43. this.ProcessWidth = this.node.width;
  44. };
  45. XProcess.prototype.showProcessLabel = function () {
  46. if (!this.processLabel.node.activeInHierarchy)
  47. this.processLabel.node.active = true;
  48. };
  49. XProcess.prototype.setProcess = function (processNum, processstr) {
  50. if (processstr === void 0) { processstr = "0/0"; }
  51. this.processLabel.string = processstr;
  52. if (processNum > 1)
  53. processNum = 1;
  54. this.process.width = this.node.width * processNum;
  55. };
  56. XProcess.prototype.start = function () {
  57. };
  58. __decorate([
  59. property(cc.Node)
  60. ], XProcess.prototype, "process", void 0);
  61. __decorate([
  62. property(cc.Label)
  63. ], XProcess.prototype, "processLabel", void 0);
  64. XProcess = __decorate([
  65. ccclass
  66. ], XProcess);
  67. return XProcess;
  68. }(cc.Component));
  69. exports.default = XProcess;
  70. cc._RF.pop();