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,134 @@
System.register(["__unresolved_0", "cc", "__unresolved_1", "__unresolved_2"], function (_export, _context) {
"use strict";
var _reporterNs, _cclegacy, __checkObsolete__, __checkObsoleteInNamespace__, _decorator, Sprite, UIManager, PanelBase, _dec, _dec2, _class, _class2, _descriptor, _descriptor2, _class3, _crd, ccclass, property, LoadingPanel;
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.'); }
function _reportPossibleCrUseOfUIManager(extras) {
_reporterNs.report("UIManager", "../framework/ui/UIManager", _context.meta, extras);
}
function _reportPossibleCrUseOfPanelBase(extras) {
_reporterNs.report("PanelBase", "../framework/ui/PanelBase", _context.meta, extras);
}
return {
setters: [function (_unresolved_) {
_reporterNs = _unresolved_;
}, function (_cc) {
_cclegacy = _cc.cclegacy;
__checkObsolete__ = _cc.__checkObsolete__;
__checkObsoleteInNamespace__ = _cc.__checkObsoleteInNamespace__;
_decorator = _cc._decorator;
Sprite = _cc.Sprite;
}, function (_unresolved_2) {
UIManager = _unresolved_2.UIManager;
}, function (_unresolved_3) {
PanelBase = _unresolved_3.PanelBase;
}],
execute: function () {
_crd = true;
_cclegacy._RF.push({}, "f4b84y056JFgq0b0ZnqXOvk", "LoadingPanel", undefined);
__checkObsolete__(['_decorator', 'Button', 'Component', 'Label', 'Node', 'Sprite', 'Tween', 'tween', 'Vec3']);
({
ccclass,
property
} = _decorator);
_export("LoadingPanel", LoadingPanel = (_dec = ccclass('LoadingPanel'), _dec2 = property({
type: Sprite
}), _dec(_class = (_class2 = (_class3 = class LoadingPanel extends (_crd && PanelBase === void 0 ? (_reportPossibleCrUseOfPanelBase({
error: Error()
}), PanelBase) : PanelBase) {
constructor() {
super(...arguments);
_initializerDefineProperty(this, "loadingSprite", _descriptor, this);
_initializerDefineProperty(this, "fillDuration", _descriptor2, this);
// 填充持续时间,单位为秒
this.fillAmount = 0;
this.loadingComplete = false;
this.completeCallback = null;
}
// 当前填充量
startFill() {
this.schedule(this.updateFill, 0.01); // 每0.01秒更新一次填充量
}
onOpen() {
LoadingPanel.instance.startFill();
}
onLoadingComplete(callBack) {
this.completeCallback = callBack;
this.loadingComplete = true;
if (this.fillAmount < 1) {
this.fillDuration = 1;
} else {
(_crd && UIManager === void 0 ? (_reportPossibleCrUseOfUIManager({
error: Error()
}), UIManager) : UIManager).instance.closePanel(LoadingPanel);
callBack();
}
}
onDestroy() {
this.unschedule(this.updateFill);
}
updateFill() {
if (this.fillAmount < 1) {
this.fillAmount += 0.01 / this.fillDuration; // 根据持续时间逐步增加填充量
this.loadingSprite.fillRange = this.fillAmount; // 更新 Sprite 的填充量
} else {
this.unschedule(this.updateFill); // 填充完成后停止更新
if (this.loadingComplete) {
(_crd && UIManager === void 0 ? (_reportPossibleCrUseOfUIManager({
error: Error()
}), UIManager) : UIManager).instance.closePanel(LoadingPanel);
this.completeCallback();
}
}
}
onLoad() {
LoadingPanel.instance = this;
}
}, _class3.instance = void 0, _class3), (_descriptor = _applyDecoratedDescriptor(_class2.prototype, "loadingSprite", [_dec2], {
configurable: true,
enumerable: true,
writable: true,
initializer: function initializer() {
return null;
}
}), _descriptor2 = _applyDecoratedDescriptor(_class2.prototype, "fillDuration", [property], {
configurable: true,
enumerable: true,
writable: true,
initializer: function initializer() {
return 5;
}
})), _class2)) || _class));
_cclegacy._RF.pop();
_crd = false;
}
};
});
//# sourceMappingURL=aff6617cbbb7a53a4de9a5219456dcc3e0d312e5.js.map
@@ -0,0 +1 @@
{"version":3,"sources":["file:///D:/Users/admin/Alien_Sniper/assets/scripts/ui/LoadingPanel.ts"],"names":["_decorator","Sprite","UIManager","PanelBase","ccclass","property","LoadingPanel","type","fillAmount","loadingComplete","completeCallback","startFill","schedule","updateFill","onOpen","instance","onLoadingComplete","callBack","fillDuration","closePanel","onDestroy","unschedule","loadingSprite","fillRange","onLoad"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;AACSA,MAAAA,U,OAAAA,U;AAA4CC,MAAAA,M,OAAAA,M;;AAE5CC,MAAAA,S,iBAAAA,S;;AAGAC,MAAAA,S,iBAAAA,S;;;;;;;;;OAIH;AAAEC,QAAAA,OAAF;AAAWC,QAAAA;AAAX,O,GAAwBL,U;;8BAGjBM,Y,WADZF,OAAO,CAAC,cAAD,C,UAKHC,QAAQ,CAAC;AAAEE,QAAAA,IAAI,EAAEN;AAAR,OAAD,C,sCALb,MACaK,YADb;AAAA;AAAA,kCAC4C;AAAA;AAAA;;AAAA;;AAAA;;AASd;AATc,eAWhCE,UAXgC,GAWX,CAXW;AAAA,eAoBxCC,eApBwC,GAoBb,KApBa;AAAA,eAqBxCC,gBArBwC,GAqBrB,IArBqB;AAAA;;AAWR;AAEhCC,QAAAA,SAAS,GAAG;AACR,eAAKC,QAAL,CAAc,KAAKC,UAAnB,EAA+B,IAA/B,EADQ,CAC8B;AACzC;;AAESC,QAAAA,MAAM,GAAS;AACrBR,UAAAA,YAAY,CAACS,QAAb,CAAsBJ,SAAtB;AACH;;AAGDK,QAAAA,iBAAiB,CAACC,QAAD,EAAW;AACxB,eAAKP,gBAAL,GAAwBO,QAAxB;AACA,eAAKR,eAAL,GAAuB,IAAvB;;AACA,cAAI,KAAKD,UAAL,GAAkB,CAAtB,EAAyB;AACrB,iBAAKU,YAAL,GAAoB,CAApB;AACH,WAFD,MAEO;AACH;AAAA;AAAA,wCAAUH,QAAV,CAAmBI,UAAnB,CAA8Bb,YAA9B;AACAW,YAAAA,QAAQ;AACX;AACJ;;AAESG,QAAAA,SAAS,GAAS;AACxB,eAAKC,UAAL,CAAgB,KAAKR,UAArB;AACH;;AAEDA,QAAAA,UAAU,GAAG;AACT,cAAI,KAAKL,UAAL,GAAkB,CAAtB,EAAyB;AACrB,iBAAKA,UAAL,IAAmB,OAAO,KAAKU,YAA/B,CADqB,CACwB;;AAC7C,iBAAKI,aAAL,CAAmBC,SAAnB,GAA+B,KAAKf,UAApC,CAFqB,CAE2B;AACnD,WAHD,MAGO;AACH,iBAAKa,UAAL,CAAgB,KAAKR,UAArB,EADG,CAC+B;;AAClC,gBAAI,KAAKJ,eAAT,EAA0B;AACtB;AAAA;AAAA,0CAAUM,QAAV,CAAmBI,UAAnB,CAA8Bb,YAA9B;AACA,mBAAKI,gBAAL;AACH;AACJ;AACJ;;AAEDc,QAAAA,MAAM,GAAG;AACLlB,UAAAA,YAAY,CAACS,QAAb,GAAwB,IAAxB;AACH;;AApDuC,O,UAEjCA,Q;;;;;iBAGiB,I;;uFAGvBV,Q;;;;;iBACsB,C","sourcesContent":["\r\nimport { _decorator, Button, Component, Label, Node, Sprite, Tween, tween, Vec3 } from 'cc';\r\nimport { LocalSaveMgr } from '../framework/data/LocalSaveMgr';\r\nimport { UIManager } from '../framework/ui/UIManager';\r\nimport { UISwitcher } from '../framework/ui/UISwitcher';\r\nimport { AudioMgr } from '../framework/audio/AudioMgr';\r\nimport { PanelBase } from '../framework/ui/PanelBase';\r\nimport { AssetController } from '../AssetController';\r\nimport { GameController } from '../GameController';\r\n\r\nconst { ccclass, property } = _decorator;\r\n\r\n@ccclass('LoadingPanel')\r\nexport class LoadingPanel extends PanelBase {\r\n\r\n static instance: LoadingPanel;\r\n\r\n @property({ type: Sprite })\r\n loadingSprite: Sprite = null;\r\n\r\n\r\n @property\r\n fillDuration: number = 5; // 填充持续时间,单位为秒\r\n\r\n private fillAmount: number = 0; // 当前填充量\r\n\r\n startFill() {\r\n this.schedule(this.updateFill, 0.01); // 每0.01秒更新一次填充量\r\n }\r\n\r\n protected onOpen(): void {\r\n LoadingPanel.instance.startFill()\r\n }\r\n loadingComplete: boolean = false\r\n completeCallback = null\r\n onLoadingComplete(callBack) {\r\n this.completeCallback = callBack\r\n this.loadingComplete = true\r\n if (this.fillAmount < 1) {\r\n this.fillDuration = 1\r\n } else {\r\n UIManager.instance.closePanel(LoadingPanel)\r\n callBack()\r\n }\r\n }\r\n\r\n protected onDestroy(): void {\r\n this.unschedule(this.updateFill);\r\n }\r\n\r\n updateFill() {\r\n if (this.fillAmount < 1) {\r\n this.fillAmount += 0.01 / this.fillDuration; // 根据持续时间逐步增加填充量\r\n this.loadingSprite.fillRange = this.fillAmount; // 更新 Sprite 的填充量\r\n } else {\r\n this.unschedule(this.updateFill); // 填充完成后停止更新\r\n if (this.loadingComplete) {\r\n UIManager.instance.closePanel(LoadingPanel)\r\n this.completeCallback()\r\n }\r\n }\r\n }\r\n\r\n onLoad() {\r\n LoadingPanel.instance = this;\r\n }\r\n\r\n\r\n}\r\n\r\n\r\n"]}