This commit is contained in:
DESKTOP-5RP3AKU\Jisol
2024-01-19 02:42:37 +08:00
parent bc2ddf1fcd
commit ed4e094536
36 changed files with 3752 additions and 123 deletions

View File

@@ -1,5 +1,6 @@
import { _decorator, Component, Node } from 'cc';
import { ResourceIcon } from '../ResourceIcon';
import ResourceData from '../../../../data/ResourceData';
const { ccclass, property } = _decorator;
@ccclass('PlayerResourceIcon')
@@ -10,7 +11,7 @@ export class PlayerResourceIcon extends Component {
//设置 ( 资源Id )
set(id:number){
this.icon.set(id,ResourceData.getIns().getValue(id))
}
}

View File

@@ -0,0 +1,20 @@
import { _decorator } from 'cc';
import JNScrollViewItem from '../../../../../../extensions/ngame/assets/ngame/util/components/scrollview/JNScrollViewItem';
import { PlayerResourceIcon } from './PlayerResourceIcon';
const { ccclass, property } = _decorator;
@ccclass('PlayerResourceIconScroll')
export class PlayerResourceIconScroll extends JNScrollViewItem<number> {
@property(PlayerResourceIcon)
icon:PlayerResourceIcon;
onInit(data:number){
this.icon.set(data);
}
}

View File

@@ -0,0 +1,9 @@
{
"ver": "4.0.23",
"importer": "typescript",
"imported": true,
"uuid": "fd24051f-603b-4413-bdc2-f88ea8cd3a3e",
"files": [],
"subMetas": {},
"userData": {}
}

View File

@@ -0,0 +1,62 @@
import { _decorator, Component, Node } from 'cc';
import { PlayerResourceIcon } from './PlayerResourceIcon';
const { ccclass, property } = _decorator;
@ccclass('PlayerResourceIconSelect')
export class PlayerResourceIconSelect extends Component {
@property(PlayerResourceIcon)
icon:PlayerResourceIcon;
//选中节点
@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(id:number){
this.icon.set(id);
}
onUpdateSelect(){
this.select.active = this.isSelect;
this.noselect.active = this.isNoSelect;
}
}

View File

@@ -0,0 +1,9 @@
{
"ver": "4.0.23",
"importer": "typescript",
"imported": true,
"uuid": "c1ae1056-03c0-4291-b34e-7f9dcd04e8de",
"files": [],
"subMetas": {},
"userData": {}
}

View File

@@ -0,0 +1,19 @@
import { _decorator, Component, Node } from 'cc';
import JNScrollViewItem from '../../../../../../extensions/ngame/assets/ngame/util/components/scrollview/JNScrollViewItem';
import { PlayerResourceIconSelect } from './PlayerResourceIconSelect';
const { ccclass, property } = _decorator;
@ccclass('PlayerResourceIconSelectScroll')
export class PlayerResourceIconSelectScroll extends JNScrollViewItem<number> {
@property(PlayerResourceIconSelect)
icon:PlayerResourceIconSelect;
onInit(data:number){
this.icon.set(data);
}
}

View File

@@ -0,0 +1,9 @@
{
"ver": "4.0.23",
"importer": "typescript",
"imported": true,
"uuid": "6ac191b2-7f6a-4990-80de-7111564e8c4f",
"files": [],
"subMetas": {},
"userData": {}
}