import { sp } from 'cc';
import { _decorator, Component, Node } from 'cc';
import { app } from '../../../../App';
import { UIPetAnim } from '../../../../consts/GData';
import { v3 } from 'cc';
import { PlayerPetOV } from '../../../../consts/API';
import { Label } from 'cc';
import { PlayerPetEvent } from '../../../../data/PlayerPetData';
import { TB } from '../../../../config/data/schema';
const { ccclass, property } = _decorator;

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

    @property(sp.Skeleton)
    spine:sp.Skeleton;

    info:TB.TbGRole;

    //刷新页面
    onUpdateView(){

        this.spine.skeletonData = app.battleRes.getRoleSpine(this.info.id);
        this.spine.setAnimation(0,UIPetAnim.std,true);
        
    }

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


