feat(游戏数据): 添加金币字段并调整英雄属性和UI
- 在 SingletonModuleComp 中添加 gold 字段作为玩家金币数据 - 调整 HeroConf 配置:降低英雄属性上限并将购买成本设为0 - 修改 HInfoComp 中购买英雄的金币检查逻辑,使用 smc.data.gold 替代 smc.vmdata.gold - 更新 role_controller.prefab 的UI元素位置、尺寸和精灵资源
This commit is contained in:
@@ -210,7 +210,7 @@ export class HInfoComp extends CCComp {
|
||||
animComponent.play("idle");
|
||||
}
|
||||
} else {
|
||||
mLogger.log(this.debugMode, 'HInfoComp', `[HInfoComp]: Failed to load animation for hero ${uuid}`, err);
|
||||
mLogger.log(this.debugMode, 'HInfoComp', ` Failed to load animation for hero ${uuid}`, err);
|
||||
}
|
||||
});
|
||||
|
||||
@@ -294,8 +294,8 @@ export class HInfoComp extends CCComp {
|
||||
this.node.getChildByName("ranks").active=false
|
||||
}
|
||||
buy_hero(){
|
||||
mLogger.log(this.debugMode, 'HInfoComp', "[HInfoComp]:buy_hero",this.h_uuid)
|
||||
if(smc.vmdata.gold < HeroConf.COST) {
|
||||
mLogger.log(this.debugMode, 'HInfoComp', "buy_hero",this.h_uuid)
|
||||
if(smc.data.gold < HeroConf.COST) {
|
||||
oops.gui.toast("金币不足")
|
||||
return
|
||||
}
|
||||
@@ -305,7 +305,7 @@ export class HInfoComp extends CCComp {
|
||||
this.close_buy()
|
||||
}
|
||||
start_mission() {
|
||||
mLogger.log(this.debugMode, 'HInfoComp', "[HInfoComp]:start_mission")
|
||||
mLogger.log(this.debugMode, 'HInfoComp', "start_mission")
|
||||
oops.message.dispatchEvent(GameEvent.MissionStart, {})
|
||||
this.node.active=false;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user