This commit is contained in:
DESKTOP-5RP3AKU\Jisol 2023-10-26 03:06:44 +08:00
parent cb70ba12c7
commit 09225a33c7
158 changed files with 26537 additions and 639 deletions

View File

@ -1,561 +0,0 @@
[
{
"__type__": "cc.SceneAsset",
"_name": "Demo",
"_objFlags": 0,
"__editorExtras__": {},
"_native": "",
"scene": {
"__id__": 1
}
},
{
"__type__": "cc.Scene",
"_name": "Demo",
"_objFlags": 0,
"__editorExtras__": {},
"_parent": null,
"_children": [
{
"__id__": 2
}
],
"_active": true,
"_components": [],
"_prefab": null,
"_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": 1073741824,
"_euler": {
"__type__": "cc.Vec3",
"x": 0,
"y": 0,
"z": 0
},
"autoReleaseAssets": false,
"_globals": {
"__id__": 11
},
"_id": "75317205-dd44-4ef6-9354-e1a01d17af01"
},
{
"__type__": "cc.Node",
"_name": "Canvas",
"_objFlags": 0,
"__editorExtras__": {},
"_parent": {
"__id__": 1
},
"_children": [
{
"__id__": 3
},
{
"__id__": 5
}
],
"_active": true,
"_components": [
{
"__id__": 8
},
{
"__id__": 9
},
{
"__id__": 10
}
],
"_prefab": null,
"_lpos": {
"__type__": "cc.Vec3",
"x": 360,
"y": 640,
"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": "beI88Z2HpFELqR4T5EMHpg"
},
{
"__type__": "cc.Node",
"_name": "Camera",
"_objFlags": 0,
"__editorExtras__": {},
"_parent": {
"__id__": 2
},
"_children": [],
"_active": true,
"_components": [
{
"__id__": 4
}
],
"_prefab": null,
"_lpos": {
"__type__": "cc.Vec3",
"x": 0,
"y": 0,
"z": 1000
},
"_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": 1073741824,
"_euler": {
"__type__": "cc.Vec3",
"x": 0,
"y": 0,
"z": 0
},
"_id": "ebFwiq8gBFaYpqYbdoDODe"
},
{
"__type__": "cc.Camera",
"_name": "",
"_objFlags": 0,
"__editorExtras__": {},
"node": {
"__id__": 3
},
"_enabled": true,
"__prefab": null,
"_projection": 0,
"_priority": 0,
"_fov": 45,
"_fovAxis": 0,
"_orthoHeight": 640,
"_near": 0,
"_far": 1000,
"_color": {
"__type__": "cc.Color",
"r": 0,
"g": 0,
"b": 0,
"a": 255
},
"_depth": 1,
"_stencil": 0,
"_clearFlags": 7,
"_rect": {
"__type__": "cc.Rect",
"x": 0,
"y": 0,
"width": 1,
"height": 1
},
"_aperture": 19,
"_shutter": 7,
"_iso": 0,
"_screenScale": 1,
"_visibility": 1108344832,
"_targetTexture": null,
"_postProcess": null,
"_usePostProcess": false,
"_cameraType": -1,
"_trackingType": 0,
"_id": "63WIch3o5BEYRlXzTT0oWc"
},
{
"__type__": "cc.Node",
"_name": "guaiA1a",
"_objFlags": 0,
"__editorExtras__": {},
"_parent": {
"__id__": 2
},
"_children": [],
"_active": true,
"_components": [
{
"__id__": 6
},
{
"__id__": 7
}
],
"_prefab": null,
"_lpos": {
"__type__": "cc.Vec3",
"x": 0,
"y": 99.242,
"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": "1agRMAoSFGlauL6HKiItxq"
},
{
"__type__": "cc.UITransform",
"_name": "",
"_objFlags": 0,
"__editorExtras__": {},
"node": {
"__id__": 5
},
"_enabled": true,
"__prefab": null,
"_contentSize": {
"__type__": "cc.Size",
"width": 100.08000183105469,
"height": 113.76000213623047
},
"_anchorPoint": {
"__type__": "cc.Vec2",
"x": 0,
"y": 0
},
"_id": "9b2BOkvsxGIaYgkOv9Idqz"
},
{
"__type__": "sp.Skeleton",
"_name": "",
"_objFlags": 0,
"__editorExtras__": {},
"node": {
"__id__": 5
},
"_enabled": true,
"__prefab": null,
"_customMaterial": null,
"_srcBlendFactor": 2,
"_dstBlendFactor": 4,
"_color": {
"__type__": "cc.Color",
"r": 255,
"g": 255,
"b": 255,
"a": 255
},
"_skeletonData": {
"__uuid__": "c1cb94d4-afaf-4205-97ba-8896abcb7ec1",
"__expectedType__": "sp.SkeletonData"
},
"defaultSkin": "default",
"defaultAnimation": "walk",
"_premultipliedAlpha": true,
"_timeScale": 1,
"_preCacheMode": 0,
"_cacheMode": 0,
"_defaultCacheMode": 0,
"_sockets": [],
"_useTint": false,
"_debugMesh": false,
"_debugBones": false,
"_debugSlots": false,
"_enableBatch": false,
"loop": true,
"_id": "c20+2LG6xBYJST8H1jqcAP"
},
{
"__type__": "cc.UITransform",
"_name": "",
"_objFlags": 0,
"__editorExtras__": {},
"node": {
"__id__": 2
},
"_enabled": true,
"__prefab": null,
"_contentSize": {
"__type__": "cc.Size",
"width": 720,
"height": 1280
},
"_anchorPoint": {
"__type__": "cc.Vec2",
"x": 0.5,
"y": 0.5
},
"_id": "d6rUX5yfhMlKoWX2bSbawx"
},
{
"__type__": "cc.Canvas",
"_name": "",
"_objFlags": 0,
"__editorExtras__": {},
"node": {
"__id__": 2
},
"_enabled": true,
"__prefab": null,
"_cameraComponent": {
"__id__": 4
},
"_alignCanvasWithScreen": true,
"_id": "12O/ljcVlEqLmVm3U2gEOQ"
},
{
"__type__": "cc.Widget",
"_name": "",
"_objFlags": 0,
"__editorExtras__": {},
"node": {
"__id__": 2
},
"_enabled": true,
"__prefab": null,
"_alignFlags": 45,
"_target": null,
"_left": 0,
"_right": 0,
"_top": 5.684341886080802e-14,
"_bottom": 5.684341886080802e-14,
"_horizontalCenter": 0,
"_verticalCenter": 0,
"_isAbsLeft": true,
"_isAbsRight": true,
"_isAbsTop": true,
"_isAbsBottom": true,
"_isAbsHorizontalCenter": true,
"_isAbsVerticalCenter": true,
"_originalWidth": 0,
"_originalHeight": 0,
"_alignMode": 2,
"_lockFlags": 0,
"_id": "c5V1EV8IpMtrIvY1OE9t2u"
},
{
"__type__": "cc.SceneGlobals",
"ambient": {
"__id__": 12
},
"shadows": {
"__id__": 13
},
"_skybox": {
"__id__": 14
},
"fog": {
"__id__": 15
},
"octree": {
"__id__": 16
},
"skin": {
"__id__": 17
},
"lightProbeInfo": {
"__id__": 18
},
"postSettings": {
"__id__": 19
},
"bakedWithStationaryMainLight": false,
"bakedWithHighpLightmap": false
},
{
"__type__": "cc.AmbientInfo",
"_skyColorHDR": {
"__type__": "cc.Vec4",
"x": 0,
"y": 0,
"z": 0,
"w": 0.520833125
},
"_skyColor": {
"__type__": "cc.Vec4",
"x": 0,
"y": 0,
"z": 0,
"w": 0.520833125
},
"_skyIllumHDR": 20000,
"_skyIllum": 20000,
"_groundAlbedoHDR": {
"__type__": "cc.Vec4",
"x": 0,
"y": 0,
"z": 0,
"w": 0
},
"_groundAlbedo": {
"__type__": "cc.Vec4",
"x": 0,
"y": 0,
"z": 0,
"w": 0
},
"_skyColorLDR": {
"__type__": "cc.Vec4",
"x": 0.2,
"y": 0.5,
"z": 0.8,
"w": 1
},
"_skyIllumLDR": 20000,
"_groundAlbedoLDR": {
"__type__": "cc.Vec4",
"x": 0.2,
"y": 0.2,
"z": 0.2,
"w": 1
}
},
{
"__type__": "cc.ShadowsInfo",
"_enabled": false,
"_type": 0,
"_normal": {
"__type__": "cc.Vec3",
"x": 0,
"y": 1,
"z": 0
},
"_distance": 0,
"_shadowColor": {
"__type__": "cc.Color",
"r": 76,
"g": 76,
"b": 76,
"a": 255
},
"_maxReceived": 4,
"_size": {
"__type__": "cc.Vec2",
"x": 512,
"y": 512
}
},
{
"__type__": "cc.SkyboxInfo",
"_envLightingType": 0,
"_envmapHDR": null,
"_envmap": null,
"_envmapLDR": null,
"_diffuseMapHDR": null,
"_diffuseMapLDR": null,
"_enabled": false,
"_useHDR": true,
"_editableMaterial": null,
"_reflectionHDR": null,
"_reflectionLDR": null,
"_rotationAngle": 0
},
{
"__type__": "cc.FogInfo",
"_type": 0,
"_fogColor": {
"__type__": "cc.Color",
"r": 200,
"g": 200,
"b": 200,
"a": 255
},
"_enabled": false,
"_fogDensity": 0.3,
"_fogStart": 0.5,
"_fogEnd": 300,
"_fogAtten": 5,
"_fogTop": 1.5,
"_fogRange": 1.2,
"_accurate": false
},
{
"__type__": "cc.OctreeInfo",
"_enabled": false,
"_minPos": {
"__type__": "cc.Vec3",
"x": -1024,
"y": -1024,
"z": -1024
},
"_maxPos": {
"__type__": "cc.Vec3",
"x": 1024,
"y": 1024,
"z": 1024
},
"_depth": 8
},
{
"__type__": "cc.SkinInfo",
"_enabled": false,
"_blurRadius": 0.01,
"_sssIntensity": 3
},
{
"__type__": "cc.LightProbeInfo",
"_giScale": 1,
"_giSamples": 1024,
"_bounces": 2,
"_reduceRinging": 0,
"_showProbe": true,
"_showWireframe": true,
"_showConvex": false,
"_data": null,
"_lightProbeSphereVolume": 1
},
{
"__type__": "cc.PostSettingsInfo",
"_toneMappingType": 0
}
]

View File

@ -1,11 +0,0 @@
{
"ver": "1.1.49",
"importer": "scene",
"imported": true,
"uuid": "75317205-dd44-4ef6-9354-e1a01d17af01",
"files": [
".json"
],
"subMetas": {},
"userData": {}
}

View File

@ -2,7 +2,7 @@
"ver": "1.2.0", "ver": "1.2.0",
"importer": "directory", "importer": "directory",
"imported": true, "imported": true,
"uuid": "ca2cc88c-3cee-4223-927a-3a5ca27ffee3", "uuid": "e982a27d-ea73-4e76-ae90-a9d1de37b056",
"files": [], "files": [],
"subMetas": {}, "subMetas": {},
"userData": {} "userData": {}

View File

@ -0,0 +1,9 @@
{
"ver": "1.2.0",
"importer": "directory",
"imported": true,
"uuid": "372dfc13-f415-4871-98be-49856636b095",
"files": [],
"subMetas": {},
"userData": {}
}

View File

@ -0,0 +1 @@
{"10001":{"id":10001,"roleName":"小石头","spine":"spine/召唤与合成819个Spine/guaiA1a/spine/guaiA1a"},"10002":{"id":10002,"roleName":"坚强小石","spine":"spine/召唤与合成819个Spine/guaiA1a_1/spine/guaiA1a"}}

View File

@ -0,0 +1,11 @@
{
"ver": "2.0.1",
"importer": "json",
"imported": true,
"uuid": "90a5e164-9bf8-4bcb-b155-444e7ff5e0bc",
"files": [
".json"
],
"subMetas": {},
"userData": {}
}

View File

@ -0,0 +1,9 @@
{
"ver": "1.2.0",
"importer": "directory",
"imported": true,
"uuid": "7dcc424e-cdd8-4b28-ae0a-1a7994590b3a",
"files": [],
"subMetas": {},
"userData": {}
}

View File

@ -0,0 +1,35 @@
import { JsonUtil } from "../../../../extensions/ngame/assets/ngame/util/JsonUtil";
export class TableGRole {
static TableName: string = "GRole";
static getAllConfig(): { [id: string]: TableGRole } {
return JsonUtil.get(TableGRole.TableName);
}
static getConfig(id: number | string) {
return TableGRole.getAllConfig()[id] as TableGRole;
}
private data: any;
init(id: number) {
var table = JsonUtil.get(TableGRole.TableName);
this.data = table[id];
this._id = id;
}
/** id */ private _id: number = 0;
/** id */
get id(): number {
return this.data.id;
}
/** 角色名称 */
get roleName(): string {
return this.data.roleName;
}
/** Spine地址 */
get spine(): string {
return this.data.spine;
}
}

View File

@ -2,7 +2,7 @@
"ver": "4.0.23", "ver": "4.0.23",
"importer": "typescript", "importer": "typescript",
"imported": true, "imported": true,
"uuid": "9215634b-6c3f-47a2-a303-04408eb3e053", "uuid": "9038eb60-394b-4c67-a5cc-ebd05040f85c",
"files": [], "files": [],
"subMetas": {}, "subMetas": {},
"userData": {} "userData": {}

View File

@ -0,0 +1,99 @@
[
{
"__type__": "cc.Prefab",
"_name": "GLDLEMode",
"_objFlags": 0,
"__editorExtras__": {},
"_native": "",
"data": {
"__id__": 1
},
"optimizationPolicy": 0,
"persistent": false
},
{
"__type__": "cc.Node",
"_name": "GLDLEMode",
"_objFlags": 0,
"__editorExtras__": {},
"_parent": null,
"_children": [],
"_active": true,
"_components": [
{
"__id__": 2
}
],
"_prefab": {
"__id__": 4
},
"_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": 1,
"_euler": {
"__type__": "cc.Vec3",
"x": 0,
"y": 0,
"z": 0
},
"_id": ""
},
{
"__type__": "cc.UITransform",
"_name": "",
"_objFlags": 0,
"__editorExtras__": {},
"node": {
"__id__": 1
},
"_enabled": true,
"__prefab": {
"__id__": 3
},
"_contentSize": {
"__type__": "cc.Size",
"width": 100,
"height": 100
},
"_anchorPoint": {
"__type__": "cc.Vec2",
"x": 0.5,
"y": 0.5
},
"_id": ""
},
{
"__type__": "cc.CompPrefabInfo",
"fileId": "36KI0wow1LqrcICgBTdo4H"
},
{
"__type__": "cc.PrefabInfo",
"root": {
"__id__": 1
},
"asset": {
"__id__": 0
},
"fileId": "073cpMY+ZFPqtOHf+oOHD6",
"instance": null,
"targetOverrides": null
}
]

View File

@ -0,0 +1,13 @@
{
"ver": "1.1.49",
"importer": "prefab",
"imported": true,
"uuid": "3520eceb-6d73-4cdc-b333-c80f737fee27",
"files": [
".json"
],
"subMetas": {},
"userData": {
"syncNodeName": "GLDLEMode"
}
}

View File

@ -384,12 +384,12 @@
}, },
"_contentSize": { "_contentSize": {
"__type__": "cc.Size", "__type__": "cc.Size",
"width": 100.08000183105469, "width": 100,
"height": 113.76000213623047 "height": 100
}, },
"_anchorPoint": { "_anchorPoint": {
"__type__": "cc.Vec2", "__type__": "cc.Vec2",
"x": 0.5040967210222901, "x": 0.5,
"y": 0.07770745417182541 "y": 0.07770745417182541
}, },
"_id": "" "_id": ""
@ -420,12 +420,9 @@
"b": 255, "b": 255,
"a": 255 "a": 255
}, },
"_skeletonData": { "_skeletonData": null,
"__uuid__": "42029fae-0ee0-48c1-b7c5-850c03664ae4", "defaultSkin": "",
"__expectedType__": "sp.SkeletonData" "defaultAnimation": "",
},
"defaultSkin": "default",
"defaultAnimation": "walk",
"_premultipliedAlpha": true, "_premultipliedAlpha": true,
"_timeScale": 1, "_timeScale": 1,
"_preCacheMode": 0, "_preCacheMode": 0,

