import { Util } from "../../../../Common/Utils/Util" ; import { Item } from "../../../../ItemList/Item" ; import { BreakSkillsData } from "./PhaseBreakData" ; const { ccclass , property } = cc . _decorator ; @ ccclass export class BreakSkills extends Item < BreakSkillsData > { private _data : BreakSkillsData ; @ property ( cc . Sprite ) public icon : cc . Sprite ; @ property ( cc . Sprite ) public icon_bg : cc . Sprite ; @ property ( cc . Sprite ) public icon_phase : cc . Sprite ; @ property ( cc . Label ) public level : cc . Label ; getData ( ) { return this . _data ; } showByData ( ) { window . appContext . Pool . setSpriteFrameByUrl ( this . _data . skill . icon , this . icon ) ; window . appContext . Pool . setSpriteFrameByUrl ( this . _data . skill . icon_bg , this . icon_bg ) ; window . appContext . Pool . setSpriteFrameByUrl ( this . _data . skill . icon_phase , this . icon_phase ) ; this . level . string = "LV" + this . _data . level ; this . level . node . color = this . _data . check_skill ? Util . ButtonColor ( "common" ) : Util . ButtonColor ( "shortage" ) ; } bindData ( currentIndex , data ) { this . _data = data ; this . showByData ( ) ; } reset ( currentIndex ) { } select ( selected ) { } getClickButton ( ) { return this . getComponent ( cc . Button ) ; } }