提交捕捉

This commit is contained in:
PC-20230316NUNE\Administrator
2023-11-17 18:29:39 +08:00
parent 62b72bdcfc
commit cb64a6c25f
59 changed files with 4757 additions and 953 deletions

View File

@@ -21,9 +21,6 @@ export class IntoBattleView extends JNLayerBase {
@property(JNScrollView)
views:JNScrollView; //宠物列表
@property(Prefab)
petIconPrefab; //宠物Icon预制体
@property(sp.Skeleton)
spine:sp.Skeleton; //当前选中的宠物
@@ -58,7 +55,7 @@ export class IntoBattleView extends JNLayerBase {
//设置不可选中
this.views.getItems<IntoBattlePetIcon>().forEach(item => {
if(PlayerTacticalData.getIns().getTacticalInfo().indexOf(item.data.petId) != -1)
item.isNoSelect = true; //如果在阵法里则不可选中
item.select.isNoSelect = true; //如果在阵法里则不可选中
})
//向子节点添加点击事件
@@ -73,15 +70,13 @@ export class IntoBattleView extends JNLayerBase {
//默认都不选中
this.views.getItems<IntoBattlePetIcon>().forEach(item => {
item.isSelect = false;
item.onUpdateSelect();
item.select.isSelect = false;
})
//设置选中
if(this.index != -1){
let current = this.views.getItems<IntoBattlePetIcon>()[this.index]
current.isSelect = true;
current.onUpdateSelect();
current.select.isSelect = true;
//显示选中宠物
this.spine.skeletonData = app.battleRes.roleSpine[this.pets[this.index].petTbId];
@@ -94,7 +89,7 @@ export class IntoBattleView extends JNLayerBase {
onClickItem(index:number){
//判断是否不可选中
if(this.views.getItems<IntoBattlePetIcon>()[index].isNoSelect) {
if(this.views.getItems<IntoBattlePetIcon>()[index].select.isNoSelect) {
app.layer.Open(GUI.Tips,{text:"当前宠物已上阵"})
return;
}