View File

@ -0,0 +1,11 @@
{
"ver": "1.2.0",
"importer": "directory",
"imported": true,
"uuid": "9db2a905-9153-4912-9a0d-92f388b9c476",
"files": [],
"subMetas": {},
"userData": {
"isBundle": true
}
}

View File

@ -0,0 +1,9 @@
{
"ver": "1.2.0",
"importer": "directory",
"imported": true,
"uuid": "040592a8-808c-4d16-a897-5508661ec48b",
"files": [],
"subMetas": {},
"userData": {}
}

View File

@ -0,0 +1,12 @@
{
"ver": "1.0.1",
"importer": "*",
"imported": true,
"uuid": "010aa6cc-beed-4a06-8a6f-92dc1dda72c9",
"files": [
".json",
".spine"
],
"subMetas": {},
"userData": {}
}

View File

@ -0,0 +1,27 @@
guaiA1aTexture_1.png
size: 125,104
format: RGBA8888
filter: Linear,Linear
repeat: none
guaiA1a_1/guaiA1a_head
rotate: false
xy: 2, 2
size: 94, 102
orig: 94, 102
offset: 0, 0
index: -1
guaiA1a_1/guaiA1a_legL
rotate: false
xy: 98, 29
size: 27, 36
orig: 27, 36
offset: 0, 0
index: -1
guaiA1a_1/guaiA1a_legR
rotate: false
xy: 98, 67
size: 27, 37
orig: 27, 37
offset: 0, 0
index: -1

