清理掉 missioncomp的 抽卡相关的 游戏逻辑

This commit is contained in:
2025-08-11 22:02:20 +08:00
parent 89daacba36
commit 5bcf5e737b
13 changed files with 2344 additions and 1061 deletions

View File

@@ -1,6 +1,8 @@
import { _decorator, Animation, AnimationClip, CCInteger, Component, Node, resources } from 'cc';
import { _decorator, Animation, AnimationClip, CCInteger, Component, Label, Node, resources } from 'cc';
import { smc } from '../common/SingletonModuleComp';
import { HeroInfo } from '../common/config/heroSet';
import { GameEvent } from '../common/config/GameEvent';
import { oops } from 'db://oops-framework/core/Oops';
const { ccclass, property } = _decorator;
@ccclass('HeroReadyCom')
@@ -10,6 +12,7 @@ export class HeroReadyCom extends Component {
start() {
this.update_hero()
oops.message.on(GameEvent.UpdateHero,this.update_hero,this)
}
update(deltaTime: number) {
@@ -18,8 +21,10 @@ export class HeroReadyCom extends Component {
update_hero(){
let hero = smc.fight_heros[this.slot]
if(hero==0){
this.no_hero()
return
}
this.node.getChildByName("add").active=false
let hero_data = HeroInfo[hero]
console.log("[HeroReadyCom]hero_data",smc.fight_heros,hero,smc.fight_heros[this.slot],this.slot,hero_data)
let anm_path=hero_data.path
@@ -27,9 +32,14 @@ export class HeroReadyCom extends Component {
this.node.getChildByName("icon").getComponent(Animation).addClip(clip);
this.node.getChildByName("icon").getComponent(Animation).play("idle");
});
this.node.getChildByName("lv").getChildByName("num").getComponent(Label).string=smc.heros[hero].lv.toString()
// console.log("[HeroReadyCom]clip",this.node.getChildByName("icon").getComponent(Animation))
}
no_hero(){
this.node.getChildByName("lv").active=false
this.node.getChildByName("add").active=true
}
}