mirror of
https://gitee.com/jisol/jisol-game/
synced 2025-09-26 18:26:23 +00:00
提交资源
This commit is contained in:
@@ -288,18 +288,26 @@ export class TbGResource {
|
||||
constructor(_json_: any) {
|
||||
if (_json_.id === undefined) { throw new Error() }
|
||||
this.id = _json_.id
|
||||
if (_json_.icon === undefined) { throw new Error() }
|
||||
this.icon = _json_.icon
|
||||
if (_json_.name === undefined) { throw new Error() }
|
||||
this.name = _json_.name
|
||||
if (_json_.tig === undefined) { throw new Error() }
|
||||
this.tig = _json_.tig
|
||||
if (_json_.args === undefined) { throw new Error() }
|
||||
this.args = _json_.args
|
||||
if (_json_.quality === undefined) { throw new Error() }
|
||||
this.quality = _json_.quality
|
||||
}
|
||||
|
||||
/**
|
||||
* id
|
||||
*/
|
||||
readonly id: number
|
||||
/**
|
||||
* 资源图片
|
||||
*/
|
||||
readonly icon: string
|
||||
/**
|
||||
* 资源名称
|
||||
*/
|
||||
@@ -312,6 +320,10 @@ export class TbGResource {
|
||||
* 额外参数
|
||||
*/
|
||||
readonly args: string
|
||||
/**
|
||||
* 资源品质
|
||||
*/
|
||||
readonly quality: number
|
||||
|
||||
resolve(tables:Tables)
|
||||
{
|
||||
|
@@ -91,7 +91,7 @@ export interface ResourceOV{
|
||||
playerId:number; //玩家Id
|
||||
resourceTbId:number; //资源配置表Id
|
||||
resourceValue:number; //资源数量
|
||||
version:number; //版本号
|
||||
version:number; //版本号
|
||||
}
|
||||
|
||||
export interface ModeOnHookRankingOV{
|
||||
|
@@ -23,6 +23,8 @@ export enum ResourceUpdateType{
|
||||
ADD = 2, //添加资源数量
|
||||
}
|
||||
|
||||
//资源信息
|
||||
|
||||
//玩家资源数据
|
||||
export default class ResourceData extends BaseData{
|
||||
|
||||
|
@@ -5,6 +5,7 @@ import { Component } from "cc";
|
||||
export enum IconTypeEnum{
|
||||
品质 = "品质",
|
||||
宠物装备 = "宠物装备",
|
||||
资源 = "资源",
|
||||
}
|
||||
|
||||
export default class TbResource {
|
||||
|
@@ -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