View File

@ -0,0 +1,12 @@
{
"ver": "1.0.1",
"importer": "*",
"imported": true,
"uuid": "3a4ad94b-6e0f-4a01-825b-1ef057215823",
"files": [
".atlas",
".json"
],
"subMetas": {},
"userData": {}
}

Binary file not shown.

After

Width:  |  Height:  |  Size: 20 KiB

View File

@ -0,0 +1,134 @@
{
"ver": "1.0.26",
"importer": "image",
"imported": true,
"uuid": "2058f147-aecf-4084-95ea-cdb5da0fedb1",
"files": [
".json",
".png"
],
"subMetas": {
"6c48a": {
"importer": "texture",
"uuid": "2058f147-aecf-4084-95ea-cdb5da0fedb1@6c48a",
"displayName": "guaiA1aTexture",
"id": "6c48a",
"name": "texture",
"userData": {
"wrapModeS": "clamp-to-edge",
"wrapModeT": "clamp-to-edge",
"imageUuidOrDatabaseUri": "2058f147-aecf-4084-95ea-cdb5da0fedb1",
"isUuid": true,
"visible": false,
"minfilter": "linear",
"magfilter": "linear",
"mipfilter": "none",
"anisotropy": 0
},
"ver": "1.0.22",
"imported": true,
"files": [
".json"
],
"subMetas": {}
},
"f9941": {
"importer": "sprite-frame",
"uuid": "2058f147-aecf-4084-95ea-cdb5da0fedb1@f9941",
"displayName": "guaiA1aTexture",
"id": "f9941",
"name": "spriteFrame",
"userData": {
"trimType": "auto",
"trimThreshold": 1,
"rotated": false,
"offsetX": -2,
"offsetY": 11,
"trimX": 2,
"trimY": 2,
"width": 120,
"height": 102,
"rawWidth": 128,
"rawHeight": 128,
"borderTop": 0,
"borderBottom": 0,
"borderLeft": 0,
"borderRight": 0,
"packable": true,
"pixelsToUnit": 100,
"pivotX": 0.5,
"pivotY": 0.5,
"meshType": 0,
"vertices": {
"rawPosition": [
-60,
-51,
0,
60,
-51,
0,
-60,
51,
0,
60,
51,
0
],
"indexes": [
0,
1,
2,
2,
1,
3
],
"uv": [
2,
126,
122,
126,
2,
24,
122,
24
],
"nuv": [
0.015625,
0.1875,
0.953125,
0.1875,
0.015625,
0.984375,
0.953125,
0.984375
],
"minPos": [
-60,
-51,
0
],
"maxPos": [
60,
51,
0
]
},
"isUuid": true,
"imageUuidOrDatabaseUri": "2058f147-aecf-4084-95ea-cdb5da0fedb1@6c48a",
"atlasUuid": ""
},
"ver": "1.0.12",
"imported": true,
"files": [
".json"
],
"subMetas": {}
}
},
"userData": {
"type": "sprite-frame",
"hasAlpha": true,
"fixAlphaTransparencyArtifacts": false,
"redirect": "2058f147-aecf-4084-95ea-cdb5da0fedb1@f9941"
}
}

View File

@ -0,0 +1,9 @@
{
"ver": "1.2.0",
"importer": "directory",
"imported": true,
"uuid": "a5eee23c-23dd-4938-ab52-1fc391ce178a",
"files": [],
"subMetas": {},
"userData": {}
}

View File

@ -0,0 +1,9 @@
{
"ver": "1.2.0",
"importer": "directory",
"imported": true,
"uuid": "b72fb109-4a06-4b0d-965c-992658c17bd1",
"files": [],
"subMetas": {},
"userData": {}
}

Binary file not shown.

After

Width:  |  Height:  |  Size: 39 KiB

View File

@ -0,0 +1,134 @@
{
"ver": "1.0.26",
"importer": "image",
"imported": true,
"uuid": "e08aaf39-bbce-4699-b45c-6f72957869ca",
"files": [
".json",
".png"
],
"subMetas": {
"6c48a": {
"importer": "texture",
"uuid": "e08aaf39-bbce-4699-b45c-6f72957869ca@6c48a",
"displayName": "guaiA1a_head",
"id": "6c48a",
"name": "texture",
"userData": {
"wrapModeS": "clamp-to-edge",
"wrapModeT": "clamp-to-edge",
"imageUuidOrDatabaseUri": "e08aaf39-bbce-4699-b45c-6f72957869ca",
"isUuid": true,
"visible": false,
"minfilter": "linear",
"magfilter": "linear",
"mipfilter": "none",
"anisotropy": 0
},
"ver": "1.0.22",
"imported": true,
"files": [
".json"
],
"subMetas": {}
},
"f9941": {
"importer": "sprite-frame",
"uuid": "e08aaf39-bbce-4699-b45c-6f72957869ca@f9941",
"displayName": "guaiA1a_head",
"id": "f9941",
"name": "spriteFrame",
"userData": {
"trimType": "auto",
"trimThreshold": 1,
"rotated": false,
"offsetX": -1,
"offsetY": 0,
"trimX": 0,
"trimY": 0,
"width": 92,
"height": 102,
"rawWidth": 94,
"rawHeight": 102,
"borderTop": 0,
"borderBottom": 0,
"borderLeft": 0,
"borderRight": 0,
"packable": true,
"pixelsToUnit": 100,
"pivotX": 0.5,
"pivotY": 0.5,
"meshType": 0,
"vertices": {
"rawPosition": [
-46,
-51,
0,
46,
-51,
0,
-46,
51,
0,
46,
51,
0
],
"indexes": [
0,
1,
2,
2,
1,
3
],
"uv": [
0,
102,
92,
102,
0,
0,
92,
0
],
"nuv": [
0,
0,
0.9787234042553191,
0,
0,
1,
0.9787234042553191,
1
],
"minPos": [
-46,
-51,
0
],
"maxPos": [
46,
51,
0
]
},
"isUuid": true,
"imageUuidOrDatabaseUri": "e08aaf39-bbce-4699-b45c-6f72957869ca@6c48a",
"atlasUuid": ""
},
"ver": "1.0.12",
"imported": true,
"files": [
".json"
],
"subMetas": {}
}
},
"userData": {
"type": "sprite-frame",
"hasAlpha": true,
"fixAlphaTransparencyArtifacts": false,
"redirect": "e08aaf39-bbce-4699-b45c-6f72957869ca@f9941"
}
}

Binary file not shown.

After

Width:  |  Height:  |  Size: 24 KiB

View File

@ -0,0 +1,134 @@
{
"ver": "1.0.26",
"importer": "image",
"imported": true,
"uuid": "917d53cb-10f1-4065-b7c3-57a9500b96e1",
"files": [
".json",
".png"
],
"subMetas": {
"6c48a": {
"importer": "texture",
"uuid": "917d53cb-10f1-4065-b7c3-57a9500b96e1@6c48a",
"displayName": "guaiA1a_legL",
"id": "6c48a",
"name": "texture",
"userData": {
"wrapModeS": "clamp-to-edge",
"wrapModeT": "clamp-to-edge",
"imageUuidOrDatabaseUri": "917d53cb-10f1-4065-b7c3-57a9500b96e1",
"isUuid": true,
"visible": false,
"minfilter": "linear",
"magfilter": "linear",
"mipfilter": "none",
"anisotropy": 0
},
"ver": "1.0.22",
"imported": true,
"files": [
".json"
],
"subMetas": {}
},
"f9941": {
"importer": "sprite-frame",
"uuid": "917d53cb-10f1-4065-b7c3-57a9500b96e1@f9941",
"displayName": "guaiA1a_legL",
"id": "f9941",
"name": "spriteFrame",
"userData": {
"trimType": "auto",
"trimThreshold": 1,
"rotated": false,
"offsetX": -0.5,
"offsetY": 0.5,
"trimX": 2,
"trimY": 0,
"width": 22,
"height": 35,
"rawWidth": 27,
"rawHeight": 36,
"borderTop": 0,
"borderBottom": 0,
"borderLeft": 0,
"borderRight": 0,
"packable": true,
"pixelsToUnit": 100,
"pivotX": 0.5,
"pivotY": 0.5,
"meshType": 0,
"vertices": {
"rawPosition": [
-11,
-17.5,
0,
11,
-17.5,
0,
-11,
17.5,
0,
11,
17.5,
0
],
"indexes": [
0,
1,
2,
2,
1,
3
],
"uv": [
2,
36,
24,
36,
2,
1,
24,
1
],
"nuv": [
0.07407407407407407,
0.027777777777777776,
0.8888888888888888,
0.027777777777777776,
0.07407407407407407,
1,
0.8888888888888888,
1
],
"minPos": [
-11,
-17.5,
0
],
"maxPos": [
11,
17.5,
0
]
},
"isUuid": true,
"imageUuidOrDatabaseUri": "917d53cb-10f1-4065-b7c3-57a9500b96e1@6c48a",
"atlasUuid": ""
},
"ver": "1.0.12",
"imported": true,
"files": [
".json"
],
"subMetas": {}
}
},
"userData": {
"type": "sprite-frame",
"hasAlpha": true,
"fixAlphaTransparencyArtifacts": false,
"redirect": "917d53cb-10f1-4065-b7c3-57a9500b96e1@f9941"
}
}

