| 1234567891011121314151617181920212223242526272829303132333435363738394041424344454647 |
- import LoadingBar from "../../component/LoadingBar";
- const { ccclass, property } = cc._decorator;
- @ccclass
- export default class Login extends cc.Component {
- @property(LoadingBar)
- private bar: LoadingBar = null;
- @property({ displayName: '加载文字', type: cc.Label })
- private lbl_progress: cc.Label = null;
- @property({ displayName: '服务协议', type: cc.Label })
- private lbl_server: cc.Label = null;
- @property({ displayName: '隐私协议', type: cc.Label })
- private lbl_privacy: cc.Label = null;
- onLoad() {
- this.setProgress(0);
- }
- start() {
- }
- private setProgress(current) {
- this.bar.setProgress(current);
- this.lbl_progress.string = "加载不消耗流量 " + current + "%";
- }
- private process: number = 0;
- update() {
- if (this.process < 100) {
- this.process += 2;
- this.setProgress(this.process);
- }
- if (!gData.loginData.loadResCompelete) {
- gData.loginData.loadLocalRes();
- return;
- }
- if (!gData.loginData.isLogin) {
- gData.loginData.login();
- return;
- }
- if (gData.gameData.dataFinish) {//登录流程完毕
- mk.ui.openPanel("game/prefab/game");
- }
- }
- }
|