|
@@ -14,8 +14,6 @@ export class main extends Component {
|
|
|
@property(Node) laoding_view_wait = null;
|
|
|
@property(Node) send_msg_wait = null;
|
|
|
|
|
|
- private m_home_view:Node = null
|
|
|
-
|
|
|
protected start(): void {
|
|
|
game.frameRate = 61; //修复 iphone 15 抖动问题
|
|
|
// PhysicsSystem2D.instance.fixedTimeStep = 1 / 60;
|
|
@@ -24,31 +22,25 @@ export class main extends Component {
|
|
|
this.home_node.removeAllChildren()
|
|
|
uiManager.Instance().init(this.ui_parent,this.laoding_view_wait,this.send_msg_wait)
|
|
|
|
|
|
- this.preloadHomeView()
|
|
|
this.showLoadingView()
|
|
|
}
|
|
|
|
|
|
private showLoadingView() {
|
|
|
uiManager.Instance().showUi(config.UI.loading_view, this.node, (node:Node)=>{
|
|
|
- node.getComponent(loading_view).startLoading(()=>{
|
|
|
- this.showHomeView()
|
|
|
+ node.getComponent(loading_view).startLoading((v:loading_view)=>{
|
|
|
+ this.showHomeView(()=>{
|
|
|
+ v.close()
|
|
|
+ })
|
|
|
})
|
|
|
})
|
|
|
}
|
|
|
-
|
|
|
- private preloadHomeView() {
|
|
|
- this.home_node.active = false
|
|
|
+
|
|
|
+ private showHomeView(cb) {
|
|
|
uiManager.Instance().showUi(config.UI.home,this.home_node,(node:Node)=>{
|
|
|
- this.m_home_view = node
|
|
|
+ node.getComponent(home).init()
|
|
|
+ cb && cb()
|
|
|
})
|
|
|
}
|
|
|
-
|
|
|
- private showHomeView() {
|
|
|
- this.home_node.active = true
|
|
|
- setTimeout(()=>{
|
|
|
- this.m_home_view.getComponent(home).init()
|
|
|
- },20)
|
|
|
- }
|
|
|
}
|
|
|
|
|
|
|