e242591a-321a-4de1-a53a-29c33c0622d7.js 2.1 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647
  1. "use strict";
  2. cc._RF.push(module, 'e2425kaMhpN4aU6KcM8BiLX', 'YZ_ShakeNode');
  3. // common-plugin/Scripts/YZ_ShakeNode.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. var _a = cc._decorator, ccclass = _a.ccclass, property = _a.property;
  26. var YZ_ShakeNode = /** @class */ (function (_super) {
  27. __extends(YZ_ShakeNode, _super);
  28. function YZ_ShakeNode() {
  29. return _super !== null && _super.apply(this, arguments) || this;
  30. }
  31. YZ_ShakeNode.prototype.start = function () {
  32. this.schedule(this.shake, 3);
  33. };
  34. YZ_ShakeNode.prototype.shake = function () {
  35. var duration = 0.03;
  36. var action = cc.repeat(cc.sequence(cc.rotateTo(duration, 5), cc.rotateTo(duration, 0), cc.rotateTo(duration, -5), cc.rotateTo(duration, 0)), 5);
  37. this.node.runAction(action);
  38. };
  39. YZ_ShakeNode = __decorate([
  40. ccclass
  41. ], YZ_ShakeNode);
  42. return YZ_ShakeNode;
  43. }(cc.Component));
  44. exports.default = YZ_ShakeNode;
  45. cc._RF.pop();