任务开始 技能清空

This commit is contained in:
2025-06-06 16:38:48 +08:00
parent fee9fc9852
commit 94128b05ca
2 changed files with 76 additions and 66 deletions

View File

@@ -14,20 +14,42 @@ const { ccclass, property } = _decorator;
@ecs.register('EquipsComp', false)
export class EquipsCompComp extends CCComp {
weapon:any={
weapon:any=null
armor:any=null
ring:any=null
skill1:any=null
skill2:any=null
skill3:any=null
boxs:Node=null
/** 视图层逻辑代码分离演示 */
onLoad() {
this.on(GameEvent.UseSkillCard, this.get_skill, this);
this.on(GameEvent.FightReady,this.fight_ready,this)
this.boxs=this.node.getChildByName("boxs")
}
start(){
this.fight_ready()
}
fight_ready(){
this.boxs.getChildByName("skill1").getChildByName("icon").active=false
this.boxs.getChildByName("skill2").getChildByName("icon").active=false
this.boxs.getChildByName("skill3").getChildByName("icon").active=false
this.boxs.getChildByName("weapon").getChildByName("icon").active=false
this.boxs.getChildByName("armor").getChildByName("icon").active=false
this.boxs.getChildByName("ring").getChildByName("icon").active=false
this.weapon={
uuid:0,
name:"weapon",
type:"weapon",
level:0,
quality:0,
skill_uuid:0,
skill_name:"skill1",
skill_type:0,
cd:0,
cd_time:0,
}
armor:any={
this.armor={
uuid:0,
name:"armor",
type:"armor",
@@ -39,7 +61,7 @@ export class EquipsCompComp extends CCComp {
cd:0,
cd_time:0,
}
ring:any={
this.ring={
uuid:0,
name:"ring",
type:"ring",
@@ -51,7 +73,7 @@ export class EquipsCompComp extends CCComp {
cd:0,
cd_time:0,
}
skill1:any={
this.skill1={
uuid:0,
name:"skill1",
type:0, //1 被动 0 主动
@@ -60,7 +82,7 @@ export class EquipsCompComp extends CCComp {
cd:0,
cd_time:0,
}
skill2:any={
this.skill2={
uuid:0,
name:"skill2",
type:0,//
@@ -69,7 +91,7 @@ export class EquipsCompComp extends CCComp {
cd:0,
cd_time:0,
}
skill3:any={
this.skill3={
uuid:0,
name:"skill3",
type:0,//
@@ -78,19 +100,6 @@ export class EquipsCompComp extends CCComp {
cd:0,
cd_time:0,
}
boxs:Node=null
/** 视图层逻辑代码分离演示 */
onLoad() {
this.on(GameEvent.UseSkillCard, this.get_skill, this);
}
start(){
this.boxs=this.node.getChildByName("boxs")
this.boxs.getChildByName("skill1").getChildByName("icon").active=false
this.boxs.getChildByName("skill2").getChildByName("icon").active=false
this.boxs.getChildByName("skill3").getChildByName("icon").active=false
this.boxs.getChildByName("weapon").getChildByName("icon").active=false
this.boxs.getChildByName("armor").getChildByName("icon").active=false
this.boxs.getChildByName("ring").getChildByName("icon").active=false
}
update(dt: number): void {
if(!smc.mission.play||smc.mission.pause) return

View File

@@ -52,6 +52,7 @@ export class MissionComp extends CCComp {
async mission_start(){
smc.mission.status=MissionStatus.ready
oops.message.dispatchEvent(GameEvent.FightReady)
this.node.active=true
this.data_init()
this.hart_hero_load()