继续补充横屏逻辑

This commit is contained in:
2025-05-26 21:17:05 +08:00
parent 12b16320e6
commit 4e0e536c49
5 changed files with 45 additions and 26 deletions

View File

@@ -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"