装备和技能获取逻辑改变
This commit is contained in:
@@ -12,9 +12,6 @@ export class EquipsComp extends Component {
|
||||
weapon:any=null
|
||||
armor:any=null
|
||||
accessory:any=null
|
||||
skill1:any=null
|
||||
skill2:any=null
|
||||
skill3:any=null
|
||||
boxs:Node=null
|
||||
attrs:any={
|
||||
hero_buff:getBuffNum(),
|
||||
@@ -27,11 +24,25 @@ export class EquipsComp extends Component {
|
||||
oops.message.on(GameEvent.EquipAdd,this.equip_add,this)
|
||||
oops.message.on(GameEvent.EquipRemove,this.equip_remove,this)
|
||||
this.boxs=this.node.getChildByName("boxs")
|
||||
oops.message.on(GameEvent.EQUIP_SHOW,this.do_equip_show,this)
|
||||
|
||||
}
|
||||
do_equip_show(e:GameEvent,data:any){
|
||||
console.log("[EquipsComp]:do_equip_show",data)
|
||||
this.show_equip_get("weapon")
|
||||
this.show_equip_get("armor")
|
||||
this.show_equip_get("accessory")
|
||||
}
|
||||
start(){
|
||||
this.fight_ready()
|
||||
}
|
||||
fight_ready(){
|
||||
this.hide_equip_get(null,"weapon")
|
||||
this.hide_equip_get(null,"armor")
|
||||
this.hide_equip_get(null,"accessory")
|
||||
this.hide_equip_change(null,"weapon")
|
||||
this.hide_equip_change(null,"armor")
|
||||
this.hide_equip_change(null,"accessory")
|
||||
this.boxs.getChildByName("weapon").getChildByName("icon").active=false
|
||||
this.boxs.getChildByName("armor").getChildByName("icon").active=false
|
||||
this.boxs.getChildByName("accessory").getChildByName("icon").active=false
|
||||
@@ -81,7 +92,7 @@ export class EquipsComp extends Component {
|
||||
this.count_attrs()
|
||||
}
|
||||
show_weapon(uuid:number){
|
||||
let icon = this.node.getChildByName("boxs").getChildByName("weapon").getChildByName("icon")
|
||||
let icon = this.boxs.getChildByName("weapon").getChildByName("icon")
|
||||
icon.active=true
|
||||
var icon_path = "game/heros/equips"
|
||||
resources.load(icon_path, SpriteAtlas, (err: any, atlas) => {
|
||||
@@ -91,7 +102,7 @@ export class EquipsComp extends Component {
|
||||
|
||||
}
|
||||
show_armor(uuid:number){
|
||||
let icon = this.node.getChildByName("boxs").getChildByName("armor").getChildByName("icon")
|
||||
let icon = this.boxs.getChildByName("armor").getChildByName("icon")
|
||||
icon.active=true
|
||||
var icon_path = "game/heros/equips"
|
||||
resources.load(icon_path, SpriteAtlas, (err: any, atlas) => {
|
||||
@@ -100,7 +111,7 @@ export class EquipsComp extends Component {
|
||||
});
|
||||
}
|
||||
show_accessory(uuid:number){
|
||||
let icon = this.node.getChildByName("boxs").getChildByName("accessory").getChildByName("icon")
|
||||
let icon = this.boxs.getChildByName("accessory").getChildByName("icon")
|
||||
icon.active=true
|
||||
var icon_path = "game/heros/equips"
|
||||
resources.load(icon_path, SpriteAtlas, (err: any, atlas) => {
|
||||
@@ -240,6 +251,24 @@ export class EquipsComp extends Component {
|
||||
update(dt: number): void {
|
||||
if(!smc.mission.play||smc.mission.pause) return
|
||||
}
|
||||
|
||||
private show_equip_get(e:string){
|
||||
|
||||
this.boxs.getChildByName(e).getChildByName("get").active =true
|
||||
}
|
||||
|
||||
private hide_equip_get(e:any,data:string){
|
||||
this.boxs.getChildByName(data).getChildByName("get").active =false
|
||||
}
|
||||
|
||||
private show_equip_change(e:string){
|
||||
this.boxs.getChildByName(e).getChildByName("change").active =true
|
||||
}
|
||||
|
||||
private hide_equip_change(e:any,data:any){
|
||||
this.boxs.getChildByName(data).getChildByName("change").active =false
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user