mirror of
https://gitee.com/jisol/jisol-game/
synced 2025-06-26 19:34:47 +00:00
35 lines
735 B
TypeScript
35 lines
735 B
TypeScript
|
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;
|
||
|
}
|
||
|
}
|
||
|
|
||
|
}
|
||
|
|
||
|
|