import { _decorator, Component, Node } from 'cc';
import { PetIcon } from './PetIcon';
import { PlayerPetOV } from '../../../consts/API';
const { ccclass, property } = _decorator;

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

    //没有宠物的节点
    @property(Node)
    noPet:Node;
    
    //有宠物的节点
    @property(Node)
    havePet:Node;

    //宠物节点
    @property(PetIcon)
    petIcon:PetIcon;

    set(info:PlayerPetOV){
        if(info){
            this.noPet.active = false;
            this.havePet.active = true;
            this.petIcon.set(info);
        }else{
            this.noPet.active = true;
            this.havePet.active = false;
        }
    }

}


