减少复杂度,上阵英雄改为3个

This commit is contained in:
2024-12-27 09:56:14 +08:00
parent 79bda9f0db
commit 2231c5ceb1
5 changed files with 16 additions and 18 deletions

View File

@@ -4,6 +4,7 @@ import { CCComp } from "../../../../extensions/oops-plugin-framework/assets/modu
import { MissionHomeComp } from "../map/MissionHomeComp";
import { oops } from "../../../../extensions/oops-plugin-framework/assets/core/Oops";
import { smc } from "../common/SingletonModuleComp";
import { GameSet } from "../common/config/BoxSet";
const { ccclass, property } = _decorator;
@@ -34,8 +35,8 @@ export class HeroSelectComp extends CCComp {
this.mhc_home.cancel_hero(this.h_uuid)
return
}
if(smc.fight_heros.length>= 5){
oops.gui.toast("英雄数量不能超过5个")
if(smc.fight_heros.length>= GameSet.HERO_NUM){
oops.gui.toast(`英雄数量不能超过 ${GameSet.HERO_NUM}`);
return
}
smc.fight_heros.push(this.h_uuid)