This commit is contained in:
2026-07-14 11:44:07 +08:00
commit 4409c7b031
5906 changed files with 6959792 additions and 0 deletions
@@ -0,0 +1,153 @@
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, MoveComponent;
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({}, "19cd6cANzVEb4sIef7Q7Vyz", "MoveComponent", undefined);
__checkObsolete__(['_decorator', 'Component', 'easing', 'Node', 'tween', 'Vec2', 'Vec3']);
({
ccclass,
property
} = _decorator);
_export("MoveComponent", MoveComponent = (_dec = ccclass('MoveComponent'), _dec2 = property({
displayName: "线性"
}), _dec3 = property({
displayName: "先慢后快"
}), _dec4 = property({
displayName: "先快后慢"
}), _dec5 = property({
displayName: "设置为初始值"
}), _dec(_class = (_class2 = class MoveComponent 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() {
console.log("触发动画z");
var easeFunc = easing.linear;
if (this.sineIn) {
easeFunc = easing.sineIn;
}
if (this.sineOut) {
easeFunc = easing.sineOut;
}
if (this.setToStart) {
this.node.setPosition(this.startPos);
}
tween(this.node).delay(this.delay).call(() => {
this.node.setPosition(this.startPos);
}).to(this.moveTimer, {
position: 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(0, 0, 0);
}
}), _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;
}
}), _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=014c757ad51bcf9ed3a1ff7a78a9a03ae2bfbe6e.js.map
@@ -0,0 +1 @@
{"version":3,"sources":["file:///D:/Users/admin/Alien_Sniper/assets/scripts/framework/animation/MoveComponent.ts"],"names":["_decorator","Component","easing","tween","Vec3","ccclass","property","MoveComponent","displayName","onEnable","console","log","easeFunc","linear","sineIn","sineOut","setToStart","node","setPosition","startPos","delay","call","to","moveTimer","position","endPos","start"],"mappings":";;;;;;;;;;;;;;;;AAASA,MAAAA,U,OAAAA,U;AAAYC,MAAAA,S,OAAAA,S;AAAWC,MAAAA,M,OAAAA,M;AAAcC,MAAAA,K,OAAAA,K;AAAaC,MAAAA,I,OAAAA,I;;;;;;;;;OACrD;AAAEC,QAAAA,OAAF;AAAWC,QAAAA;AAAX,O,GAAwBN,U;;+BAGjBO,a,WADZF,OAAO,CAAC,eAAD,C,UAkBHC,QAAQ,CAAC;AAAEE,QAAAA,WAAW,EAAE;AAAf,OAAD,C,UAGRF,QAAQ,CAAC;AAAEE,QAAAA,WAAW,EAAE;AAAf,OAAD,C,UAGRF,QAAQ,CAAC;AAAEE,QAAAA,WAAW,EAAE;AAAf,OAAD,C,UAGRF,QAAQ,CAAC;AAAEE,QAAAA,WAAW,EAAE;AAAf,OAAD,C,2BA3Bb,MACaD,aADb,SACmCN,SADnC,CAC6C;AAAA;AAAA;;AAAA;;AAAA;;AAAA;;AAAA;;AAAA;;AAAA;;AAAA;;AAAA;AAAA;;AA8B/BQ,QAAAA,QAAQ,GAAS;AACvBC,UAAAA,OAAO,CAACC,GAAR,CAAY,OAAZ;AACA,cAAIC,QAAQ,GAAGV,MAAM,CAACW,MAAtB;;AAEA,cAAI,KAAKC,MAAT,EAAiB;AACbF,YAAAA,QAAQ,GAAGV,MAAM,CAACY,MAAlB;AACH;;AAED,cAAI,KAAKC,OAAT,EAAkB;AACdH,YAAAA,QAAQ,GAAGV,MAAM,CAACa,OAAlB;AACH;;AAED,cAAI,KAAKC,UAAT,EAAqB;AACjB,iBAAKC,IAAL,CAAUC,WAAV,CAAsB,KAAKC,QAA3B;AACH;;AAGDhB,UAAAA,KAAK,CAAC,KAAKc,IAAN,CAAL,CACKG,KADL,CACW,KAAKA,KADhB,EAEKC,IAFL,CAEU,MAAM;AACR,iBAAKJ,IAAL,CAAUC,WAAV,CAAsB,KAAKC,QAA3B;AACH,WAJL,EAKKG,EALL,CAKQ,KAAKC,SALb,EAKwB;AAAEC,YAAAA,QAAQ,EAAE,KAAKC;AAAjB,WALxB,EAKmD;AAAEvB,YAAAA,MAAM,EAAEU;AAAV,WALnD,EAMKc,KANL;AAOH;;AAtDwC,O,2EAGxCpB,Q;;;;;iBACgB,IAAIF,IAAJ,CAAS,CAAT,EAAY,CAAZ,EAAe,CAAf,C;;iFAEhBE,Q;;;;;iBACc,IAAIF,IAAJ,CAAS,CAAT,EAAY,CAAZ,EAAe,CAAf,C;;gFAEdE,Q;;;;;iBACe,C;;oFAGfA,Q;;;;;iBACmB,C;;;;;;;iBAIJ,I;;;;;;;iBAGE,I;;;;;;;iBAGC,I;;;;;;;iBAGG,K","sourcesContent":["import { _decorator, Component, easing, Node, tween, Vec2, Vec3 } from 'cc';\nconst { ccclass, property } = _decorator;\n\n@ccclass('MoveComponent')\nexport class MoveComponent extends Component {\n\n\n @property\n startPos: Vec3 = new Vec3(0, 0, 0);\n\n @property\n endPos: Vec3 = new Vec3(0, 0, 0);\n\n @property\n delay: number = 0;\n\n\n @property\n moveTimer: number = 0;\n\n\n @property({ displayName: \"线性\" })\n line: boolean = true;\n\n @property({ displayName: \"先慢后快\" })\n sineIn: boolean = true;\n\n @property({ displayName: \"先快后慢\" })\n sineOut: boolean = true;\n\n @property({ displayName: \"设置为初始值\" })\n setToStart: boolean = false;\n\n\n protected onEnable(): void {\n console.log(\"触发动画z\")\n let easeFunc = easing.linear;\n\n if (this.sineIn) {\n easeFunc = easing.sineIn\n }\n\n if (this.sineOut) {\n easeFunc = easing.sineOut\n }\n\n if (this.setToStart) {\n this.node.setPosition(this.startPos)\n }\n\n\n tween(this.node)\n .delay(this.delay)\n .call(() => {\n this.node.setPosition(this.startPos)\n })\n .to(this.moveTimer, { position: this.endPos }, { easing: easeFunc })\n .start()\n }\n\n\n}\n\n\n"]}