import { sp } from 'cc';
import { _decorator, Component, Node } from 'cc';
import { app } from '../../../../App';
import { UIPetAnim } from '../../../../consts/GData';
import { TB } from '../../../../config/data/schema';
import TbResource, { IconTypeEnum } from '../../../../tools/TbResource';
import { Sprite } from 'cc';
const { ccclass, property } = _decorator;

@ccclass('TablePetEquipIcon')
export class TablePetEquipIcon extends Component {

    @property(Sprite)
    sprite:Sprite;
    @property(Sprite)
    quality:Sprite;

    info:TB.TbGRoleEquip;

    onLoad(){
        this.onUpdateView();
    }

    //刷新页面
    onUpdateView(){

        TbResource.loadSpriteIcon(IconTypeEnum.宠物装备,this.info.icon,this.sprite,this);
        TbResource.loadSpriteIcon(IconTypeEnum.品质,this.info.quality,this.quality,this);
        
    }

    //设置icon
    set(info:TB.TbGRoleEquip){
        this.info = info;
        this.onUpdateView();
    }
    
}


