123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566 |
- 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<number> = 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场景加载成功")
- });
- }
- }
|