稍微改了点
This commit is contained in:
@@ -2,7 +2,7 @@ import { _decorator, resources, Sprite, SpriteAtlas ,Node, ProgressBar, tween, v
|
||||
import { ecs } from "../../../../extensions/oops-plugin-framework/assets/libs/ecs/ECS";
|
||||
import { CCComp } from "../../../../extensions/oops-plugin-framework/assets/module/common/CCComp";
|
||||
import { GameEvent } from "../common/config/GameEvent";
|
||||
import { SkillSet } from "../common/config/SkillSet";
|
||||
import { CdType, SkillSet } from "../common/config/SkillSet";
|
||||
import { smc } from "../common/SingletonModuleComp";
|
||||
import { oops } from "db://oops-framework/core/Oops";
|
||||
import { MissionEvent } from "../common/config/MissionEvent";
|
||||
@@ -19,7 +19,6 @@ export class EquipSkillComp extends CCComp {
|
||||
boxs:Node=null
|
||||
skill1_cd_bar_progress:any=null
|
||||
skill2_cd_bar_progress:any=null
|
||||
skill3_cd_bar_progress:any=null
|
||||
/** 视图层逻辑代码分离演示 */
|
||||
onLoad() {
|
||||
this.on(GameEvent.UseSkillCard, this.get_skill, this);
|
||||
@@ -28,6 +27,7 @@ export class EquipSkillComp extends CCComp {
|
||||
this.boxs=this.node.getChildByName("boxs")
|
||||
this.skill1_cd_bar_progress=this.boxs.getChildByName("skill1").getChildByName("icon").getChildByName("cd").getComponent(ProgressBar)
|
||||
this.skill2_cd_bar_progress=this.boxs.getChildByName("skill2").getChildByName("icon").getChildByName("cd").getComponent(ProgressBar)
|
||||
this.boxs.getChildByName("skill2").getChildByName("icon").getChildByName("cd").active=false
|
||||
}
|
||||
start(){
|
||||
this.fight_ready()
|
||||
@@ -118,7 +118,7 @@ export class EquipSkillComp extends CCComp {
|
||||
}
|
||||
|
||||
get_skill(e:GameEvent,data:any){
|
||||
console.log("get_skill",data)
|
||||
// console.log("get_skill",data)
|
||||
switch(data.slot){
|
||||
case "skill1":
|
||||
this.skill1.uuid=data.uuid
|
||||
@@ -128,6 +128,9 @@ export class EquipSkillComp extends CCComp {
|
||||
this.skill1.cd_time=SkillSet[data.uuid].cd
|
||||
let icon1 = this.boxs.getChildByName("skill1").getChildByName("icon")
|
||||
icon1.active=true
|
||||
if(SkillSet[data.uuid].CdType!=CdType.cd){
|
||||
icon1.getChildByName("cd").active=false
|
||||
}
|
||||
var icon_path = "game/heros/cards"
|
||||
resources.load(icon_path, SpriteAtlas, (err: any, atlas) => {
|
||||
const sprite = icon1.getChildByName("skill").getComponent(Sprite);
|
||||
|
||||
Reference in New Issue
Block a user