Binary file not shown.

After

Width:  |  Height:  |  Size: 24 KiB

View File

@ -0,0 +1,134 @@
{
"ver": "1.0.26",
"importer": "image",
"imported": true,
"uuid": "446c59f6-d7f6-4d04-abef-7ccaf942893d",
"files": [
".json",
".png"
],
"subMetas": {
"6c48a": {
"importer": "texture",
"uuid": "446c59f6-d7f6-4d04-abef-7ccaf942893d@6c48a",
"displayName": "guaiA1a_legR",
"id": "6c48a",
"name": "texture",
"userData": {
"wrapModeS": "clamp-to-edge",
"wrapModeT": "clamp-to-edge",
"imageUuidOrDatabaseUri": "446c59f6-d7f6-4d04-abef-7ccaf942893d",
"isUuid": true,
"visible": false,
"minfilter": "linear",
"magfilter": "linear",
"mipfilter": "none",
"anisotropy": 0
},
"ver": "1.0.22",
"imported": true,
"files": [
".json"
],
"subMetas": {}
},
"f9941": {
"importer": "sprite-frame",
"uuid": "446c59f6-d7f6-4d04-abef-7ccaf942893d@f9941",
"displayName": "guaiA1a_legR",
"id": "f9941",
"name": "spriteFrame",
"userData": {
"trimType": "auto",
"trimThreshold": 1,
"rotated": false,
"offsetX": -1.5,
"offsetY": 0,
"trimX": 0,
"trimY": 0,
"width": 24,
"height": 37,
"rawWidth": 27,
"rawHeight": 37,
"borderTop": 0,
"borderBottom": 0,
"borderLeft": 0,
"borderRight": 0,
"packable": true,
"pixelsToUnit": 100,
"pivotX": 0.5,
"pivotY": 0.5,
"meshType": 0,
"vertices": {
"rawPosition": [
-12,
-18.5,
0,
12,
-18.5,
0,
-12,
18.5,
0,
12,
18.5,
0
],
"indexes": [
0,
1,
2,
2,
1,
3
],
"uv": [
0,
37,
24,
37,
0,
0,
24,
0
],
"nuv": [
0,
0,
0.8888888888888888,
0,
0,
1,
0.8888888888888888,
1
],
"minPos": [
-12,
-18.5,
0
],
"maxPos": [
12,
18.5,
0
]
},
"isUuid": true,
"imageUuidOrDatabaseUri": "446c59f6-d7f6-4d04-abef-7ccaf942893d@6c48a",
"atlasUuid": ""
},
"ver": "1.0.12",
"imported": true,
"files": [
".json"
],
"subMetas": {}
}
},
"userData": {
"type": "sprite-frame",
"hasAlpha": true,
"fixAlphaTransparencyArtifacts": false,
"redirect": "446c59f6-d7f6-4d04-abef-7ccaf942893d@f9941"
}
}

View File

@ -0,0 +1,9 @@
{
"ver": "1.2.0",
"importer": "directory",
"imported": true,
"uuid": "f8ac1359-109c-41bb-b8c7-aceee56d6ef2",
"files": [],
"subMetas": {},
"userData": {}
}

View File

@ -0,0 +1,27 @@
guaiA1a.png
size: 135,98
format: RGBA8888
filter: Linear,Linear
repeat: none
guaiA1a/guaiA1a_head
rotate: true
xy: 2, 2
size: 94, 102
orig: 94, 102
offset: 0, 0
index: -1
guaiA1a/guaiA1a_legL
rotate: false
xy: 106, 60
size: 27, 36
orig: 27, 36
offset: 0, 0
index: -1
guaiA1a/guaiA1a_legR
rotate: false
xy: 106, 22
size: 27, 36
orig: 27, 37
offset: 0, 1
index: -1

View File

@ -0,0 +1,12 @@
{
"ver": "1.0.1",
"importer": "*",
"imported": true,
"uuid": "57f8d466-d380-40b5-8241-4c6529053817",
"files": [
".atlas",
".json"
],
"subMetas": {},
"userData": {}
}

File diff suppressed because one or more lines are too long

View File

@ -0,0 +1,11 @@
{
"ver": "1.2.6",
"importer": "spine-data",
"imported": true,
"uuid": "14d2a9b1-50ad-4051-a96a-b1c194651259",
"files": [
".json"
],
"subMetas": {},
"userData": {}
}

Binary file not shown.

After

Width:  |  Height:  |  Size: 20 KiB

View File

@ -0,0 +1,134 @@
{
"ver": "1.0.26",
"importer": "image",
"imported": true,
"uuid": "8cd8e7fb-f35b-417f-b147-ecc7ef089706",
"files": [
".json",
".png"
],
"subMetas": {
"6c48a": {
"importer": "texture",
"uuid": "8cd8e7fb-f35b-417f-b147-ecc7ef089706@6c48a",
"displayName": "guaiA1a",
"id": "6c48a",
"name": "texture",
"userData": {
"wrapModeS": "clamp-to-edge",
"wrapModeT": "clamp-to-edge",
"imageUuidOrDatabaseUri": "8cd8e7fb-f35b-417f-b147-ecc7ef089706",
"isUuid": true,
"visible": false,
"minfilter": "linear",
"magfilter": "linear",
"mipfilter": "none",
"anisotropy": 0
},
"ver": "1.0.22",
"imported": true,
"files": [
".json"
],
"subMetas": {}
},
"f9941": {
"importer": "sprite-frame",
"uuid": "8cd8e7fb-f35b-417f-b147-ecc7ef089706@f9941",
"displayName": "guaiA1a",
"id": "f9941",
"name": "spriteFrame",
"userData": {
"trimType": "auto",
"trimThreshold": 1,
"rotated": false,
"offsetX": -1.5,
"offsetY": -1,
"trimX": 2,
"trimY": 4,
"width": 128,
"height": 92,
"rawWidth": 135,
"rawHeight": 98,
"borderTop": 0,
"borderBottom": 0,
"borderLeft": 0,
"borderRight": 0,
"packable": true,
"pixelsToUnit": 100,
"pivotX": 0.5,
"pivotY": 0.5,
"meshType": 0,
"vertices": {
"rawPosition": [
-64,
-46,
0,
64,
-46,
0,
-64,
46,
0,
64,
46,
0
],
"indexes": [
0,
1,
2,
2,
1,
3
],
"uv": [
2,
94,
130,
94,
2,
2,
130,
2
],
"nuv": [
0.014814814814814815,
0.02040816326530612,
0.9629629629629629,
0.02040816326530612,
0.014814814814814815,
0.9591836734693877,
0.9629629629629629,
0.9591836734693877
],
"minPos": [
-64,
-46,
0
],
"maxPos": [
64,
46,
0
]
},
"isUuid": true,
"imageUuidOrDatabaseUri": "8cd8e7fb-f35b-417f-b147-ecc7ef089706@6c48a",
"atlasUuid": ""
},
"ver": "1.0.12",
"imported": true,
"files": [
".json"
],
"subMetas": {}
}
},
"userData": {
"type": "sprite-frame",
"hasAlpha": true,
"fixAlphaTransparencyArtifacts": false,
"redirect": "8cd8e7fb-f35b-417f-b147-ecc7ef089706@f9941"
}
}

View File

