资源刷新 以及 出售

This commit is contained in:
DESKTOP-5RP3AKU\Jisol
2023-11-20 03:47:00 +08:00
parent cb64a6c25f
commit 98b7a52b45
41 changed files with 1483 additions and 263 deletions

View File

@@ -147,7 +147,7 @@
},
"_depth": 1,
"_stencil": 0,
"_clearFlags": 6,
"_clearFlags": 7,
"_rect": {
"__type__": "cc.Rect",
"x": 0,

View File

@@ -144,7 +144,7 @@
},
"_depth": 1,
"_stencil": 0,
"_clearFlags": 7,
"_clearFlags": 6,
"_rect": {
"__type__": "cc.Rect",
"x": 0,

View File

@@ -309,6 +309,39 @@ export class TbGOnHookGlobal {
}
export namespace TB {
export class TbGResource {
constructor(_json_: any) {
if (_json_.id === undefined) { throw new Error() }
this.id = _json_.id
if (_json_.name === undefined) { throw new Error() }
this.name = _json_.name
if (_json_.tig === undefined) { throw new Error() }
this.tig = _json_.tig
}
/**
* id
*/
readonly id: number
/**
* 资源名称
*/
readonly name: string
/**
* 描述
*/
readonly tig: string
resolve(tables:Tables)
{
}
}
}
export class TbGGlobal{
@@ -535,6 +568,38 @@ export class TbGOnHookGlobal{
export class TbGResource{
private _dataMap: Map<number, TB.TbGResource>
private _dataList: TB.TbGResource[]
constructor(_json_: any) {
this._dataMap = new Map<number, TB.TbGResource>()
this._dataList = []
for(var _json2_ of _json_) {
let _v: TB.TbGResource
_v = new TB.TbGResource(_json2_)
this._dataList.push(_v)
this._dataMap.set(_v.id, _v)
}
}
getDataMap(): Map<number, TB.TbGResource> { return this._dataMap; }
getDataList(): TB.TbGResource[] { return this._dataList; }
get(key: number): TB.TbGResource | undefined { return this._dataMap.get(key); }
resolve(tables:Tables)
{
for(let data of this._dataList)
{
data.resolve(tables)
}
}
}
type JsonLoader = (file: string) => any
export class Tables {
@@ -552,6 +617,8 @@ export class Tables {
get TbGMap(): TbGMap { return this._TbGMap;}
private _TbGOnHookGlobal: TbGOnHookGlobal
get TbGOnHookGlobal(): TbGOnHookGlobal { return this._TbGOnHookGlobal;}
private _TbGResource: TbGResource
get TbGResource(): TbGResource { return this._TbGResource;}
constructor(loader: JsonLoader) {
this._TbGGlobal = new TbGGlobal(loader('tbgglobal'))
@@ -561,6 +628,7 @@ export class Tables {
this._TbGRoleSkill = new TbGRoleSkill(loader('tbgroleskill'))
this._TbGMap = new TbGMap(loader('tbgmap'))
this._TbGOnHookGlobal = new TbGOnHookGlobal(loader('tbgonhookglobal'))
this._TbGResource = new TbGResource(loader('tbgresource'))
this._TbGGlobal.resolve(this)
this._TbGRole.resolve(this)
@@ -569,5 +637,6 @@ export class Tables {
this._TbGRoleSkill.resolve(this)
this._TbGMap.resolve(this)
this._TbGOnHookGlobal.resolve(this)
this._TbGResource.resolve(this)
}
}

View File

@@ -0,0 +1,7 @@
[
{
"id": 90001,
"name": "金币",
"tig": "金币 (目前叫做金币 名称还没有定) 游戏的基础资源 用于升级宠物"
}
]

View File

@@ -0,0 +1,11 @@
{
"ver": "2.0.1",
"importer": "json",
"imported": true,
"uuid": "97d4ae8c-12df-45cd-8629-87e18f6e8ddf",
"files": [
".json"
],
"subMetas": {},
"userData": {}
}

View File

@@ -31,20 +31,20 @@
"_active": true,
"_components": [
{
"__id__": 67
"__id__": 68
},
{
"__id__": 69
"__id__": 70
},
{
"__id__": 71
"__id__": 72
},
{
"__id__": 73
"__id__": 74
}
],
"_prefab": {
"__id__": 75
"__id__": 76
},
"_lpos": {
"__type__": "cc.Vec3",
@@ -1109,11 +1109,11 @@
"__id__": 62
},
{
"__id__": 64
"__id__": 65
}
],
"_prefab": {
"__id__": 66
"__id__": 67
},
"_lpos": {
"__type__": "cc.Vec3",
@@ -1394,7 +1394,11 @@
"__prefab": {
"__id__": 63
},
"clickEvents": [],
"clickEvents": [
{
"__id__": 64
}
],
"_interactable": true,
"_transition": 3,
"_normalColor": {
@@ -1440,6 +1444,16 @@
"__type__": "cc.CompPrefabInfo",
"fileId": "46kCHG8yRJL65tBER5eoyC"
},
{
"__type__": "cc.ClickEvent",
"target": {
"__id__": 1
},
"component": "",
"_componentId": "fe2adMH7MZF5KXgR4KwvwJX",
"handler": "onClickSell",
"customEventData": ""
},
{
"__type__": "cc.Widget",
"_name": "",
@@ -1450,7 +1464,7 @@
},
"_enabled": true,
"__prefab": {
"__id__": 65
"__id__": 66
},
"_alignFlags": 37,
"_target": null,
@@ -1499,7 +1513,7 @@
},
"_enabled": true,
"__prefab": {
"__id__": 68
"__id__": 69
},
"_contentSize": {
"__type__": "cc.Size",
@@ -1527,7 +1541,7 @@
},
"_enabled": true,
"__prefab": {
"__id__": 70
"__id__": 71
},
"_customMaterial": null,
"_srcBlendFactor": 2,
@@ -1572,7 +1586,7 @@
},
"_enabled": true,
"__prefab": {
"__id__": 72
"__id__": 73
},
"_alignFlags": 40,
"_target": null,
@@ -1608,7 +1622,7 @@
},
"_enabled": true,
"__prefab": {
"__id__": 74
"__id__": 75
},
"views": {
"__id__": 46

View File

@@ -0,0 +1,9 @@
{
"ver": "1.2.0",
"importer": "directory",
"imported": true,
"uuid": "984854ce-ea02-4a29-9a85-ae0d93f322d0",
"files": [],
"subMetas": {},
"userData": {}
}

View File

@@ -0,0 +1,341 @@
[
{
"__type__": "cc.Prefab",
"_name": "玩家资源显示",
"_objFlags": 0,
"__editorExtras__": {},
"_native": "",
"data": {
"__id__": 1
},
"optimizationPolicy": 0,
"persistent": false
},
{
"__type__": "cc.Node",
"_name": "玩家资源显示",
"_objFlags": 0,
"__editorExtras__": {},
"_parent": null,
"_children": [
{
"__id__": 2
}
],
"_active": true,
"_components": [
{
"__id__": 10
},
{
"__id__": 12
},
{
"__id__": 14
}
],
"_prefab": {
"__id__": 16
},
"_lpos": {
"__type__": "cc.Vec3",
"x": -46.486,
"y": 520.668,
"z": 0
},
"_lrot": {
"__type__": "cc.Quat",
"x": 0,
"y": 0,
"z": 0,
"w": 1
},
"_lscale": {
"__type__": "cc.Vec3",
"x": 1,
"y": 1,
"z": 1
},
"_mobility": 0,
"_layer": 33554432,
"_euler": {
"__type__": "cc.Vec3",
"x": 0,
"y": 0,
"z": 0
},
"_id": ""
},
{
"__type__": "cc.Node",
"_name": "Label",
"_objFlags": 0,
"__editorExtras__": {},
"_parent": {
"__id__": 1
},
"_children": [],
"_active": true,
"_components": [
{
"__id__": 3
},
{
"__id__": 5
},
{
"__id__": 7
}
],
"_prefab": {
"__id__": 9
},
"_lpos": {
"__type__": "cc.Vec3",
"x": 0,
"y": 0,
"z": 0
},
"_lrot": {
"__type__": "cc.Quat",
"x": 0,
"y": 0,
"z": 0,
"w": 1
},
"_lscale": {
"__type__": "cc.Vec3",
"x": 1,
"y": 1,
"z": 1
},
"_mobility": 0,
"_layer": 33554432,
"_euler": {
"__type__": "cc.Vec3",
"x": 0,
"y": 0,
"z": 0
},
"_id": ""
},
{
"__type__": "cc.UITransform",
"_name": "",
"_objFlags": 0,
"__editorExtras__": {},
"node": {
"__id__": 2
},
"_enabled": true,
"__prefab": {
"__id__": 4
},
"_contentSize": {
"__type__": "cc.Size",
"width": 17.34765625,
"height": 54.4
},
"_anchorPoint": {
"__type__": "cc.Vec2",
"x": 0.5,
"y": 0.5
},
"_id": ""
},
{
"__type__": "cc.CompPrefabInfo",
"fileId": "7aYBKLDBBBb6gSDGMjRc7V"
},
{
"__type__": "cc.Label",
"_name": "",
"_objFlags": 0,
"__editorExtras__": {},
"node": {
"__id__": 2
},
"_enabled": true,
"__prefab": {
"__id__": 6
},
"_customMaterial": null,
"_srcBlendFactor": 2,
"_dstBlendFactor": 4,
"_color": {
"__type__": "cc.Color",
"r": 255,
"g": 255,
"b": 255,
"a": 255
},
"_string": "0",
"_horizontalAlign": 1,
"_verticalAlign": 1,
"_actualFontSize": 24,
"_fontSize": 24,
"_fontFamily": "Arial",
"_lineHeight": 40,
"_overflow": 0,
"_enableWrapText": true,
"_font": null,
"_isSystemFontUsed": true,
"_spacingX": 0,
"_isItalic": false,
"_isBold": true,
"_isUnderline": false,
"_underlineHeight": 2,
"_cacheMode": 0,
"_id": ""
},
{
"__type__": "cc.CompPrefabInfo",
"fileId": "ca5SxOX1lI6KJW85+4yzjd"
},
{
"__type__": "cc.LabelOutline",
"_name": "",
"_objFlags": 0,
"__editorExtras__": {},
"node": {
"__id__": 2
},
"_enabled": true,
"__prefab": {
"__id__": 8
},
"_color": {
"__type__": "cc.Color",
"r": 0,
"g": 0,
"b": 0,
"a": 255
},
"_width": 2,
"_id": ""
},
{
"__type__": "cc.CompPrefabInfo",
"fileId": "3eNlsJF9tNXZmkwP9l76/E"
},
{
"__type__": "cc.PrefabInfo",
"root": {
"__id__": 1
},
"asset": {
"__id__": 0
},
"fileId": "e0KCY2i/BDFrz3/8Kl7xXv",
"instance": null,
"targetOverrides": null,
"nestedPrefabInstanceRoots": null
},
{
"__type__": "cc.UITransform",
"_name": "",
"_objFlags": 0,
"__editorExtras__": {},
"node": {
"__id__": 1
},
"_enabled": true,
"__prefab": {
"__id__": 11
},
"_contentSize": {
"__type__": "cc.Size",
"width": 120,
"height": 60
},
"_anchorPoint": {
"__type__": "cc.Vec2",
"x": 0.5,
"y": 0.5
},
"_id": ""
},
{
"__type__": "cc.CompPrefabInfo",
"fileId": "31Y91EbyVPvqbf1yXWW3mP"
},
{
"__type__": "cc.Sprite",
"_name": "",
"_objFlags": 0,
"__editorExtras__": {},
"node": {
"__id__": 1
},
"_enabled": true,
"__prefab": {
"__id__": 13
},
"_customMaterial": null,
"_srcBlendFactor": 2,
"_dstBlendFactor": 4,
"_color": {
"__type__": "cc.Color",
"r": 235,
"g": 235,
"b": 235,
"a": 255
},
"_spriteFrame": {
"__uuid__": "7d8f9b89-4fd1-4c9f-a3ab-38ec7cded7ca@f9941",
"__expectedType__": "cc.SpriteFrame"
},
"_type": 0,
"_fillType": 0,
"_sizeMode": 0,
"_fillCenter": {
"__type__": "cc.Vec2",
"x": 0,
"y": 0
},
"_fillStart": 0,
"_fillRange": 0,
"_isTrimmedMode": true,
"_useGrayscale": false,
"_atlas": null,
"_id": ""
},
{
"__type__": "cc.CompPrefabInfo",
"fileId": "829ZRhv3JLKq0wDBYUk3xR"
},
{
"__type__": "dd6ff3gNGFAzKeTlGPK1jnx",
"_name": "",
"_objFlags": 0,
"__editorExtras__": {},
"node": {
"__id__": 1
},
"_enabled": true,
"__prefab": {
"__id__": 15
},
"type": 90001,
"show": {
"__id__": 5
},
"_id": ""
},
{
"__type__": "cc.CompPrefabInfo",
"fileId": "22Ciflh0NO/ZUfdrKoAktL"
},
{
"__type__": "cc.PrefabInfo",
"root": {
"__id__": 1
},
"asset": {
"__id__": 0
},
"fileId": "7ehoARooRAIIfX4ttdeppc",
"instance": null,
"targetOverrides": null
}
]

View File

@@ -0,0 +1,13 @@
{
"ver": "1.1.49",
"importer": "prefab",
"imported": true,
"uuid": "f9a7b5b8-0c1a-4b0c-a6c7-bbf2e077442a",
"files": [
".json"
],
"subMetas": {},
"userData": {
"syncNodeName": "玩家资源显示"
}
}