import { _decorator,director } from "cc"; import { GameMng } from "../GameMng"; import { Singleton } from "./Singleton"; import UILoading from "./UILoading"; import { UIManager } from "./UIManager"; const {ccclass, property} = _decorator; @ccclass export default class ScenceMng extends Singleton() { loadts:UILoading=null; public load(scenceName:string){ let gnode= UIManager.AddPrefab(GameMng.Instance.uiloading) this.loadts=gnode.getComponent(UILoading); director.preloadScene(scenceName, this.onProgress.bind(this), ()=>{ director.loadScene(scenceName); }) } public loadGameLaunch(scenceName:string){ director.preloadScene(scenceName, this.onProgress.bind(this), ()=>{ director.loadScene(scenceName); }) } private onProgress(now,total,item){ // this.loadts.progress.progress = now / total; } }