mirror of
https://gitee.com/jisol/jisol-game/
synced 2025-06-26 11:24:46 +00:00
43 lines
952 B
TypeScript
43 lines
952 B
TypeScript
|
import { _decorator, Component, Node } from 'cc';
|
||
|
import JNScrollViewItem from '../../../../../extensions/ngame/assets/ngame/util/components/scrollview/JNScrollViewItem';
|
||
|
import { PlayerPetOV } from '../../../consts/API';
|
||
|
import { sp } from 'cc';
|
||
|
import { app } from '../../../App';
|
||
|
import { UIPetAnim } from '../../../consts/GData';
|
||
|
const { ccclass, property } = _decorator;
|
||
|
|
||
|
@ccclass('PetIconItem')
|
||
|
export class PetIconItem extends JNScrollViewItem<PlayerPetOV> {
|
||
|
|
||
|
@property(sp.Skeleton)
|
||
|
spine:sp.Skeleton;
|
||
|
|
||
|
//选中节点
|
||
|
@property(Node)
|
||
|
select:Node;
|
||
|
|
||
|
//是否被选中
|
||
|
isSelect:boolean = false;
|
||
|
|
||
|
onLoad(){
|
||
|
this.onUpdateSelect();
|
||
|
}
|
||
|
|
||
|
start(): void {
|
||
|
|
||
|
//显示角色
|
||
|
this.spine.skeletonData = app.battleRes.roleSpine[this.data.petTbId];
|
||
|
this.spine.setAnimation(0,UIPetAnim.std,true);
|
||
|
|
||
|
}
|
||
|
|
||
|
onUpdateSelect(){
|
||
|
|
||
|
this.select.active = this.isSelect;
|
||
|
|
||
|
}
|
||
|
|
||
|
}
|
||
|
|
||
|
|