@ -1,4 +1,6 @@
import { resources } from "cc";
import { BehaviorManager } from "../../extensions/Behavior Creator/runtime/main"; import { BehaviorManager } from "../../extensions/Behavior Creator/runtime/main";
import SystemBase from "../../extensions/ngame/assets/ngame/system/SystemBase";
import JNSocket from "../../extensions/ngame/assets/ngame/network/JNSocket"; import JNSocket from "../../extensions/ngame/assets/ngame/network/JNSocket";
import { JNSyncAction } from "../../extensions/ngame/assets/ngame/sync/JNSyncAction"; import { JNSyncAction } from "../../extensions/ngame/assets/ngame/sync/JNSyncAction";
import { JNSyncMessage } from "../../extensions/ngame/assets/ngame/sync/JNSyncMessage"; import { JNSyncMessage } from "../../extensions/ngame/assets/ngame/sync/JNSyncMessage";
@ -8,10 +10,16 @@ import JNSyncFrameProtoComponent from "../../extensions/ngame/assets/ngame/sync/
import JNLayer, { JNLayerAnim, JNLayerInfo } from "../../extensions/ngame/assets/ngame/ui/JNLayer"; import JNLayer, { JNLayerAnim, JNLayerInfo } from "../../extensions/ngame/assets/ngame/ui/JNLayer";
import JNLayerBase from "../../extensions/ngame/assets/ngame/ui/base/JNLayerBase"; import JNLayerBase from "../../extensions/ngame/assets/ngame/ui/base/JNLayerBase";
import { EventDispatcher } from "../../extensions/ngame/assets/ngame/util/EventDispatcher"; import { EventDispatcher } from "../../extensions/ngame/assets/ngame/util/EventDispatcher";
import { JsonLoad, JsonUtil } from "../../extensions/ngame/assets/ngame/util/JsonUtil";
import NGameMessage from "../../extensions/ngame/assets/ngame/util/NGameMessage"; import NGameMessage from "../../extensions/ngame/assets/ngame/util/NGameMessage";
import axios from "../../extensions/ngame/assets/plugins/axios.js"; import axios from "../../extensions/ngame/assets/plugins/axios.js";
import GBattleModeManager from "./battle/GBattleModeManager"; import GBattleModeManager from "./battle/GBattleModeManager";
import { GLayer, UIConfig } from "./ui/UIConfig"; import { GLayer, UIConfig } from "./ui/UIConfig";
import JLoaderSystem from "../../extensions/ngame/assets/ngame/system/JLoaderSystem";
import { TableGRole } from "../resources/config/ts/TableGRole";
import loader from "../../extensions/ngame/assets/ngame/util/loader";
import { Prefab } from "cc";
import { sp } from "cc";
//重写UI //重写UI
@ -89,6 +97,47 @@ export abstract class JNGSyncProtoBase<T> extends JNSyncFrameProtoComponent<T>{
} }
//读写config
export class JNGConfig extends SystemBase{
//配置JSON加载
jsons:JsonLoad[] = [
{name:TableGRole.TableName},
].map((table) => {
return {
name:table.name,
bundle:"resources",
path:"config/game/"
}
});
async onInit(): Promise<any> {
for (const key in this.jsons) {
const load = this.jsons[key];
await JsonUtil.load(load);
}
}
}
//角色初始器
export class JLoaderRole extends JLoaderSystem{
skData:{[id:number]:sp.SkeletonData} = {};
async onInit(): Promise<any> {
await super.onInit();
//将配置表的角色都读取出来
for (const info of Object.values(TableGRole.getAllConfig())) {
this.skData[info.id] = await (new Promise(r => {
this.bundle.load(info.spine,sp.SkeletonData,(err,data) => {
r(data);
})
}))
}
}
}
export const app = { export const app = {
layer : new JNGLayer(), //UI layer : new JNGLayer(), //UI
socket : new JNGSocket(), //Socket socket : new JNGSocket(), //Socket
@ -99,4 +148,6 @@ export const app = {
baseURL: "http://localhost:8080", baseURL: "http://localhost:8080",
}), //请求 }), //请求
battle : GBattleModeManager.getIns(), //战斗 battle : GBattleModeManager.getIns(), //战斗
config : new JNGConfig(),
role : new JLoaderRole("role"), //role包
} }

View File

@ -2,6 +2,7 @@ import { _decorator, Component, director, instantiate, Node, Prefab } from 'cc';
import { app } from './App'; import { app } from './App';
import { JNGame } from '../../extensions/ngame/assets/ngame/JNGame'; import { JNGame } from '../../extensions/ngame/assets/ngame/JNGame';
import { JNSyncAction } from '../../extensions/ngame/assets/ngame/sync/JNSyncAction'; import { JNSyncAction } from '../../extensions/ngame/assets/ngame/sync/JNSyncAction';
import { TableGRole } from '../resources/config/ts/TableGRole';
const { ccclass, property } = _decorator; const { ccclass, property } = _decorator;
@ccclass('Main') @ccclass('Main')
@ -20,6 +21,8 @@ export class Main extends Component {
{path:"proto/GDemo"} {path:"proto/GDemo"}
]); ]);
console.log("TableGRole",TableGRole.getAllConfig())
//发生帧同步开始 //发生帧同步开始
app.socket.Send(JNSyncAction.NSyncFrameStart); app.socket.Send(JNSyncAction.NSyncFrameStart);

View File

@ -1,9 +1,10 @@
import { Vec2 } from "cc"; import { Vec2 } from "cc";
import GObject from "./base/GObject"; import GObject from "./base/GObject";
import { v3 } from "cc"; import { v3 } from "cc";
import { JNFrameInfo } from "../../../extensions/ngame/assets/ngame/sync/frame/JNSyncFrame";
export default class GBaseMode extends GObject<{}> { export default class GBaseMode<T> extends GObject<T> {
//添加对象到场景中 //添加对象到场景中
addGObject(obj: GObject<{}>,pos?:Vec2){ addGObject(obj: GObject<{}>,pos?:Vec2){
@ -14,5 +15,14 @@ export default class GBaseMode extends GObject<{}> {
} }
} }
onSyncUpdate(dt: number,frame:JNFrameInfo, input?: T) {
//重置 场景中的层级
[...this.node.children].sort((node1,node2) => node2.worldPosition.y - node1.worldPosition.y).forEach((node,index) => {
node.setSiblingIndex(index);
})
}
} }

View File

@ -3,11 +3,14 @@ import { JNGSyncProtoBase } from "../../App";
import GBaseMode from "../GBaseMode"; import GBaseMode from "../GBaseMode";
import { v2 } from "cc"; import { v2 } from "cc";
export enum GTowards{
RIGHT,LEFT
}
export default class GObject<T> extends JNGSyncProtoBase<T>{ export default class GObject<T> extends JNGSyncProtoBase<T>{
//当前模式 //当前模式
_mode:GBaseMode; _mode:GBaseMode<{}>;
//是否镜像 //是否镜像
_isMirror:boolean = false; _isMirror:boolean = false;
@ -23,10 +26,10 @@ export default class GObject<T> extends JNGSyncProtoBase<T>{
this._isMirror = value; this._isMirror = value;
} }
get mode():GBaseMode{ get mode():GBaseMode<{}>{
return this._mode; return this._mode;
} }
set mode(value:GBaseMode){ set mode(value:GBaseMode<{}>){
this._mode = value; this._mode = value;
} }
@ -52,5 +55,14 @@ export default class GObject<T> extends JNGSyncProtoBase<T>{
} }
} }
//设置朝向
setTowards(towards:GTowards){
if(towards == GTowards.LEFT){
this.isMirror = true;
}else{
this.isMirror = false;
}
}
} }

View File

@ -1,4 +1,4 @@
import GRoleUtil from "../../../util/GRoleUtil"; import { GRoleUtil } from "../../../entity/GRole";
import GRoleBase from "../../role/GRoleBase"; import GRoleBase from "../../role/GRoleBase";
import GRolePVPEntity from "../../role/PVP/GRolePVPEntity"; import GRolePVPEntity from "../../role/PVP/GRolePVPEntity";
import GFSMBattle from "../base/GFSMBattle/GFSMBattle"; import GFSMBattle from "../base/GFSMBattle/GFSMBattle";

View File

@ -1,7 +1,7 @@
import { Vec2 } from "cc"; import { Vec2 } from "cc";
import GRoleBase from "../../../role/GRoleBase"; import GRoleBase from "../../../role/GRoleBase";
import GFSMBase, { GFSMProcessEnum, GFSMProcessInfo, GFSMProcessMode } from "../../GFSMBase"; import GFSMBase, { GFSMProcessEnum, GFSMProcessInfo, GFSMProcessMode } from "../../GFSMBase";
import GRoleUtil from "../../../../util/GRoleUtil"; import { GRoleUtil } from "../../../../entity/GRole";
//流程枚举 //流程枚举
@ -39,7 +39,7 @@ export default abstract class GFSMBattle extends GFSMBase{
title:"寻找敌人", title:"寻找敌人",
execute: this.onSeekEnemyProcess.bind(this), execute: this.onSeekEnemyProcess.bind(this),
// to:[ProcessEnum.MoveToAttackRange], //移动到可攻击范围 // to:[ProcessEnum.MoveToAttackRange], //移动到可攻击范围
to:[ProcessEnum.MoveToAttackRange], //移动到可攻击范围 to:[ProcessEnum.MoveToAttackRange,ProcessEnum.MoveToTactical], //移动到可攻击范围
}, },
[ProcessEnum.MoveToAttackRange]:{ [ProcessEnum.MoveToAttackRange]:{
title:"移动到可攻击范围", title:"移动到可攻击范围",
@ -51,12 +51,13 @@ export default abstract class GFSMBattle extends GFSMBase{
title:"攻击敌人", title:"攻击敌人",
mode:GFSMProcessMode.WaitExecute, mode:GFSMProcessMode.WaitExecute,
execute: this.onAttackProcess.bind(this), execute: this.onAttackProcess.bind(this),
to:[ProcessEnum.MoveToTactical],//移动回阵型 to:[ProcessEnum.SeekEnemy],//移动回阵型
}, },
[ProcessEnum.MoveToTactical]:{ [ProcessEnum.MoveToTactical]:{
title:"移动回阵型", title:"移动回阵型",
mode:GFSMProcessMode.WaitExecute, mode:GFSMProcessMode.WaitExecute,
execute: this.onMoveToTacticalProcess.bind(this), execute: this.onMoveToTacticalProcess.bind(this),
to:[ProcessEnum.SeekEnemy],//移动回阵型
} }
} }
@ -82,10 +83,14 @@ export default abstract class GFSMBattle extends GFSMBase{
if((this._enemy = GRoleUtil.get(this.onSeekEnemy())) && this.enemy){ if((this._enemy = GRoleUtil.get(this.onSeekEnemy())) && this.enemy){
//如果有敌人 直接 攻击 //如果有敌人 直接 攻击
return ProcessEnum.MoveToAttackRange; return ProcessEnum.MoveToAttackRange;
} }else{
//如果没有敌人则回去
//负责继续寻敌 if(!(this.player.tacticalPos.equals(this.player.v2World))){
return ProcessEnum.MoveToTactical
}else{
return GFSMProcessEnum.Reset; return GFSMProcessEnum.Reset;
}
}
} }
@ -120,8 +125,9 @@ export default abstract class GFSMBattle extends GFSMBase{
this.player.fsmAnim.isAttack = false; this.player.fsmAnim.isAttack = false;
if(this.player.onMoveTarget(this.player.tacticalPos,dt)){ if(this.player.onMoveTarget(this.player.tacticalPos,dt)){
//回到阵容 重置 this.player.onRecoverTacticalTowards();
return GFSMProcessEnum.Reset; //回到阵容 搜索敌人
return ProcessEnum.SeekEnemy;
} }
return GFSMProcessEnum.Wait; return GFSMProcessEnum.Wait;
@ -137,7 +143,7 @@ export default abstract class GFSMBattle extends GFSMBase{
if(this.enemy){ if(this.enemy){
return GFSMProcessEnum.Wait; return GFSMProcessEnum.Wait;
}else{ }else{
return ProcessEnum.MoveToTactical; return ProcessEnum.SeekEnemy;
} }
} }

