修改了挺多, 继续完善 战斗流程设计
This commit is contained in:
@@ -25,7 +25,7 @@ export class CardComp extends CCComp {
|
||||
onLoad(){
|
||||
// this.on(GameEvent.HeroSelect,this.hero_select,this)
|
||||
// this.on(GameEvent.HeroSkillSelect,this.hero_skill_select,this)
|
||||
this.on(GameEvent.CardRefresh,this.onCardRefresh,this)
|
||||
// this.on(GameEvent.CardRefresh,this.rad,this)
|
||||
}
|
||||
|
||||
start() {
|
||||
@@ -36,10 +36,10 @@ export class CardComp extends CCComp {
|
||||
this.node.getChildByName("Button").active=false
|
||||
this.node.getChildByName("show").active=false
|
||||
}
|
||||
hero_select(event: string, args: any){
|
||||
hero_select(args: any){
|
||||
this.c_type=0
|
||||
this.c_uuid=args.uuid
|
||||
console.log("onCardRefresh c_uuid:"+this.c_uuid)
|
||||
console.log("card hero_select c_uuid:"+this.c_uuid)
|
||||
this.show_hero(this.c_uuid)
|
||||
this.node.getChildByName("show").active=false
|
||||
this.node.getChildByName("anim").getChildByName("up").getComponent(Animation).play('carsup')
|
||||
@@ -48,7 +48,7 @@ export class CardComp extends CCComp {
|
||||
this.node.getChildByName("Button").active=true
|
||||
}, 0.1);
|
||||
}
|
||||
hero_skill_select(event: string, args: any){
|
||||
hero_skill_select(args: any){
|
||||
this.c_type=1
|
||||
console.log("card hero_skill_select",args)
|
||||
this.c_uuid=args.uuid
|
||||
@@ -60,7 +60,7 @@ export class CardComp extends CCComp {
|
||||
this.node.getChildByName("Button").active=true
|
||||
}, 0.1);
|
||||
}
|
||||
equip_select(event: string, args: any){
|
||||
equip_select(args: any){
|
||||
this.c_type=2
|
||||
this.c_uuid=args.uuid
|
||||
this.node.getChildByName("show").active=false
|
||||
@@ -70,20 +70,22 @@ export class CardComp extends CCComp {
|
||||
this.node.getChildByName("show").active=true
|
||||
this.node.getChildByName("Button").active=true
|
||||
}, 0.1);
|
||||
}
|
||||
onCardRefresh(event: string, args: any){
|
||||
|
||||
let card =getRandomCardUUID()
|
||||
console.log("onCardRefresh 开始请求卡牌",card)
|
||||
}
|
||||
func_select(args: any){
|
||||
console.log("card func_select",args)
|
||||
}
|
||||
random_select(){
|
||||
let card =getRandomCardUUID() //随机获取卡牌类型
|
||||
console.log("rad 开始请求卡牌",card)
|
||||
switch(card.type){
|
||||
case cardType.HERO:
|
||||
this.hero_select(GameEvent.HeroSelect,card)
|
||||
this.hero_select(card)
|
||||
break
|
||||
case cardType.SKILL:
|
||||
this.hero_skill_select(GameEvent.HeroSkillSelect,card)
|
||||
this.hero_skill_select(card)
|
||||
break
|
||||
case cardType.EQUIP:
|
||||
this.equip_select(GameEvent.EquipSelect,card)
|
||||
this.equip_select(card)
|
||||
break
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user