152 lines
6.0 KiB
JavaScript
152 lines
6.0 KiB
JavaScript
System.register(["cc"], function (_export, _context) {
|
|
"use strict";
|
|
|
|
var _cclegacy, __checkObsolete__, __checkObsoleteInNamespace__, _decorator, Component, easing, tween, Vec3, _dec, _dec2, _dec3, _dec4, _dec5, _class, _class2, _descriptor, _descriptor2, _descriptor3, _descriptor4, _descriptor5, _descriptor6, _descriptor7, _descriptor8, _crd, ccclass, property, ScaleComponent;
|
|
|
|
function _initializerDefineProperty(target, property, descriptor, context) { if (!descriptor) return; Object.defineProperty(target, property, { enumerable: descriptor.enumerable, configurable: descriptor.configurable, writable: descriptor.writable, value: descriptor.initializer ? descriptor.initializer.call(context) : void 0 }); }
|
|
|
|
function _applyDecoratedDescriptor(target, property, decorators, descriptor, context) { var desc = {}; Object.keys(descriptor).forEach(function (key) { desc[key] = descriptor[key]; }); desc.enumerable = !!desc.enumerable; desc.configurable = !!desc.configurable; if ('value' in desc || desc.initializer) { desc.writable = true; } desc = decorators.slice().reverse().reduce(function (desc, decorator) { return decorator(target, property, desc) || desc; }, desc); if (context && desc.initializer !== void 0) { desc.value = desc.initializer ? desc.initializer.call(context) : void 0; desc.initializer = undefined; } if (desc.initializer === void 0) { Object.defineProperty(target, property, desc); desc = null; } return desc; }
|
|
|
|
function _initializerWarningHelper(descriptor, context) { throw new Error('Decorating class property failed. Please ensure that ' + 'transform-class-properties is enabled and runs after the decorators transform.'); }
|
|
|
|
return {
|
|
setters: [function (_cc) {
|
|
_cclegacy = _cc.cclegacy;
|
|
__checkObsolete__ = _cc.__checkObsolete__;
|
|
__checkObsoleteInNamespace__ = _cc.__checkObsoleteInNamespace__;
|
|
_decorator = _cc._decorator;
|
|
Component = _cc.Component;
|
|
easing = _cc.easing;
|
|
tween = _cc.tween;
|
|
Vec3 = _cc.Vec3;
|
|
}],
|
|
execute: function () {
|
|
_crd = true;
|
|
|
|
_cclegacy._RF.push({}, "f63e6rwAJ9ETqh1I31PDw3s", "ScaleComponent", undefined);
|
|
|
|
__checkObsolete__(['_decorator', 'Component', 'easing', 'Node', 'tween', 'Vec2', 'Vec3']);
|
|
|
|
({
|
|
ccclass,
|
|
property
|
|
} = _decorator);
|
|
|
|
_export("ScaleComponent", ScaleComponent = (_dec = ccclass('ScaleComponent'), _dec2 = property({
|
|
displayName: "线性"
|
|
}), _dec3 = property({
|
|
displayName: "先慢后快"
|
|
}), _dec4 = property({
|
|
displayName: "先快后慢"
|
|
}), _dec5 = property({
|
|
displayName: "设置为初始值"
|
|
}), _dec(_class = (_class2 = class ScaleComponent extends Component {
|
|
constructor() {
|
|
super(...arguments);
|
|
|
|
_initializerDefineProperty(this, "startPos", _descriptor, this);
|
|
|
|
_initializerDefineProperty(this, "endPos", _descriptor2, this);
|
|
|
|
_initializerDefineProperty(this, "delay", _descriptor3, this);
|
|
|
|
_initializerDefineProperty(this, "moveTimer", _descriptor4, this);
|
|
|
|
_initializerDefineProperty(this, "line", _descriptor5, this);
|
|
|
|
_initializerDefineProperty(this, "sineIn", _descriptor6, this);
|
|
|
|
_initializerDefineProperty(this, "sineOut", _descriptor7, this);
|
|
|
|
_initializerDefineProperty(this, "setToStart", _descriptor8, this);
|
|
}
|
|
|
|
onEnable() {
|
|
var easeFunc = easing.linear;
|
|
|
|
if (this.sineIn) {
|
|
easeFunc = easing.sineIn;
|
|
}
|
|
|
|
if (this.sineOut) {
|
|
easeFunc = easing.sineOut;
|
|
}
|
|
|
|
if (this.setToStart) {
|
|
this.node.setScale(this.startPos);
|
|
}
|
|
|
|
tween(this.node).delay(this.delay).call(() => {
|
|
this.node.setScale(this.startPos);
|
|
}).to(this.moveTimer, {
|
|
scale: this.endPos
|
|
}, {
|
|
easing: easeFunc
|
|
}).start();
|
|
}
|
|
|
|
}, (_descriptor = _applyDecoratedDescriptor(_class2.prototype, "startPos", [property], {
|
|
configurable: true,
|
|
enumerable: true,
|
|
writable: true,
|
|
initializer: function initializer() {
|
|
return new Vec3(0, 0, 0);
|
|
}
|
|
}), _descriptor2 = _applyDecoratedDescriptor(_class2.prototype, "endPos", [property], {
|
|
configurable: true,
|
|
enumerable: true,
|
|
writable: true,
|
|
initializer: function initializer() {
|
|
return new Vec3(1, 1, 1);
|
|
}
|
|
}), _descriptor3 = _applyDecoratedDescriptor(_class2.prototype, "delay", [property], {
|
|
configurable: true,
|
|
enumerable: true,
|
|
writable: true,
|
|
initializer: function initializer() {
|
|
return 0;
|
|
}
|
|
}), _descriptor4 = _applyDecoratedDescriptor(_class2.prototype, "moveTimer", [property], {
|
|
configurable: true,
|
|
enumerable: true,
|
|
writable: true,
|
|
initializer: function initializer() {
|
|
return 0.1;
|
|
}
|
|
}), _descriptor5 = _applyDecoratedDescriptor(_class2.prototype, "line", [_dec2], {
|
|
configurable: true,
|
|
enumerable: true,
|
|
writable: true,
|
|
initializer: function initializer() {
|
|
return true;
|
|
}
|
|
}), _descriptor6 = _applyDecoratedDescriptor(_class2.prototype, "sineIn", [_dec3], {
|
|
configurable: true,
|
|
enumerable: true,
|
|
writable: true,
|
|
initializer: function initializer() {
|
|
return true;
|
|
}
|
|
}), _descriptor7 = _applyDecoratedDescriptor(_class2.prototype, "sineOut", [_dec4], {
|
|
configurable: true,
|
|
enumerable: true,
|
|
writable: true,
|
|
initializer: function initializer() {
|
|
return true;
|
|
}
|
|
}), _descriptor8 = _applyDecoratedDescriptor(_class2.prototype, "setToStart", [_dec5], {
|
|
configurable: true,
|
|
enumerable: true,
|
|
writable: true,
|
|
initializer: function initializer() {
|
|
return false;
|
|
}
|
|
})), _class2)) || _class));
|
|
|
|
_cclegacy._RF.pop();
|
|
|
|
_crd = false;
|
|
}
|
|
};
|
|
});
|
|
//# sourceMappingURL=45cfa33e80cce35c61b1acf7ea562fe31c3843dd.js.map
|