天赋替换完成
This commit is contained in:
@@ -18,6 +18,7 @@ export class TalsComp extends Component {
|
||||
tal5:any=null
|
||||
tal6:any=null
|
||||
boxs:Node=null
|
||||
cur_tal:string=""
|
||||
// attrs:any={
|
||||
// hero_buff:getBuffNum(),
|
||||
// enemy_buff:getBuffNum(),
|
||||
@@ -52,31 +53,49 @@ export class TalsComp extends Component {
|
||||
console.log("[TalsComp]:tal_add",data)
|
||||
switch(data.slot){
|
||||
case TalentSlot[0]:
|
||||
if(this.tal1.uuid!=0) {
|
||||
oops.message.dispatchEvent(GameEvent.RemoveTalent,{uuid:this.tal1.uuid})
|
||||
}
|
||||
this.tal1.uuid=data.uuid
|
||||
this.tal1.name=data.name
|
||||
this.show_tal(data.uuid,TalentSlot[0])
|
||||
break
|
||||
case TalentSlot[1]:
|
||||
if(this.tal2.uuid!=0) {
|
||||
oops.message.dispatchEvent(GameEvent.RemoveTalent,{uuid:this.tal2.uuid})
|
||||
}
|
||||
this.tal2.uuid=data.uuid
|
||||
this.tal2.name=data.name
|
||||
this.show_tal(data.uuid,TalentSlot[1])
|
||||
break
|
||||
case TalentSlot[2]:
|
||||
if(this.tal3.uuid!=0) {
|
||||
oops.message.dispatchEvent(GameEvent.RemoveTalent,{uuid:this.tal3.uuid})
|
||||
}
|
||||
this.tal3.uuid=data.uuid
|
||||
this.tal3.name=data.name
|
||||
this.show_tal(data.uuid,TalentSlot[2])
|
||||
break
|
||||
case TalentSlot[3]:
|
||||
if(this.tal4.uuid!=0) {
|
||||
oops.message.dispatchEvent(GameEvent.RemoveTalent,{uuid:this.tal4.uuid})
|
||||
}
|
||||
this.tal4.uuid=data.uuid
|
||||
this.tal4.name=data.name
|
||||
this.show_tal(data.uuid,TalentSlot[3])
|
||||
break
|
||||
case TalentSlot[4]:
|
||||
if(this.tal5.uuid!=0) {
|
||||
oops.message.dispatchEvent(GameEvent.RemoveTalent,{uuid:this.tal5.uuid})
|
||||
}
|
||||
this.tal5.uuid=data.uuid
|
||||
this.tal5.name=data.name
|
||||
this.show_tal(data.uuid,TalentSlot[4])
|
||||
break
|
||||
case TalentSlot[5]:
|
||||
if(this.tal6.uuid!=0) {
|
||||
oops.message.dispatchEvent(GameEvent.RemoveTalent,{uuid:this.tal6.uuid})
|
||||
}
|
||||
this.tal6.uuid=data.uuid
|
||||
this.tal6.name=data.name
|
||||
this.show_tal(data.uuid,TalentSlot[5])
|
||||
@@ -100,11 +119,15 @@ export class TalsComp extends Component {
|
||||
}
|
||||
to_change_tal(){
|
||||
console.log("[TalsComp]:to_change_tal")
|
||||
if(this.cur_tal=="") return
|
||||
oops.message.dispatchEvent(GameEvent.TalentSelect,{slot:this.cur_tal})
|
||||
this.close_tal_info()
|
||||
}
|
||||
close_tal_info(){
|
||||
console.log("[TalsComp]:close_tal_info")
|
||||
let node= this.node.getChildByName("info")
|
||||
tween(node).to(0.1,{position:v3(-1000,node.position.y,0)}).start()
|
||||
this.cur_tal=""
|
||||
}
|
||||
show_tal_info(e:any,data:any){
|
||||
console.log("[TalsComp]:show_tal_info",e,data)
|
||||
@@ -113,26 +136,32 @@ export class TalsComp extends Component {
|
||||
case TalentSlot[0]:
|
||||
if(this.tal1.uuid==0) return
|
||||
uuid=this.tal1.uuid
|
||||
this.cur_tal=TalentSlot[0]
|
||||
break
|
||||
case TalentSlot[1]:
|
||||
if(this.tal2.uuid==0) return
|
||||
uuid=this.tal2.uuid
|
||||
this.cur_tal=TalentSlot[1]
|
||||
break
|
||||
case TalentSlot[2]:
|
||||
if(this.tal3.uuid==0) return
|
||||
uuid=this.tal3.uuid
|
||||
this.cur_tal=TalentSlot[2]
|
||||
break
|
||||
case TalentSlot[3]:
|
||||
if(this.tal4.uuid==0) return
|
||||
uuid=this.tal4.uuid
|
||||
this.cur_tal=TalentSlot[3]
|
||||
break
|
||||
case TalentSlot[4]:
|
||||
if(this.tal5.uuid==0) return
|
||||
uuid=this.tal5.uuid
|
||||
this.cur_tal=TalentSlot[4]
|
||||
break
|
||||
case TalentSlot[5]:
|
||||
if(this.tal6.uuid==0) return
|
||||
uuid=this.tal6.uuid
|
||||
this.cur_tal=TalentSlot[5]
|
||||
break
|
||||
}
|
||||
let node= this.node.getChildByName("info")
|
||||
|
||||
Reference in New Issue
Block a user