云环境和本地调试 添加
This commit is contained in:
@@ -56,16 +56,17 @@ export class HInfoComp extends Component {
|
||||
this.node.getChildByName("luck").active=lv == 0
|
||||
}
|
||||
uplevel(){
|
||||
let hero_data = HeroInfo[this.h_uuid]
|
||||
let lv=smc.heros[this.h_uuid].lv
|
||||
let {experience,gold}=getUpgradeResources(lv)
|
||||
if(smc.vmdata.mission_data.exp<=experience||smc.vmdata.mission_data.gold<=gold){
|
||||
if(smc.vmdata.data.exp<=experience||smc.vmdata.data.gold<=gold){
|
||||
oops.gui.toast("经验或金币不足")
|
||||
return
|
||||
}
|
||||
smc.spendGameProperty("exp",experience)
|
||||
smc.spendGameProperty("gold",gold)
|
||||
smc.levelUpHero(this.h_uuid)
|
||||
let result=smc.levelUpHero(this.h_uuid,experience,gold)
|
||||
if(!result){
|
||||
oops.gui.toast("网络出错了,升级失败,请重试")
|
||||
return
|
||||
}
|
||||
this.update_data(this.h_uuid)
|
||||
oops.message.dispatchEvent(GameEvent.UpdateHero, {})
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user