mirror of
https://gitee.com/jisol/jisol-game/
synced 2025-09-27 02:36:14 +00:00
tj
This commit is contained in:
9
JisolGameCocos/assets/script/ui/Consts/Pet/table.meta
Normal file
9
JisolGameCocos/assets/script/ui/Consts/Pet/table.meta
Normal file
@@ -0,0 +1,9 @@
|
||||
{
|
||||
"ver": "1.2.0",
|
||||
"importer": "directory",
|
||||
"imported": true,
|
||||
"uuid": "6e2f3412-9b6f-4443-bbce-5ea77f976f92",
|
||||
"files": [],
|
||||
"subMetas": {},
|
||||
"userData": {}
|
||||
}
|
@@ -0,0 +1,40 @@
|
||||
import { sp } from 'cc';
|
||||
import { _decorator, Component, Node } from 'cc';
|
||||
import { app } from '../../../../App';
|
||||
import { UIPetAnim } from '../../../../consts/GData';
|
||||
import { v3 } from 'cc';
|
||||
import { PlayerPetOV } from '../../../../consts/API';
|
||||
import { Label } from 'cc';
|
||||
import { PlayerPetEvent } from '../../../../data/PlayerPetData';
|
||||
import { TB } from '../../../../config/data/schema';
|
||||
const { ccclass, property } = _decorator;
|
||||
|
||||
@ccclass('TablePetIcon')
|
||||
export class TablePetIcon extends Component {
|
||||
|
||||
@property(sp.Skeleton)
|
||||
spine:sp.Skeleton;
|
||||
|
||||
info:TB.TbGRole;
|
||||
|
||||
onLoad(){
|
||||
this.onUpdateView();
|
||||
}
|
||||
|
||||
//刷新页面
|
||||
onUpdateView(){
|
||||
|
||||
this.spine.skeletonData = app.battleRes.getRoleSpine(this.info.id);
|
||||
this.spine.setAnimation(0,UIPetAnim.std,true);
|
||||
|
||||
}
|
||||
|
||||
//设置icon
|
||||
set(info:TB.TbGRole){
|
||||
this.info = info;
|
||||
this.onUpdateView();
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
@@ -0,0 +1 @@
|
||||
{"ver":"4.0.23","importer":"typescript","imported":true,"uuid":"05d744d8-e1b6-44e8-9bba-92c0cd075583","files":[],"subMetas":{},"userData":{}}
|
@@ -0,0 +1,64 @@
|
||||
import { _decorator, Component, Node } from 'cc';
|
||||
import { PlayerPetOV } from '../../../../consts/API';
|
||||
import { TablePetIcon } from './TablePetIcon';
|
||||
import { TB } from '../../../../config/data/schema';
|
||||
const { ccclass, property } = _decorator;
|
||||
|
||||
@ccclass('TablePetIconSelect')
|
||||
export class TablePetIconSelect extends Component {
|
||||
|
||||
@property(TablePetIcon)
|
||||
petIcon:TablePetIcon;
|
||||
|
||||
//选中节点
|
||||
@property(Node)
|
||||
select:Node;
|
||||
|
||||
//不可选中节点
|
||||
@property(Node)
|
||||
noselect:Node;
|
||||
|
||||
//是否被选中
|
||||
_isSelect:boolean = false;
|
||||
get isSelect(){
|
||||
return this._isSelect;
|
||||
}
|
||||
set isSelect(data:boolean){
|
||||
this._isSelect = data;
|
||||
this.onUpdateSelect();
|
||||
}
|
||||
|
||||
//是否不可选中
|
||||
_isNoSelect:boolean = false;
|
||||
get isNoSelect(){
|
||||
return this._isNoSelect;
|
||||
}
|
||||
set isNoSelect(data:boolean){
|
||||
this._isNoSelect = data;
|
||||
this.onUpdateSelect();
|
||||
}
|
||||
|
||||
onLoad(){
|
||||
this.onUpdateSelect();
|
||||
this.noselect.active = false;
|
||||
this.select.active = false;
|
||||
}
|
||||
|
||||
|
||||
//设置
|
||||
set(info:TB.TbGRole){
|
||||
|
||||
this.petIcon.set(info);
|
||||
|
||||
}
|
||||
|
||||
onUpdateSelect(){
|
||||
|
||||
this.select.active = this.isSelect;
|
||||
this.noselect.active = this.isNoSelect;
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
@@ -0,0 +1 @@
|
||||
{"ver":"4.0.23","importer":"typescript","imported":true,"uuid":"2a3437d8-2840-4e4b-84ce-1290f82757e9","files":[],"subMetas":{},"userData":{}}
|
@@ -0,0 +1,19 @@
|
||||
import { _decorator, Component, Node } from 'cc';
|
||||
import JNScrollViewItem from '../../../../../../extensions/ngame/assets/ngame/util/components/scrollview/JNScrollViewItem';
|
||||
import { TablePetIconSelect } from './TablePetIconSelect';
|
||||
import { TB } from '../../../../config/data/schema';
|
||||
const { ccclass, property } = _decorator;
|
||||
|
||||
@ccclass('TablePetIconSelectScroll')
|
||||
export class TablePetIconSelectScroll extends JNScrollViewItem<TB.TbGRole> {
|
||||
|
||||
@property(TablePetIconSelect)
|
||||
select:TablePetIconSelect;
|
||||
|
||||
protected start(): void {
|
||||
this.select.set(this.data);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
@@ -0,0 +1 @@
|
||||
{"ver":"4.0.23","importer":"typescript","imported":true,"uuid":"393e0aef-0f34-424a-b7ea-31a39d58f653","files":[],"subMetas":{},"userData":{}}
|
Reference in New Issue
Block a user