import { _decorator, Component, Node } from 'cc'; import { oops } from 'db://oops-framework/core/Oops'; import { GameEvent } from '../common/config/GameEvent'; const { ccclass, property } = _decorator; @ccclass('FightConComp') export class FightConComp extends Component { attrs:any={ hero:{ ap:0, hp:0, atk_count:0, atk_speed:0, skill_dmg:0, skill_cd:0, }, ally:{ ap:0, hp:0, atk_count:0, atk_speed:0, skill_dmg:0, skill_cd:0, }, enemy:{ ap:0, hp:0, atk_count:0, atk_speed:0, skill_dmg:0, skill_cd:0, }, friend:{ ap:0, hp:0, atk_count:0, atk_speed:0, skill_dmg:0, skill_cd:0, } } onLoad(){ // console.log("fight con start") oops.message.on(GameEvent.EquipChange,this.equip_change,this) oops.message.on(GameEvent.FightReady,this.fight_ready,this) } equip_change(e:GameEvent,equip:any){ this.attrs.hero=equip.hero this.attrs.ally=equip.ally this.attrs.enemy=equip.enemy this.attrs.friend=equip.friend } fight_ready(e:GameEvent){ this.attrs.hero=this.attrs.ally=this.attrs.enemy=this.attrs.friend={ ap:0, hp:0, atk_count:0, atk_speed:0, skill_dmg:0, skill_cd:0, } } update(deltaTime: number) { } }