12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364 |
- "use strict";
- cc._RF.push(module, '62b73Q21KBKpoE4HF3kjGqw', 'smallProp');
- // Script/prop/smallProp.ts
- "use strict";
- var __extends = (this && this.__extends) || (function () {
- var extendStatics = function (d, b) {
- extendStatics = Object.setPrototypeOf ||
- ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
- function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };
- return extendStatics(d, b);
- };
- return function (d, b) {
- extendStatics(d, b);
- function __() { this.constructor = d; }
- d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
- };
- })();
- var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
- var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
- if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
- 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;
- return c > 3 && r && Object.defineProperty(target, key, r), r;
- };
- Object.defineProperty(exports, "__esModule", { value: true });
- var player_1 = require("../player");
- var BaseProp_1 = require("./BaseProp");
- var _a = cc._decorator, ccclass = _a.ccclass, property = _a.property;
- var smallProp = /** @class */ (function (_super) {
- __extends(smallProp, _super);
- function smallProp() {
- return _super !== null && _super.apply(this, arguments) || this;
- }
- smallProp.prototype.onLoad = function () {
- this.RunAction();
- };
- /**
- * 播放默认动画
- */
- smallProp.prototype.RunAction = function () {
- var offsetY = 15;
- var times = 0.5;
- var startScale = 0.5;
- var endScale = 0.6;
- var actions = cc.sequence(cc.spawn(cc.scaleTo(times, endScale), cc.moveBy(times, cc.v2(0, offsetY))), cc.spawn(cc.scaleTo(times, startScale), cc.moveBy(times, cc.v2(0, -offsetY))));
- actions.repeatForever();
- this.node.runAction(actions);
- };
- // 只在两个触发器开始触发时被调用一次
- smallProp.prototype.onCollisionEnter = function (other, self) {
- if (other.node.group != 'player')
- return;
- player_1.default.getInstance().SetSmall();
- this.node.destroy();
- // console.log('触发器:', other.node.group, other.node.name);
- };
- smallProp = __decorate([
- ccclass
- ], smallProp);
- return smallProp;
- }(BaseProp_1.default));
- exports.default = smallProp;
- cc._RF.pop();
|