first commit

This commit is contained in:
ytc1012
2025-11-18 18:38:53 +08:00
commit bea9db4488
1582 changed files with 335346 additions and 0 deletions

View File

@@ -0,0 +1,25 @@
import { _decorator, Component, ProgressBar } from 'cc';
import { EventMgr } from '../utils/EventMgr';
const { ccclass, property } = _decorator;
@ccclass('LoadingLogic')
export default class LoadingLogic extends Component {
@property(ProgressBar)
bar: ProgressBar | null = null;
protected onLoad(): void {
this.bar.progress = 0;
EventMgr.on("load_progress", this.onProgress, this);
EventMgr.on("load_complete", this.onComplete, this);
}
protected onDestroy(): void {
EventMgr.targetOff(this);
}
protected onProgress(precent: number): void {
this.bar.progress = precent;
}
protected onComplete(): void {
this.node.parent = null;
}
}