View File

@ -1,5 +1,5 @@
import { _decorator, sp } from "cc"; import { _decorator, sp } from "cc";
import GObject from "../GObject"; import GObject, { GTowards } from "../GObject";
import { JNFrameInfo } from "../../../../../extensions/ngame/assets/ngame/sync/frame/JNSyncFrame"; import { JNFrameInfo } from "../../../../../extensions/ngame/assets/ngame/sync/frame/JNSyncFrame";
import GFSMBattle from "../fsm/base/GFSMBattle/GFSMBattle"; import GFSMBattle from "../fsm/base/GFSMBattle/GFSMBattle";
import { GFSMBattleAmin, GFSMBattleAminEnum } from "../fsm/base/GFSMBattle/GFSMBattleAmin"; import { GFSMBattleAmin, GFSMBattleAminEnum } from "../fsm/base/GFSMBattle/GFSMBattleAmin";
@ -8,6 +8,8 @@ import { v3 } from "cc";
import { GTactical } from "../../entity/GTactical"; import { GTactical } from "../../entity/GTactical";
import { JEasing, JTween } from "../../../../../extensions/ngame/assets/ngame/sync/frame/game/tween/JNFrameTween"; import { JEasing, JTween } from "../../../../../extensions/ngame/assets/ngame/sync/frame/game/tween/JNFrameTween";
import { v2 } from "cc"; import { v2 } from "cc";
import GRole from "../../entity/GRole";
import { app } from "../../../App";
const { ccclass, property } = _decorator; const { ccclass, property } = _decorator;
export enum GRoleAnimEvent{ export enum GRoleAnimEvent{
@ -20,6 +22,9 @@ export default abstract class GRoleBase<T> extends GObject<T>{
@property(sp.Skeleton) @property(sp.Skeleton)
spine:sp.Skeleton; spine:sp.Skeleton;
//角色
role:GRole
//状态机 //状态机
fsm:GFSMBattle; fsm:GFSMBattle;
@ -35,7 +40,12 @@ export default abstract class GRoleBase<T> extends GObject<T>{
//在阵容中的下标 //在阵容中的下标
tacticalIndex:number; tacticalIndex:number;
//阵容 //阵容
tactical:GTactical; _tactical:GTactical;
get tactical(){return this._tactical};
set tactical(value:GTactical){
this.setTowards(value.towards);
this._tactical = value;
}
//阵容位置 //阵容位置
_tacticalPos:Vec2; _tacticalPos:Vec2;
get tacticalPos(){ return this._tacticalPos} get tacticalPos(){ return this._tacticalPos}
@ -68,6 +78,8 @@ export default abstract class GRoleBase<T> extends GObject<T>{
return; return;
} }
this.bind(this.role);
//创建角色状态机 //创建角色状态机
this.fsm = this.fsmCreate(); this.fsm = this.fsmCreate();
//创建角色动画状态机 //创建角色动画状态机
@ -80,15 +92,24 @@ export default abstract class GRoleBase<T> extends GObject<T>{
} }
//设置角色
bind(role:GRole){
if(this.spine)
this.spine.skeletonData = app.role.skData[role.id];
this.role = role;
}
//创建一个状态机 //创建一个状态机
protected abstract fsmCreate():GFSMBattle; protected abstract fsmCreate():GFSMBattle;
//创建一个动画状态机 //创建一个动画状态机
protected abstract fsmAnimCreate():GFSMBattleAmin; protected abstract fsmAnimCreate():GFSMBattleAmin;
onSyncUpdate(dt: number,frame:JNFrameInfo, input?: T){ onSyncUpdate(dt: number,frame:JNFrameInfo, input?: T){
//更新状态机 //更新状态机
this.fsm && this.fsm.onUpdate(dt / 1000); this.fsm && this.fsm.onUpdate(dt / 1000);
this.fsmAnim && this.fsmAnim.onUpdate(dt / 1000); this.fsmAnim && this.fsmAnim.onUpdate(dt / 1000);
} }
//向目标点移动 //向目标点移动
@ -98,6 +119,16 @@ export default abstract class GRoleBase<T> extends GObject<T>{
let mins = this.v2World.subtract(target); let mins = this.v2World.subtract(target);
let normal = this.v2World.subtract(target).normalize(); let normal = this.v2World.subtract(target).normalize();
//设置朝向
if(normal.x != 0){
if(normal.x < 0){
this.setTowards(GTowards.RIGHT)
}else{
this.setTowards(GTowards.LEFT)
}
}
if(Vec2.len(normal) >= Vec2.len(mins)){ if(Vec2.len(normal) >= Vec2.len(mins)){
this.node.setWorldPosition(Object.assign(v3(),target.clone())); this.node.setWorldPosition(Object.assign(v3(),target.clone()));
return true; return true;
@ -112,7 +143,7 @@ export default abstract class GRoleBase<T> extends GObject<T>{
//攻击 //攻击
onAttack(){ onAttack(){
//敌人扣血 //敌人扣血
this.fsm.enemy.onHit(); this.fsm.enemy?.onHit();
} }
//受击 //受击
@ -145,6 +176,11 @@ export default abstract class GRoleBase<T> extends GObject<T>{
} }
//恢复阵容朝向
onRecoverTacticalTowards(){
this.setTowards(this.tactical.towards);
}
} }

View File

@ -2,13 +2,14 @@ import { _decorator } from "cc";
import GRoleBase from "../GRoleBase"; import GRoleBase from "../GRoleBase";
import GFSMBase from "../../fsm/GFSMBase"; import GFSMBase from "../../fsm/GFSMBase";
import GFSMPVP from "../../fsm/PVP/GFSMPVP"; import GFSMPVP from "../../fsm/PVP/GFSMPVP";
import GPVPMode, { GPVPModePlayerEnum } from "../../../PVP/GPVPMode"; import GPVPMode, { GPVPModePlayerEnum } from "../../../modes/GPVPMode";
import { GTactical } from "../../../entity/GTactical"; import { GTactical } from "../../../entity/GTactical";
import { GFSMBattleAmin } from "../../fsm/base/GFSMBattle/GFSMBattleAmin"; import { GFSMBattleAmin } from "../../fsm/base/GFSMBattle/GFSMBattleAmin";
import { JNFrameInfo } from "../../../../../../extensions/ngame/assets/ngame/sync/frame/JNSyncFrame"; import { JNFrameInfo } from "../../../../../../extensions/ngame/assets/ngame/sync/frame/JNSyncFrame";
import { Vec2 } from "cc"; import { Vec2 } from "cc";
import { v2 } from "cc"; import { v2 } from "cc";
import { ProgressBar } from "cc"; import { ProgressBar } from "cc";
import { GTowards } from "../../GObject";
const { ccclass, property } = _decorator; const { ccclass, property } = _decorator;
export interface GDemoMessage{ export interface GDemoMessage{
@ -26,12 +27,6 @@ export default class GRolePVPEntity extends GRoleBase<GDemoMessage>{
return this._ones; return this._ones;
} }
set ones(value:GPVPModePlayerEnum){ set ones(value:GPVPModePlayerEnum){
//如果是敌方则设置镜像
if(value == GPVPModePlayerEnum.ENEMY){
this.isMirror = true;
}else{
this.isMirror = false;
}
this._ones = value; this._ones = value;
} }
@ -66,6 +61,7 @@ export default class GRolePVPEntity extends GRoleBase<GDemoMessage>{
this._mode = value; this._mode = value;
} }
protected fsmCreate(): GFSMPVP { protected fsmCreate(): GFSMPVP {
return new GFSMPVP(this); return new GFSMPVP(this);
} }

View File

@ -0,0 +1,37 @@
import { TableGRole } from "../../../resources/config/ts/TableGRole";
import GRoleBase from "../base/role/GRoleBase";
//角色实体类
export default interface GRole {
id:number; //宠物Id
}
//角色工具类
export class GRoleUtil{
//获取存活的玩家 如果不存活则返回 null
static get<T>(player:GRoleBase<T>):() => GRoleBase<T>{
if(!player) return null;
return ():GRoleBase<T> => {
if(player)
return player.get();
return null;
}
}
//通过Id 获取 GRole
static getGRole(id:number):GRole{
let info:TableGRole;
if(!(info = TableGRole.getConfig(id))) return null;
return {
id:info.id
}
}
static getGRoles(ids:number[]):GRole[]{
return ids.map(id => GRoleUtil.getGRole(id));
}
}

View File

@ -0,0 +1,9 @@
{
"ver": "4.0.23",
"importer": "typescript",
"imported": true,
"uuid": "ff6b5bb7-5bda-42bb-bf4c-0d91a7627524",
"files": [],
"subMetas": {},
"userData": {}
}

View File

@ -1,11 +1,15 @@
import { v2 } from "cc"; import { v2 } from "cc";
import { Vec2 } from "cc"; import { Vec2 } from "cc";
import { GTowards } from "../base/GObject";
//阵法类 //阵法类
export class GTactical{ export class GTactical{
tactical:number[][]; tactical:number[][];
//阵容朝向
towards:GTowards;
//阵法位置 //阵法位置
static pos:Vec2[][] = [ static pos:Vec2[][] = [
[v2(-100,150),v2(0,150),v2(100,150)], [v2(-100,150),v2(0,150),v2(100,150)],
@ -13,19 +17,21 @@ export class GTactical{
[v2(-100,-150),v2(0,-150),v2(100,-150)], [v2(-100,-150),v2(0,-150),v2(100,-150)],
]; ];
constructor(tactical:number[][]){ constructor(tactical:number[][],towards:GTowards = GTowards.RIGHT){
this.tactical = tactical; this.tactical = tactical;
this.towards = towards;
} }
//获取阵法 //获取阵法
static getTactical(isReversed:boolean = false): GTactical{ static getTactical(isReversed:boolean = false): GTactical{
let tactical = [ let tactical = [
[0,0,3], [0,4,3],
[0,0,1], [0,0,1],
[0,0,2], [0,5,2],
]; ];
if(isReversed){ if(isReversed){
tactical = this.getTacticalFlipX(tactical); tactical = this.getTacticalFlipX(tactical);
return new GTactical(tactical,GTowards.LEFT);
} }
return new GTactical(tactical); return new GTactical(tactical);
} }
@ -38,6 +44,7 @@ export class GTactical{
]; ];
if(isReversed){ if(isReversed){
tactical = this.getTacticalFlipX(tactical); tactical = this.getTacticalFlipX(tactical);
return new GTactical(tactical,GTowards.LEFT);
} }
return new GTactical(tactical); return new GTactical(tactical);
} }
@ -51,6 +58,7 @@ export class GTactical{
]; ];
if(isReversed){ if(isReversed){
tactical = this.getTacticalFlipX(tactical); tactical = this.getTacticalFlipX(tactical);
return new GTactical(tactical,GTowards.LEFT);
} }
return new GTactical(tactical); return new GTactical(tactical);
} }

