稍微改了点

This commit is contained in:
panw
2025-07-25 09:55:08 +08:00
parent a5a0c26e8f
commit 0ba25c1cac
11 changed files with 32118 additions and 20509 deletions

View File

@@ -20,14 +20,12 @@ export class BarCompComp extends CCComp {
hero:HeroViewComp = null;
friend:HeroViewComp = null;
boss:HeroViewComp = null;
update_count:number=0
/** 视图层逻辑代码分离演示 */
protected onLoad(): void {
this.on(GameEvent.FightReady,this.readay,this)
this.on(GameEvent.MasterCalled,this.master_called,this)
this.on(GameEvent.APChange,this.ap_change,this)
this.on(GameEvent.CanUpdateLv,this.show_uplv_button,this)
this.on(GameEvent.UseEnhancement,this.hide_uplv_button,this)
}
start() {
@@ -38,8 +36,6 @@ export class BarCompComp extends CCComp {
private readay(){
this.node.getChildByName("bar").active = true
this.node.getChildByName("bar").getChildByName("more").active=false
this.node.getChildByName("bar").getChildByName("uplv").active=false
this.update_count=0
}
private master_called(e:any,data:any){
this.node.getChildByName("bar").active = true
@@ -63,15 +59,7 @@ export class BarCompComp extends CCComp {
}
}
show_uplv_button(){
this.update_count++
this.node.getChildByName("bar").getChildByName("uplv").active=true
}
hide_uplv_button(){
this.update_count--
if(this.update_count > 0) return
this.node.getChildByName("bar").getChildByName("uplv").active=false
}
show_master_more(){
let barNode = this.node.getChildByName("bar");
let node = barNode.getChildByName("more");