| | |
| | | import { Sdk } from "./Sdk/Sdk"; |
| | | import { SdkToutiao } from "./Sdk/SdkToutiao"; |
| | | import DataTool from "./Sdk/DataTool"; |
| | | import Global from "./Global"; |
| | | |
| | | const { ccclass, property } = cc._decorator; |
| | | |
| | |
| | | @property(cc.Button) |
| | | buttonCancel: cc.Button = null; |
| | | |
| | | @property(cc.Button) |
| | | buttonStartGame: cc.Button = null; |
| | | |
| | | onLoad() { |
| | | cc.game.setFrameRate(60.01); |
| | | |
| | | this.ppNode.active = false; |
| | | this.buttonStartGame.node.active = false; |
| | | } |
| | | |
| | | start() { |
| | |
| | | Userdata.loadUserdata(() => { |
| | | this.scheduleOnce(() => { |
| | | this.openPrivacyPolicy(); |
| | | }, 1); |
| | | }, 2); |
| | | |
| | | }); |
| | | } else { |
| | |
| | | |
| | | startGame() { |
| | | if (Sdk.isHuawei) { |
| | | Sdk.ins.startGame(() => { |
| | | cc.director.loadScene(this.nextSceneName); |
| | | Sdk.ins.startGame((result) => { |
| | | if (result) {//自动登录成功 |
| | | cc.director.loadScene(this.nextSceneName); |
| | | } else {//显示开始游戏按钮 |
| | | this.buttonStartGame.node.active = true; |
| | | this.ppNode.active = false; |
| | | } |
| | | }); |
| | | } else { |
| | | cc.director.loadScene(this.nextSceneName); |
| | |
| | | |
| | | this.startGame(); |
| | | } |
| | | |
| | | onClickStartGame() { |
| | | Global.debounceClicks(() => { |
| | | this.startGame(); |
| | | })(); |
| | | } |
| | | } |