import Plat from "../utils/Palt"; import SubLoad from "../utils/SubLoad"; import PrefabUtil from "../utils/manager/PrefabUtil"; import Log from "../utils/util/Log"; const { ccclass, property } = cc._decorator; @ccclass export class LoginDog extends cc.Component { @property(cc.Node) startGame: cc.Node = null; @property(cc.ProgressBar) ProgressBar: cc.ProgressBar = null; onLoad() { this.scheduleOnce(this.startLoad, 0); } // private flags: Array = new Array(); public onnext() { } public startLoad() { SubLoad.loadSub(() => { PrefabUtil.load((() => { cc.director.preloadScene("Main", (a, b) => { let temp = a / b * 0.1 this.ProgressBar.progress = this.ProgressBar.progress < temp ? temp : this.ProgressBar.progress + 0.9 this.ProgressBar.node.active = false // this.startGame.active = true this.onClickInGame() }); }), (a, b) => { let temp = a / b * 0.9 this.ProgressBar.progress = this.ProgressBar.progress < temp ? temp : this.ProgressBar.progress }); }) Plat.init(); } onClickInGame() { cc.director.loadScene("Main", () => { // Log.info("main场景加载成功") }); } }