2025-04-24 17:03:28 +08:00

43 lines
1.2 KiB
TypeScript

import ItemUtil from "../../core/ItemUtil";
import SkillBase, { ESkillQuality } from "../skill/core/SkillBase";
import SiHaiNingJing from "../skill/horse/low/SiHaiNingJing";
const { ccclass, property } = cc._decorator;
@ccclass
export default class SuitSkillItem extends cc.Component {
@property(cc.Sprite)
icon:cc.Sprite=null;
@property(cc.Node)
level_1:cc.Node=null;
@property(cc.Node)
level_2:cc.Node=null;
@property(cc.Node)
level_3:cc.Node=null;
suitSkill:SkillBase;
load(skill:SkillBase){
let frame:cc.SpriteFrame=ItemUtil.getItemIcon(skill.icon);
this.icon.spriteFrame=frame;
this.suitSkill=skill;
if(skill.quality==ESkillQuality.LOW){
this.level_1.active=true;
this.level_2.active=false;
this.level_3.active=false;
}else if(skill.quality==ESkillQuality.HIGH){
this.level_1.active=false;
this.level_2.active=true;
this.level_3.active=false;
}else if(skill.quality==ESkillQuality.FINAL){
this.level_1.active=false;
this.level_2.active=false;
this.level_3.active=true;
}
}
}