View File

@ -0,0 +1,9 @@
{
"ver": "1.2.0",
"importer": "directory",
"imported": true,
"uuid": "e8874608-a5f4-47c8-8b57-6ff186b7ec2b",
"files": [],
"subMetas": {},
"userData": {}
}

View File

@ -0,0 +1,10 @@
import GBaseMode from "../GBaseMode";
/**
*
*/
export default class GLDLEMode extends GBaseMode<{}>{
}

View File

@ -0,0 +1,9 @@
{
"ver": "4.0.23",
"importer": "typescript",
"imported": true,
"uuid": "c579d727-c0c2-422f-8571-3375047fd1b8",
"files": [],
"subMetas": {},
"userData": {}
}

View File

@ -5,6 +5,7 @@ import { Prefab } from "cc";
import { instantiate } from "cc"; import { instantiate } from "cc";
import { Vec2 } from "cc"; import { Vec2 } from "cc";
import GRolePVPEntity from "../base/role/PVP/GRolePVPEntity"; import GRolePVPEntity from "../base/role/PVP/GRolePVPEntity";
import GRole, { GRoleUtil } from "../entity/GRole";
const { ccclass, property } = _decorator; const { ccclass, property } = _decorator;
@ -20,22 +21,22 @@ export interface GPVPModePlayerInfo{
//阵法 //阵法
tactical: GTactical; tactical: GTactical;
//宠物列表 //宠物列表
roles: any[]; roles: GRole[];
} }
/** /**
* PVP * PVP
*/ */
@ccclass('GPVPMode') @ccclass('GPVPMode')
export default class GPVPMode extends GBaseMode{ export default class GPVPMode extends GBaseMode<{}>{
@property(Prefab) @property(Prefab)
rolePrefab: Prefab = null; rolePrefab: Prefab = null;
//玩家信息 //玩家信息
playerInfo: GPVPModePlayerInfo = { tactical: GTactical.getTactical1(),roles: [{},{},{}] }; playerInfo: GPVPModePlayerInfo;
//敌方信息 //敌方信息
enemyInfo: GPVPModePlayerInfo = { tactical: GTactical.getTactical2(true),roles: [{},{},{}] }; enemyInfo: GPVPModePlayerInfo;
//玩家宠物 //玩家宠物
playerRoles: GRolePVPEntity[] = []; playerRoles: GRolePVPEntity[] = [];
@ -47,25 +48,33 @@ export default class GPVPMode extends GBaseMode{
//敌方位置 //敌方位置
enemyPos: Vec2 = new Vec2(400,0); enemyPos: Vec2 = new Vec2(400,0);
onLoad(){
super.onLoad();
}
onSyncInitSuccess(): void { onSyncInitSuccess(): void {
//初始化战斗 //初始化战斗
console.log("GPVPMode 模式初始化"); console.log("GPVPMode 模式初始化");
this.playerInfo = { tactical: GTactical.getTactical(),roles: GRoleUtil.getGRoles([10001,10001,10001,10001,10001]) };
this.enemyInfo = { tactical: GTactical.getTactical(true),roles: GRoleUtil.getGRoles([10002,10002,10002,10001,10001]) };
//生成玩家 //生成玩家
this.playerInfo.roles.forEach((info,index) => this.onGenRole(GPVPModePlayerEnum.PLAYER,index+1)) this.playerInfo.roles.forEach((info,index) => this.onGenRole(GPVPModePlayerEnum.PLAYER,index+1,info))
this.enemyInfo.roles.forEach((info,index) => this.onGenRole(GPVPModePlayerEnum.ENEMY,index+1)) this.enemyInfo.roles.forEach((info,index) => this.onGenRole(GPVPModePlayerEnum.ENEMY,index+1,info))
} }
//生成角色 //生成角色
onGenRole(type: GPVPModePlayerEnum,index:number) { onGenRole(type: GPVPModePlayerEnum,index:number,info:GRole) {
let pos:Vec2 = this.getInfo(type).tactical.getPosition(index); let pos:Vec2 = this.getInfo(type).tactical.getPosition(index);
if(!pos) return; if(!pos) return;
let role = instantiate(this.rolePrefab); let role = instantiate(this.rolePrefab);
let entity = role.getComponent(GRolePVPEntity) let entity = role.getComponent(GRolePVPEntity)
entity.bind(info);
//赋值阵容 //赋值阵容
entity.ones = type; entity.ones = type;
entity.tactical = this.getInfo(type).tactical; entity.tactical = this.getInfo(type).tactical;
@ -120,8 +129,12 @@ export default class GPVPMode extends GBaseMode{
//销毁角色数据 //销毁角色数据
killRole(role:GRolePVPEntity){ killRole(role:GRolePVPEntity){
this.playerRoles.splice(this.playerRoles.indexOf(role),1); let index = this.playerRoles.indexOf(role);
this.enemyRoles.splice(this.enemyRoles.indexOf(role),1); if(index >= 0)
this.playerRoles.splice(index,1);
index = this.enemyRoles.indexOf(role);
if(index >= 0)
this.enemyRoles.splice(index,1);
} }
} }

View File

@ -1,19 +0,0 @@
import GRoleBase from "../base/role/GRoleBase";
//角色工具类
export default class GRoleUtil{
//获取存活的玩家 如果不存活则返回 null
static get<T>(player:GRoleBase<T>):() => GRoleBase<T>{
if(!player) return null;
return ():GRoleBase<T> => {
if(player)
return player.get();
return null;
}
}
}

Binary file not shown.

View File

@ -0,0 +1 @@
1**** 角色

View File

@ -0,0 +1,5 @@
Card - 卡牌
WorldGenerate - 地图生成
WorldGenerateInfo - 地图生成信息
GRole - 角色表

@ -1 +1 @@
Subproject commit e5c9ad20894ed7066efa188f6484b0ec58fca4a1 Subproject commit 793720478680b54892b7f43b880c435f3f1c6990

View File

@ -0,0 +1,2 @@
excel/
excel

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

View File

@ -0,0 +1,57 @@
declare namespace Editor {
namespace Interface {
// ---- Package ---- start
interface PackageInfo {
debug: boolean;
enable: boolean;
info: PackageJson;
invalid: boolean;
name: string;
path: string;
version: string;
}
interface PackageJson {
name: string;
version: string;
title?: string;
author?: string;
debug?: boolean;
description?: string;
main?: string;
editor?: string;
panel?: any;
contributions?: { [key: string]: any };
}
// ---- Package ---- end
// ---- UI ---- start
interface PanelInfo {
template?: string;
style?: string;
listeners?: { [key: string]: () => {} };
methods?: { [key: string]: Function };
$?: { [key: string]: string };
ready?(): void;
update?(...args: any[]): void;
beforeClose?(): void;
close?(): void;
}
namespace UIKit {
interface UIPanelInfo extends PanelInfo {
// 向上触发事件
dispath(eventName: string, ...arg: any): void;
}
interface EditorElementBase extends HTMLElement {
value: any;
dispath: (name: string, event: any) => void;
}
}
// ---- UI ---- end
}
}

View File

@ -0,0 +1,2 @@
/// <reference path="./editor.d.ts"/>
/// <reference path="./message.d.ts"/>

View File

@ -0,0 +1,27 @@
import * as AssetDB from './packages/asset-db/@types/message';
import * as Scene from './packages/scene/@types/message';
import * as Engine from './packages/engine/@types/message';
import * as Builder from './packages/builder/@types/public/message';
import * as Programming from './packages/programming/@types/message';
// import * as Extension from './packages/extension/@types/message';
declare global {
interface EditorMessageContent {
params: any[],
result: any;
}
interface EditorMessageMap {
[x: string]: EditorMessageContent;
}
interface EditorMessageMaps {
[x: string]: EditorMessageMap;
'asset-db': AssetDB.message;
'scene': Scene.message;
'engine': Engine.message;
'builder': Builder.message;
'programming': Programming.message,
// 'extension': Extension.message;
}
}

View File

@ -0,0 +1,19 @@
import { IInternalBuildOptions, IPolyFills, ISettings } from '@editor/library-type/packages/builder/@types/protect';
export * from '@editor/library-type/packages/builder/@types/protect';
export type IOrientation = 'landscape' | 'portrait';
export interface IUserSettings extends ISettings {
orientation: IOrientation;
}
export interface ITaskOption extends IInternalBuildOptions {
packages: {
'alipay-mini-game': {
deviceOrientation: IOrientation;
remoteUrl: string;
polyfills?: IPolyFills;
}
}
}

View File

@ -0,0 +1,73 @@
import { IInternalBuildOptions, InternalBuildResult } from '@editor/library-type/packages/builder/@types/protect';
export * from '@editor/library-type/packages/builder/@types/protect';
export type IOrientation = 'landscape' | 'portrait';
export interface ITaskOption extends IInternalBuildOptions {
packages: {
'android': IOptions;
native: {
JobSystem: 'none' | 'tbb' | 'taskFlow';
}
}
}
export type IAppABI = 'armeabi-v7a' | 'arm64-v8a' | 'x86' | 'x86_64';
export interface IOptions {
packageName: string;
orientation: {
landscapeRight: boolean;
landscapeLeft: boolean;
portrait: boolean;
upsideDown: boolean;
},
apiLevel: string;
appABIs: IAppABI[];
useDebugKeystore: boolean;
keystorePath: string;
keystorePassword: string;
keystoreAlias: string;
keystoreAliasPassword: string;
appBundle: boolean;
androidInstant: boolean;
remoteUrl: string;
sdkPath: string;
ndkPath: string;
swappy: boolean;
renderBackEnd: {
vulkan: boolean;
gles3: boolean;
gles2: boolean;
}
}
export interface IBuildResult extends InternalBuildResult {
userFrameWorks: boolean; // 是否使用用户的配置数据
}
export interface ICertificateSetting {
country: string;
state: string;
locality: string;
organizationalUnit: string;
organization: string;
email: string;
certificatePath: string;
password: string; // 密钥密码
confirmPassword: string; // 确认密钥密码
alias: string; // 密钥别名
aliasPassword: string;
confirmAliasPassword: string;
validity: number; // 有效期
}

View File

@ -0,0 +1,179 @@
import { AssetInfo, QueryAssetsOption, AssetOperationOption, AssetDBOptions, IAssetMeta } from './public';
export interface message extends EditorMessageMap {
'query-ready': {
params: [],
result: boolean,
},
'create-asset': {
params: [
string,
string | Buffer | null,
] | [
string,
string | Buffer | null,
AssetOperationOption,
],
result: AssetInfo | null,
},
'import-asset': {
params: [
string,
string,
] | [
string,
string,
AssetOperationOption,
],
result: AssetInfo | null,
},
'copy-asset': {
params: [
string,
string,
] | [
string,
string,
AssetOperationOption,
],
result: AssetInfo | null,
},
'move-asset': {
params: [
string,
string,
] | [
string,
string,
AssetOperationOption,
],
result: AssetInfo | null,
},
'delete-asset': {
params: [
string,
],
result: AssetInfo | null,
},
'open-asset': {
params: [
string,
],
result: void,
},
'save-asset': {
params: [
string,
string | Buffer,
],
result: AssetInfo | null,
},
'save-asset-meta': {
params: [
string,
string,
],
result: AssetInfo | null,
},
'reimport-asset': {
params: [
string,
],
result: boolean,
},
'refresh-asset': {
params: [
string
],
result: boolean,
},
'query-asset-info': {
params: [
string, // uuid | url | path
],
result: AssetInfo | null,
},
'query-asset-meta': {
params: [
string,
],
result: IAssetMeta | null,
},
'query-path': {
params: [
string,
],
result: string | null,
},
'query-url': {
params: [
string
],
result: string | null,
},
'query-uuid': {
params: [
string
],
result: string | null,
},
'query-assets': {
params: [] | [
QueryAssetsOption,
],
result: AssetInfo[],
},
'generate-available-url': {
params: [
string,
],
result: string,
},
// private
'query-asset-mtime': {
params: [
string
],
result: string | null,
},
'refresh': {
params: [],
result: void,
},
'open-devtools': {
params: [],
result: void,
},
'query-db-info': {
params: [
string,
],
result: AssetDBOptions,
},
'create-asset-dialog': {
params: [
string,
] | [
string,
string,
],
result: string | null,
},
'init-asset': {
params: [
string,
string,
],
result: AssetInfo | null,
},
'query-all-importer': {
params: [],
result: string[],
},
'query-all-asset-types': {
params: [],
result: string[],
},
}

View File

@ -0,0 +1,115 @@
// Basic information about the resource
// 资源的基础信息
export interface AssetInfo {
// Asset name
// 资源名字
name: string;
// Asset display name
// 资源用于显示的名字
displayName: string;
// URL
source: string;
// loader 加载的层级地址
path: string;
// loader 加载地址会去掉扩展名,这个参数不去掉
url: string;
// 绝对路径
file: string;
// 资源的唯一 ID
uuid: string;
// 使用的导入器名字
importer: string;
// 类型
type: string;
// 是否是文件夹
isDirectory: boolean;
// 导入资源的 map
library: { [key: string]: string };
// 子资源 map
subAssets: { [key: string]: AssetInfo };
// 是否显示
visible: boolean;
// 是否只读
readonly: boolean;
// 虚拟资源可以实例化成实体的话,会带上这个扩展名
instantiation?: string;
// 跳转指向资源
redirect?: IRedirectInfo;
// 继承类型
extends?: string[];
// 是否导入完成
imported: boolean;
// 是否导入失败
invalid: boolean;
}
export interface IRedirectInfo {
// 跳转资源的类型
type: string;
// 跳转资源的 uuid
uuid: string;
}
export interface QueryAssetsOption {
type?: string;
pattern?: string;
ccType?: string;
extname?: string;
importer?: string;
isBundle?: boolean;
}
export interface AssetOperationOption {
// 是否强制覆盖已经存在的文件,默认 false
overwrite?: boolean;
// 是否自动重命名冲突文件,默认 false
rename?: boolean;
}
export interface AssetDBOptions {
name: string;
target: string;
library: string;
temp: string;
/**
* 0: 忽略错误
* 1: 仅仅打印错误
* 2: 打印错误
* 3: 打印错误
* 4: 打印错误
*/
level: number;
ignoreFiles: string[];
readonly: boolean;
}
export interface ContributionInfo {
mount?: {
path: string;
readonly?: boolean;
};
}
export interface ExecuteAssetDBScriptMethodOptions {
name: string;
method: string;
args: any[];
}
export interface IAssetMeta {
ver: string;
importer: string;
imported: boolean;
uuid: string;
files: string[];
subMetas: {
[index: string]: IAssetMeta;
};
userData: {
[index: string]: any;
};
displayName: string;
id: string;
name: string;
}

Some files were not shown because too many files have changed in this diff Show More