继续补充横屏逻辑
This commit is contained in:
@@ -58,17 +58,15 @@ export class TopBar extends Laya.Script {
|
||||
|
||||
this.btn_classic.on(Laya.Event.CLICK, this, ()=>{
|
||||
if (this.isClassic == false) {
|
||||
this.isClassic = true
|
||||
this.onClickTab()
|
||||
this.onClickTab(true)
|
||||
}
|
||||
})
|
||||
this.btn_dc.on(Laya.Event.CLICK, this, ()=>{
|
||||
if (this.isClassic) {
|
||||
this.isClassic = false
|
||||
this.onClickTab()
|
||||
this.onClickTab(false)
|
||||
}
|
||||
})
|
||||
this.onClickTab()
|
||||
this.onClickTab(this.isClassic)
|
||||
|
||||
|
||||
var showToggle = Laya.LocalStorage.getItem("showToggle")
|
||||
@@ -110,8 +108,9 @@ export class TopBar extends Laya.Script {
|
||||
|
||||
}
|
||||
|
||||
onClickTab(): void {
|
||||
if (this.isClassic) {
|
||||
onClickTab(isClassic: boolean): void {
|
||||
this.isClassic = true
|
||||
if (isClassic) {
|
||||
UIManager.getInstance().closeTrophyUI()
|
||||
UIManager.getInstance().closeDCUI()
|
||||
UIManager.getInstance().loadStageUI(config.DEFAULT_STAGE_ID)
|
||||
@@ -122,6 +121,7 @@ export class TopBar extends Laya.Script {
|
||||
}
|
||||
this.updateLeftTab()
|
||||
}
|
||||
|
||||
updateLeftTab(): void {
|
||||
this.sprite_classic.alpha = this.isClassic ? 1 : 0.1
|
||||
this.label_classic.color = this.isClassic ? "#ffffff" : "#0e2a53"
|
||||
|
||||
Reference in New Issue
Block a user