mirror of
https://gitee.com/jisol/jisol-game/
synced 2025-09-27 02:36:14 +00:00
提交资源
This commit is contained in:
@@ -0,0 +1,43 @@
|
||||
import { Label } from 'cc';
|
||||
import { Sprite } from 'cc';
|
||||
import { _decorator, Component, Node } from 'cc';
|
||||
import { TD } from '../../../App';
|
||||
import TbResource, { IconTypeEnum } from '../../../tools/TbResource';
|
||||
const { ccclass, property } = _decorator;
|
||||
|
||||
@ccclass('ResourceIcon')
|
||||
export class ResourceIcon extends Component {
|
||||
|
||||
//资源品质
|
||||
@property(Sprite)
|
||||
quality:Sprite;
|
||||
|
||||
//资源图标
|
||||
@property(Sprite)
|
||||
icon:Sprite;
|
||||
|
||||
//资源数量
|
||||
@property(Label)
|
||||
num:Label;
|
||||
|
||||
//设置icon
|
||||
set(id:number,value:number){
|
||||
|
||||
let config = TD.TbGResource.get(id);
|
||||
|
||||
//设置ICON
|
||||
TbResource.loadSpriteIcon(IconTypeEnum.资源,config.icon,this.icon,this);
|
||||
//设置品质
|
||||
TbResource.loadSpriteIcon(IconTypeEnum.品质,config.quality,this.quality,this);
|
||||
|
||||
this.num.string = ``;
|
||||
if(value > 1){
|
||||
//显示数量
|
||||
this.num.string = `${value}`;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
@@ -0,0 +1,9 @@
|
||||
{
|
||||
"ver": "4.0.23",
|
||||
"importer": "typescript",
|
||||
"imported": true,
|
||||
"uuid": "8f263c37-4fff-471d-8080-0fa65f88e527",
|
||||
"files": [],
|
||||
"subMetas": {},
|
||||
"userData": {}
|
||||
}
|
@@ -0,0 +1,9 @@
|
||||
{
|
||||
"ver": "1.2.0",
|
||||
"importer": "directory",
|
||||
"imported": true,
|
||||
"uuid": "c2a043f8-f6d7-41a1-a090-6c52eb12fce8",
|
||||
"files": [],
|
||||
"subMetas": {},
|
||||
"userData": {}
|
||||
}
|
@@ -0,0 +1,18 @@
|
||||
import { _decorator, Component, Node } from 'cc';
|
||||
import { ResourceIcon } from '../ResourceIcon';
|
||||
const { ccclass, property } = _decorator;
|
||||
|
||||
@ccclass('PlayerResourceIcon')
|
||||
export class PlayerResourceIcon extends Component {
|
||||
|
||||
@property(ResourceIcon)
|
||||
icon:ResourceIcon;
|
||||
|
||||
//设置 ( 资源Id )
|
||||
set(id:number){
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
@@ -0,0 +1,9 @@
|
||||
{
|
||||
"ver": "4.0.23",
|
||||
"importer": "typescript",
|
||||
"imported": true,
|
||||
"uuid": "69b494ce-f644-48e9-a9ba-f7e6e195c92d",
|
||||
"files": [],
|
||||
"subMetas": {},
|
||||
"userData": {}
|
||||
}
|
9
JisolGameCocos/assets/script/ui/Resource.meta
Normal file
9
JisolGameCocos/assets/script/ui/Resource.meta
Normal file
@@ -0,0 +1,9 @@
|
||||
{
|
||||
"ver": "1.2.0",
|
||||
"importer": "directory",
|
||||
"imported": true,
|
||||
"uuid": "20b32230-d874-412e-a657-bce1296e932f",
|
||||
"files": [],
|
||||
"subMetas": {},
|
||||
"userData": {}
|
||||
}
|
20
JisolGameCocos/assets/script/ui/Resource/PacksackView.ts
Normal file
20
JisolGameCocos/assets/script/ui/Resource/PacksackView.ts
Normal file
@@ -0,0 +1,20 @@
|
||||
import { _decorator, Component, Node } from 'cc';
|
||||
import JNLayerBase from '../../../../extensions/ngame/assets/ngame/ui/base/JNLayerBase';
|
||||
const { ccclass, property } = _decorator;
|
||||
|
||||
//背包页面
|
||||
@ccclass('PacksackView')
|
||||
export class PacksackView extends JNLayerBase {
|
||||
|
||||
onJNLoad(data?: any): void {
|
||||
super.onJNLoad(data)
|
||||
}
|
||||
|
||||
//更新页面
|
||||
onUpdateView(){
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
@@ -0,0 +1,9 @@
|
||||
{
|
||||
"ver": "4.0.23",
|
||||
"importer": "typescript",
|
||||
"imported": true,
|
||||
"uuid": "e29532d1-b556-4091-848a-7137fd53bdcf",
|
||||
"files": [],
|
||||
"subMetas": {},
|
||||
"userData": {}
|
||||
}
|
Reference in New Issue
Block a user