import { _decorator, Component, director, Label } from 'cc'; const { ccclass, property } = _decorator; /** * LaunchFlow: 真机启动流编排器(仿 gameabc 启动流程)。 * * 流程: * 1. Loading 场景: 显示「Loading...」 * 2. 资源加载完成后 → director.loadScene('Login') * 3. Login 场景: 调用 PlatformSession.startup() 拿配置 + 连 WS + login * 4. login 成功后 → director.loadScene('MainMenu') * * 当前实现只覆盖 step 1→2(用 setTimeout 模拟加载完成); * step 3/4 待 PlatformSession 接入后补全。 */ @ccclass('LaunchFlow') export class LaunchFlow extends Component { @property(Label) tipLabel: Label = null!; start(): void { if (this.tipLabel) this.tipLabel.string = 'Loading...'; // 模拟资源加载完成:1 秒后切到 Login 场景 this.scheduleOnce(() => { director.loadScene('Login'); }, 1); } }