开始商店ui

This commit is contained in:
2025-08-13 00:13:28 +08:00
parent d464491172
commit ba3fa75006
16 changed files with 16042 additions and 8701 deletions

View File

@@ -27,6 +27,7 @@ export class SingletonModuleComp extends ecs.Comp {
mission:1,
gold:100,
diamond:100,
meat:0,
}
fight_heros:any={
0:5001,
@@ -54,12 +55,24 @@ export class SingletonModuleComp extends ecs.Comp {
score:0,//分数
diamond:0,//钻石
mission:1,//关卡
meat:0,//肉
mon_num:0,//怪物数量
hero_num:0,//英雄数量
wave_time_num:0,//波次时间
in_fight:false,
fight_time:0,//战斗时间
},
reward:{
gold:0,
meat:0,
diamond:0,
score:0,
exp:0,
gcard:0,
bcard:0,
pcard:0,
ycard:0,
}
};
vmAdd() {
VM.add(this.vmdata, "data");
@@ -388,7 +401,24 @@ export class SingletonModuleComp extends ecs.Comp {
console.log(`[SMC]: 金币变更: ${currentGold} -> ${newGold} (${amount > 0 ? '+' : ''}${amount})`);
return newGold;
}
syncData(){
this.vmdata.mission_data.gold=this.getGameProperty("gold", 0)
this.vmdata.mission_data.meat=this.getGameProperty("meat", 0)
this.vmdata.mission_data.diamond=this.getGameProperty("diamond", 0)
this.vmdata.mission_data.mission=this.getGameProperty("mission", 1)
this.vmdata.mission_data.score=this.getGameProperty("score", 0)
}
initReward(){
this.vmdata.reward.gold=0
this.vmdata.reward.meat=0
this.vmdata.reward.diamond=0
this.vmdata.reward.score=0
this.vmdata.reward.exp=0
this.vmdata.reward.gcard=0
this.vmdata.reward.bcard=0
this.vmdata.reward.pcard=0
this.vmdata.reward.ycard=0
}
/**
* 消耗金币
* @param amount 消耗数量