mirror of
https://gitee.com/jisol/jisol-game/
synced 2025-12-11 15:29:42 +00:00
提交
This commit is contained in:
@@ -0,0 +1,34 @@
|
||||
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;
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user