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('IntoBattlePetIcon') export class IntoBattlePetIcon extends JNScrollViewItem { @property(sp.Skeleton) spine:sp.Skeleton; //选中节点 @property(Node) select:Node; //不可选中节点 @property(Node) noselect:Node; //是否被选中 isSelect:boolean = false; //是否不可选中 isNoSelect:boolean = false; onLoad(){ this.onUpdateSelect(); this.noselect.active = false; this.select.active = false; } start(): void { //显示角色 this.spine.skeletonData = app.battleRes.roleSpine[this.data.petTbId]; this.spine.setAnimation(0,UIPetAnim.std,true); } onUpdateSelect(){ this.select.active = this.isSelect; this.noselect.active = this.isNoSelect; } }