import { Vl2h6kBYov1uNSwzL7 } from "./koffTaS"; import game_config_dyn from "./game_config_dyn"; import game_core from "./game_core"; const { ccclass, property } = cc._decorator; @ccclass export default class NewClass extends cc.Component { @property(cc.Prefab) public tileBlock: cc.Prefab = null; @property(cc.Label) wxOdV3NSqeDk2e2Prog: cc.Label = null; OBX6txtv: cc.Tween = null; OBX6txtv2: cc.Tween = null; onLoad() { // 加载游戏配置 this.loadGameConfig(); // 初始化游戏核心,并传入相关节点和预制体 this.initGameCore(); // 启动延迟后执行特定函数的动画序列 this.startDelayedAnimation(); } // 加载游戏配置的函数 private loadGameConfig(): void { game_config_dyn.load(null); } // 初始化游戏核心的函数,传入当前节点和瓦片预制体 private initGameCore(): void { game_core.init(this.node, this.tileBlock); } // 启动延迟后执行特定函数的动画序列的函数 private startDelayedAnimation(): void { this.OBX6txtv2 = cc.tween(this.node) .delay(1) .call(() => { this.W1cIA6G(); }) .start(); } W1cIA6G() { // 创建并启动一个进度更新的动画序列,并根据进度执行相关操作 this.createAndStartProgressAnimation(); } // 创建并启动一个进度更新的动画序列,并根据进度执行相关操作的函数 private createAndStartProgressAnimation(): void { this.OBX6txtv = cc.tween({ progress: 0 }) .to(2.85, { progress: 100 }, { progress: (start: number, end: number, current: number, ratio: number) => { // 如果当前节点有效,更新进度标签的文本显示 if (cc.isValid(this.node)) { this.wxOdV3NSqeDk2e2Prog.string = (ratio * 100 | 0) + " %"; } // 当进度接近完成时,加载指定场景 if (ratio >= 0.9999999) { cc.director.loadScene(Vl2h6kBYov1uNSwzL7.u_53B7V); } }, easing: "circInOut" }) .start(); } }