import { Util } from "../../../../Common/Utils/Util" ; import { Item } from "../../../../ItemList/Item" ; import { BreakRequirementsData } from "./PhaseBreakData" ; const { ccclass , property } = cc . _decorator ; @ ccclass export class BreakRequirements extends Item < BreakRequirementsData > { private _data : BreakRequirementsData ; @ property ( cc . Sprite ) public icon : cc . Sprite ; @ property ( cc . Label ) public amount : cc . Label ; getData ( ) { return this . _data ; } showByData ( ) { window . appContext . Pool . setSpriteFrameByUrl ( this . _data . requirement , this . icon ) ; if ( this . _data . requirement == "exp" ) { this . amount . string = " *" + this . _data . amount ; } else if ( this . _data . requirement == "consciousness" ) { this . amount . string = window . appContext . ConfigManager . GetconsciousnessById ( this . _data . amount ) . name ; } else if ( this . _data . requirement == "physique" ) { this . amount . string = window . appContext . ConfigManager . GetphysiqueById ( this . _data . amount ) . name ; } this . amount . node . color = this . _data . check_requirement ? Util . ButtonColor ( "common" ) : Util . ButtonColor ( "shortage" ) ; } bindData ( currentIndex , data ) { this . _data = data ; this . showByData ( ) ; } reset ( currentIndex ) { } select ( selected ) { } getClickButton ( ) { return this . getComponent ( cc . Button ) ; } }