diff --git a/assets/resources/game/heros/hero.prefab b/assets/resources/game/heros/hero.prefab index 7d68bd75..bf0cdeba 100644 --- a/assets/resources/game/heros/hero.prefab +++ b/assets/resources/game/heros/hero.prefab @@ -45,6 +45,9 @@ ], "_active": true, "_components": [ + { + "__id__": 89 + }, { "__id__": 91 }, @@ -54,9 +57,6 @@ { "__id__": 95 }, - { - "__id__": 88 - }, { "__id__": 97 }, @@ -572,7 +572,7 @@ "__expectedType__": "sp.SkeletonData" }, "defaultSkin": "default", - "defaultAnimation": "", + "defaultAnimation": "move", "_premultipliedAlpha": false, "_timeScale": 1, "_preCacheMode": 1, @@ -1809,7 +1809,7 @@ }, { "__type__": "cc.Node", - "_name": "rang_box", + "_name": "range_box", "_objFlags": 0, "__editorExtras__": {}, "_parent": { @@ -1832,7 +1832,7 @@ } ], "_prefab": { - "__id__": 90 + "__id__": 88 }, "_lpos": { "__type__": "cc.Vec3", @@ -1950,7 +1950,7 @@ }, "_size": { "__type__": "cc.Size", - "width": 200, + "width": 160, "height": 80 }, "_id": "" @@ -1971,39 +1971,11 @@ "__prefab": { "__id__": 87 }, - "Hero_node": { - "__id__": 88 - }, "_id": "" }, { "__type__": "cc.CompPrefabInfo", - "fileId": "64UkfVY1dKB79n553D1pj7" - }, - { - "__type__": "dc1b7IQTVxHfIHFfWu0u4I/", - "_name": "", - "_objFlags": 0, - "__editorExtras__": {}, - "node": { - "__id__": 1 - }, - "_enabled": true, - "__prefab": { - "__id__": 89 - }, - "hitFlashMaterial": { - "__uuid__": "a8f34051-ccff-4050-b9d9-234f62977264", - "__expectedType__": "cc.Material" - }, - "BoxRang": { - "__id__": 86 - }, - "_id": "" - }, - { - "__type__": "cc.CompPrefabInfo", - "fileId": "88a6VdbQBB7YwXovYCN2Sy" + "fileId": "2175joY25A3ZkpTMPMM3QI" }, { "__type__": "cc.PrefabInfo", @@ -2028,7 +2000,7 @@ }, "_enabled": false, "__prefab": { - "__id__": 92 + "__id__": 90 }, "_contentSize": { "__type__": "cc.Size", @@ -2056,7 +2028,7 @@ }, "_enabled": true, "__prefab": { - "__id__": 94 + "__id__": 92 }, "_customMaterial": null, "_srcBlendFactor": 2, @@ -2098,7 +2070,7 @@ }, "_enabled": true, "__prefab": { - "__id__": 96 + "__id__": 94 }, "animator": { "__id__": 24 @@ -2109,6 +2081,31 @@ "__type__": "cc.CompPrefabInfo", "fileId": "6cDIo6gXFNnbPNuWVAqhBD" }, + { + "__type__": "dc1b7IQTVxHfIHFfWu0u4I/", + "_name": "", + "_objFlags": 0, + "__editorExtras__": {}, + "node": { + "__id__": 1 + }, + "_enabled": true, + "__prefab": { + "__id__": 96 + }, + "hitFlashMaterial": { + "__uuid__": "a8f34051-ccff-4050-b9d9-234f62977264", + "__expectedType__": "cc.Material" + }, + "BoxRang": { + "__id__": 79 + }, + "_id": "" + }, + { + "__type__": "cc.CompPrefabInfo", + "fileId": "88a6VdbQBB7YwXovYCN2Sy" + }, { "__type__": "cc.RigidBody2D", "_name": "", diff --git a/assets/resources/game/heros/own.prefab b/assets/resources/game/heros/own.prefab deleted file mode 100644 index f09fd2e8..00000000 --- a/assets/resources/game/heros/own.prefab +++ /dev/null @@ -1,1122 +0,0 @@ -[ - { - "__type__": "cc.Prefab", - "_name": "own", - "_objFlags": 0, - "__editorExtras__": {}, - "_native": "", - "data": { - "__id__": 1 - }, - "optimizationPolicy": 0, - "persistent": false - }, - { - "__type__": "cc.Node", - "_name": "own", - "_objFlags": 0, - "__editorExtras__": {}, - "_parent": null, - "_children": [ - { - "__id__": 2 - }, - { - "__id__": 8 - }, - { - "__id__": 27 - } - ], - "_active": true, - "_components": [ - { - "__id__": 41 - }, - { - "__id__": 43 - }, - { - "__id__": 45 - }, - { - "__id__": 47 - }, - { - "__id__": 49 - }, - { - "__id__": 51 - } - ], - "_prefab": { - "__id__": 53 - }, - "_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.Node", - "_name": "shader", - "_objFlags": 0, - "__editorExtras__": {}, - "_parent": { - "__id__": 1 - }, - "_children": [], - "_active": true, - "_components": [ - { - "__id__": 3 - }, - { - "__id__": 5 - } - ], - "_prefab": { - "__id__": 7 - }, - "_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__": 2 - }, - "_enabled": true, - "__prefab": { - "__id__": 4 - }, - "_contentSize": { - "__type__": "cc.Size", - "width": 72, - "height": 15 - }, - "_anchorPoint": { - "__type__": "cc.Vec2", - "x": 0.5, - "y": 0.5 - }, - "_id": "" - }, - { - "__type__": "cc.CompPrefabInfo", - "fileId": "f7NISe7HdAD68SLfhnddy8" - }, - { - "__type__": "cc.Sprite", - "_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 - }, - "_spriteFrame": { - "__uuid__": "f87f53f9-2fba-4a5b-968a-79a593311ab2@34d88", - "__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": "e71ctEmpxFC4KlSYRZNz/a" - }, - { - "__type__": "cc.PrefabInfo", - "root": { - "__id__": 1 - }, - "asset": { - "__id__": 0 - }, - "fileId": "66VNgwnoRDmprg2mtbH825", - "instance": null, - "targetOverrides": null, - "nestedPrefabInstanceRoots": null - }, - { - "__type__": "cc.Node", - "_name": "avatar", - "_objFlags": 512, - "__editorExtras__": {}, - "_parent": { - "__id__": 1 - }, - "_children": [ - { - "__id__": 9 - } - ], - "_active": true, - "_components": [ - { - "__id__": 19 - }, - { - "__id__": 21 - }, - { - "__id__": 24 - } - ], - "_prefab": { - "__id__": 26 - }, - "_lpos": { - "__type__": "cc.Vec3", - "x": 0, - "y": 5, - "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.Node", - "_name": "TNode", - "_objFlags": 512, - "__editorExtras__": {}, - "_parent": { - "__id__": 8 - }, - "_children": [ - { - "__id__": 10 - } - ], - "_active": true, - "_components": [ - { - "__id__": 16 - } - ], - "_prefab": { - "__id__": 18 - }, - "_lpos": { - "__type__": "cc.Vec3", - "x": -0.0000010490732620382914, - "y": 24, - "z": 0 - }, - "_lrot": { - "__type__": "cc.Quat", - "x": 0, - "y": 0, - "z": 2.1855693419110223e-8, - "w": 0.9999999999999996 - }, - "_lscale": { - "__type__": "cc.Vec3", - "x": 1.0139000415802002, - "y": 1.013900041580204, - "z": 1 - }, - "_mobility": 0, - "_layer": 1, - "_euler": { - "__type__": "cc.Vec3", - "x": 0, - "y": 0, - "z": 0.000002504477982493727 - }, - "_id": "" - }, - { - "__type__": "cc.Node", - "_name": "bb", - "_objFlags": 512, - "__editorExtras__": {}, - "_parent": { - "__id__": 9 - }, - "_children": [], - "_active": true, - "_components": [ - { - "__id__": 11 - }, - { - "__id__": 13 - } - ], - "_prefab": { - "__id__": 15 - }, - "_lpos": { - "__type__": "cc.Vec3", - "x": 0, - "y": -30, - "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__": 10 - }, - "_enabled": true, - "__prefab": { - "__id__": 12 - }, - "_contentSize": { - "__type__": "cc.Size", - "width": 90, - "height": 105 - }, - "_anchorPoint": { - "__type__": "cc.Vec2", - "x": 0.5, - "y": 0 - }, - "_id": "" - }, - { - "__type__": "cc.CompPrefabInfo", - "fileId": "21OT7FeExH3qJ+HlQeiKcW" - }, - { - "__type__": "cc.Sprite", - "_name": "", - "_objFlags": 0, - "__editorExtras__": {}, - "node": { - "__id__": 10 - }, - "_enabled": true, - "__prefab": { - "__id__": 14 - }, - "_customMaterial": null, - "_srcBlendFactor": 2, - "_dstBlendFactor": 4, - "_color": { - "__type__": "cc.Color", - "r": 255, - "g": 255, - "b": 255, - "a": 255 - }, - "_spriteFrame": { - "__uuid__": "7b95dfa5-c844-44d4-8d63-302f57da2ba2@a298b", - "__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": "ae/02lQLpCD7dTY0Zi+P/s" - }, - { - "__type__": "cc.PrefabInfo", - "root": { - "__id__": 1 - }, - "asset": { - "__id__": 0 - }, - "fileId": "76pAU1XptHYqO31w89LgnK", - "instance": null, - "targetOverrides": null, - "nestedPrefabInstanceRoots": null - }, - { - "__type__": "cc.UITransform", - "_name": "", - "_objFlags": 0, - "__editorExtras__": {}, - "node": { - "__id__": 9 - }, - "_enabled": true, - "__prefab": { - "__id__": 17 - }, - "_contentSize": { - "__type__": "cc.Size", - "width": 100, - "height": 100 - }, - "_anchorPoint": { - "__type__": "cc.Vec2", - "x": 0.5, - "y": 0 - }, - "_id": "" - }, - { - "__type__": "cc.CompPrefabInfo", - "fileId": "07BVAwSehA/5Rcf5ZFuQwy" - }, - { - "__type__": "cc.PrefabInfo", - "root": { - "__id__": 1 - }, - "asset": { - "__id__": 0 - }, - "fileId": "763rWvVQlPoZSgcfW0QuMN", - "instance": null, - "targetOverrides": null, - "nestedPrefabInstanceRoots": null - }, - { - "__type__": "cc.UITransform", - "_name": "", - "_objFlags": 0, - "__editorExtras__": {}, - "node": { - "__id__": 8 - }, - "_enabled": true, - "__prefab": { - "__id__": 20 - }, - "_contentSize": { - "__type__": "cc.Size", - "width": 15.520000457763672, - "height": 9.600000381469727 - }, - "_anchorPoint": { - "__type__": "cc.Vec2", - "x": 0.05283504952715698, - "y": 2.541666525933483 - }, - "_id": "" - }, - { - "__type__": "cc.CompPrefabInfo", - "fileId": "2epemEawRGPpO3vKyuHHBL" - }, - { - "__type__": "sp.Skeleton", - "_name": "", - "_objFlags": 0, - "__editorExtras__": {}, - "node": { - "__id__": 8 - }, - "_enabled": true, - "__prefab": { - "__id__": 22 - }, - "_customMaterial": null, - "_srcBlendFactor": 2, - "_dstBlendFactor": 4, - "_color": { - "__type__": "cc.Color", - "r": 255, - "g": 255, - "b": 255, - "a": 255 - }, - "_skeletonData": { - "__uuid__": "a80809a8-64bf-4c66-b49e-7aa837d821dd", - "__expectedType__": "sp.SkeletonData" - }, - "defaultSkin": "", - "defaultAnimation": "", - "_premultipliedAlpha": false, - "_timeScale": 1, - "_preCacheMode": 1, - "_cacheMode": 1, - "_sockets": [ - { - "__id__": 23 - } - ], - "_useTint": false, - "_debugMesh": false, - "_debugBones": false, - "_debugSlots": false, - "_enableBatch": false, - "loop": true, - "_id": "" - }, - { - "__type__": "cc.CompPrefabInfo", - "fileId": "d6Qb8NhhhN1ascGn7UPZok" - }, - { - "__type__": "sp.Skeleton.SpineSocket", - "path": "root/bone", - "target": { - "__id__": 9 - } - }, - { - "__type__": "eb846wnC9NNnIJh5u2Kw3mj", - "_name": "", - "_objFlags": 0, - "__editorExtras__": {}, - "node": { - "__id__": 8 - }, - "_enabled": true, - "__prefab": { - "__id__": 25 - }, - "_id": "" - }, - { - "__type__": "cc.CompPrefabInfo", - "fileId": "1dfEZV+LtJ6pMM3O7GBe5I" - }, - { - "__type__": "cc.PrefabInfo", - "root": { - "__id__": 1 - }, - "asset": { - "__id__": 0 - }, - "fileId": "48a+Hx9oREoZ7vqKgprKhT", - "instance": null, - "targetOverrides": null, - "nestedPrefabInstanceRoots": null - }, - { - "__type__": "cc.Node", - "_name": "top", - "_objFlags": 0, - "__editorExtras__": {}, - "_parent": { - "__id__": 1 - }, - "_children": [ - { - "__id__": 28 - } - ], - "_active": true, - "_components": [ - { - "__id__": 36 - }, - { - "__id__": 38 - } - ], - "_prefab": { - "__id__": 40 - }, - "_lpos": { - "__type__": "cc.Vec3", - "x": 0, - "y": 113, - "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.Node", - "_name": "lab_name", - "_objFlags": 0, - "__editorExtras__": {}, - "_parent": { - "__id__": 27 - }, - "_children": [], - "_active": true, - "_components": [ - { - "__id__": 29 - }, - { - "__id__": 31 - }, - { - "__id__": 33 - } - ], - "_prefab": { - "__id__": 35 - }, - "_lpos": { - "__type__": "cc.Vec3", - "x": 0, - "y": 17.12, - "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__": 28 - }, - "_enabled": true, - "__prefab": { - "__id__": 30 - }, - "_contentSize": { - "__type__": "cc.Size", - "width": 69.3671875, - "height": 34.24 - }, - "_anchorPoint": { - "__type__": "cc.Vec2", - "x": 0.5, - "y": 0.5 - }, - "_id": "" - }, - { - "__type__": "cc.CompPrefabInfo", - "fileId": "c68UOAlNhN171Umca6yVvF" - }, - { - "__type__": "cc.Label", - "_name": "", - "_objFlags": 0, - "__editorExtras__": {}, - "node": { - "__id__": 28 - }, - "_enabled": true, - "__prefab": { - "__id__": 32 - }, - "_customMaterial": null, - "_srcBlendFactor": 2, - "_dstBlendFactor": 4, - "_color": { - "__type__": "cc.Color", - "r": 255, - "g": 255, - "b": 255, - "a": 255 - }, - "_string": "player", - "_horizontalAlign": 1, - "_verticalAlign": 1, - "_actualFontSize": 24, - "_fontSize": 24, - "_fontFamily": "Arial", - "_lineHeight": 24, - "_overflow": 0, - "_enableWrapText": true, - "_font": null, - "_isSystemFontUsed": true, - "_spacingX": 0, - "_isItalic": false, - "_isBold": false, - "_isUnderline": false, - "_underlineHeight": 2, - "_cacheMode": 1, - "_enableOutline": true, - "_outlineColor": { - "__type__": "cc.Color", - "r": 0, - "g": 0, - "b": 0, - "a": 255 - }, - "_outlineWidth": 2, - "_enableShadow": false, - "_shadowColor": { - "__type__": "cc.Color", - "r": 0, - "g": 0, - "b": 0, - "a": 255 - }, - "_shadowOffset": { - "__type__": "cc.Vec2", - "x": 2, - "y": 2 - }, - "_shadowBlur": 2, - "_id": "" - }, - { - "__type__": "cc.CompPrefabInfo", - "fileId": "2frm37uaJHQr0AEEaYyM82" - }, - { - "__type__": "cc.LabelOutline", - "_name": "", - "_objFlags": 0, - "__editorExtras__": {}, - "node": { - "__id__": 28 - }, - "_enabled": true, - "__prefab": { - "__id__": 34 - }, - "_id": "" - }, - { - "__type__": "cc.CompPrefabInfo", - "fileId": "aeeDsd9JVLMK0M/n2WTVl7" - }, - { - "__type__": "cc.PrefabInfo", - "root": { - "__id__": 1 - }, - "asset": { - "__id__": 0 - }, - "fileId": "31uZ7ewvdKoKWqTJ+narWR", - "instance": null, - "targetOverrides": null, - "nestedPrefabInstanceRoots": null - }, - { - "__type__": "cc.UITransform", - "_name": "", - "_objFlags": 0, - "__editorExtras__": {}, - "node": { - "__id__": 27 - }, - "_enabled": true, - "__prefab": { - "__id__": 37 - }, - "_contentSize": { - "__type__": "cc.Size", - "width": 0, - "height": 34.24 - }, - "_anchorPoint": { - "__type__": "cc.Vec2", - "x": 0.5, - "y": 0 - }, - "_id": "" - }, - { - "__type__": "cc.CompPrefabInfo", - "fileId": "234p72JXlGdp68uJcFfl0q" - }, - { - "__type__": "cc.Layout", - "_name": "", - "_objFlags": 0, - "__editorExtras__": {}, - "node": { - "__id__": 27 - }, - "_enabled": true, - "__prefab": { - "__id__": 39 - }, - "_resizeMode": 1, - "_layoutType": 2, - "_cellSize": { - "__type__": "cc.Size", - "width": 40, - "height": 40 - }, - "_startAxis": 0, - "_paddingLeft": 0, - "_paddingRight": 0, - "_paddingTop": 0, - "_paddingBottom": 0, - "_spacingX": 0, - "_spacingY": 0, - "_verticalDirection": 1, - "_horizontalDirection": 0, - "_constraint": 0, - "_constraintNum": 2, - "_affectedByScale": false, - "_isAlign": false, - "_id": "" - }, - { - "__type__": "cc.CompPrefabInfo", - "fileId": "a5G3mGGpNLDI2/5kZx17N8" - }, - { - "__type__": "cc.PrefabInfo", - "root": { - "__id__": 1 - }, - "asset": { - "__id__": 0 - }, - "fileId": "d6Y+tOem9EaKNOQr6QHMns", - "instance": null, - "targetOverrides": null, - "nestedPrefabInstanceRoots": null - }, - { - "__type__": "cc.UITransform", - "_name": "", - "_objFlags": 0, - "__editorExtras__": {}, - "node": { - "__id__": 1 - }, - "_enabled": true, - "__prefab": { - "__id__": 42 - }, - "_contentSize": { - "__type__": "cc.Size", - "width": 100, - "height": 100 - }, - "_anchorPoint": { - "__type__": "cc.Vec2", - "x": 0.5, - "y": 0 - }, - "_id": "" - }, - { - "__type__": "cc.CompPrefabInfo", - "fileId": "14OhXRCixNOaApgow/hFbp" - }, - { - "__type__": "sp.Skeleton", - "_name": "", - "_objFlags": 0, - "__editorExtras__": {}, - "node": { - "__id__": 1 - }, - "_enabled": true, - "__prefab": { - "__id__": 44 - }, - "_customMaterial": null, - "_srcBlendFactor": 2, - "_dstBlendFactor": 4, - "_color": { - "__type__": "cc.Color", - "r": 255, - "g": 255, - "b": 255, - "a": 255 - }, - "_skeletonData": null, - "defaultSkin": "", - "defaultAnimation": "", - "_premultipliedAlpha": true, - "_timeScale": 1, - "_preCacheMode": 0, - "_cacheMode": 0, - "_sockets": [], - "_useTint": false, - "_debugMesh": false, - "_debugBones": false, - "_debugSlots": false, - "_enableBatch": false, - "loop": true, - "_id": "" - }, - { - "__type__": "cc.CompPrefabInfo", - "fileId": "3dWWGO2rFK4LL+PeQ7ANRn" - }, - { - "__type__": "9b561C/2tNGlbtkkgBnAepW", - "_name": "", - "_objFlags": 0, - "__editorExtras__": {}, - "node": { - "__id__": 1 - }, - "_enabled": true, - "__prefab": { - "__id__": 46 - }, - "animator": { - "__id__": 24 - }, - "_id": "" - }, - { - "__type__": "cc.CompPrefabInfo", - "fileId": "7bybVvagtM/reemx81cxhr" - }, - { - "__type__": "60726sarbtIDJfLLE+75yKL", - "_name": "", - "_objFlags": 0, - "__editorExtras__": {}, - "node": { - "__id__": 1 - }, - "_enabled": true, - "__prefab": { - "__id__": 48 - }, - "_id": "" - }, - { - "__type__": "cc.CompPrefabInfo", - "fileId": "39G8yJo19PUpY+Tgxza8T5" - }, - { - "__type__": "cc.RigidBody2D", - "_name": "", - "_objFlags": 0, - "__editorExtras__": {}, - "node": { - "__id__": 1 - }, - "_enabled": true, - "__prefab": { - "__id__": 50 - }, - "enabledContactListener": true, - "bullet": true, - "awakeOnLoad": true, - "_group": 32, - "_type": 2, - "_allowSleep": false, - "_gravityScale": 1, - "_linearDamping": 0, - "_angularDamping": 0, - "_linearVelocity": { - "__type__": "cc.Vec2", - "x": 0, - "y": 0 - }, - "_angularVelocity": 0, - "_fixedRotation": true, - "_id": "" - }, - { - "__type__": "cc.CompPrefabInfo", - "fileId": "c8EJ1KQ3hNRbAw0cgsaNRx" - }, - { - "__type__": "cc.BoxCollider2D", - "_name": "", - "_objFlags": 0, - "__editorExtras__": {}, - "node": { - "__id__": 1 - }, - "_enabled": true, - "__prefab": { - "__id__": 52 - }, - "tag": 0, - "_group": 32, - "_density": 1, - "_sensor": false, - "_friction": 100, - "_restitution": 0, - "_offset": { - "__type__": "cc.Vec2", - "x": 1.6, - "y": 44.4 - }, - "_size": { - "__type__": "cc.Size", - "width": 58.5, - "height": 111 - }, - "_id": "" - }, - { - "__type__": "cc.CompPrefabInfo", - "fileId": "62fAGknj9OypOrug6f/FI6" - }, - { - "__type__": "cc.PrefabInfo", - "root": { - "__id__": 1 - }, - "asset": { - "__id__": 0 - }, - "fileId": "fdklpBwCBM/qJ4WFlQF3kT", - "instance": null, - "targetOverrides": null - } -] \ No newline at end of file diff --git a/assets/resources/game/heros/own.prefab.meta b/assets/resources/game/heros/own.prefab.meta deleted file mode 100644 index e64c5ae2..00000000 --- a/assets/resources/game/heros/own.prefab.meta +++ /dev/null @@ -1,13 +0,0 @@ -{ - "ver": "1.1.50", - "importer": "prefab", - "imported": true, - "uuid": "63c02880-bda6-4370-bb22-46bf4f49bbfe", - "files": [ - ".json" - ], - "subMetas": {}, - "userData": { - "syncNodeName": "own" - } -} diff --git a/assets/resources/game/map/map_rpg.prefab b/assets/resources/game/map/map_rpg.prefab index e765a34c..2b5828b1 100644 --- a/assets/resources/game/map/map_rpg.prefab +++ b/assets/resources/game/map/map_rpg.prefab @@ -28,17 +28,17 @@ "_active": true, "_components": [ { - "__id__": 80 + "__id__": 72 }, { - "__id__": 82 + "__id__": 74 }, { - "__id__": 84 + "__id__": 76 } ], "_prefab": { - "__id__": 86 + "__id__": 78 }, "_lpos": { "__type__": "cc.Vec3", @@ -197,17 +197,17 @@ "_active": true, "_components": [ { - "__id__": 73 + "__id__": 65 }, { - "__id__": 75 + "__id__": 67 }, { - "__id__": 77 + "__id__": 69 } ], "_prefab": { - "__id__": 79 + "__id__": 71 }, "_lpos": { "__type__": "cc.Vec3", @@ -258,16 +258,22 @@ }, { "__id__": 44 + }, + { + "__id__": 50 + }, + { + "__id__": 56 } ], "_active": true, "_components": [ { - "__id__": 70 + "__id__": 62 } ], "_prefab": { - "__id__": 72 + "__id__": 64 }, "_lpos": { "__type__": "cc.Vec3", @@ -900,7 +906,7 @@ }, { "__type__": "cc.Node", - "_name": "EntityLayer", + "_name": "EntityLayer1", "_objFlags": 0, "__editorExtras__": {}, "_parent": { @@ -974,7 +980,7 @@ }, { "__type__": "cc.CompPrefabInfo", - "fileId": "f91Y4OCX1NFKfSWOAvmdSa" + "fileId": "f4UHtJSdBGoJN5JNrTo0Cc" }, { "__type__": "6639ayo4DFKZYCU2OBZzyb+", @@ -992,7 +998,7 @@ }, { "__type__": "cc.CompPrefabInfo", - "fileId": "6fzmfjcbNPK6tOzQOKJfRV" + "fileId": "9cpgNjFL5L1Ig8YQrAcaO8" }, { "__type__": "cc.PrefabInfo", @@ -1002,35 +1008,31 @@ "asset": { "__id__": 0 }, - "fileId": "77ZGG4JjxGiol1pDVFrjGQ", + "fileId": "99wEvV2I5Pv6rwpPNwdrxE", "instance": null, "targetOverrides": null, "nestedPrefabInstanceRoots": null }, { "__type__": "cc.Node", - "_name": "SkillLayer", + "_name": "EntityLayer", "_objFlags": 0, "__editorExtras__": {}, "_parent": { "__id__": 7 }, - "_children": [ - { - "__id__": 45 - } - ], + "_children": [], "_active": true, "_components": [ { - "__id__": 65 + "__id__": 45 }, { - "__id__": 67 + "__id__": 47 } ], "_prefab": { - "__id__": 69 + "__id__": 49 }, "_lpos": { "__type__": "cc.Vec3", @@ -1061,273 +1063,6 @@ }, "_id": "" }, - { - "__type__": "cc.Node", - "_objFlags": 0, - "_parent": { - "__id__": 44 - }, - "_prefab": { - "__id__": 46 - }, - "__editorExtras__": {} - }, - { - "__type__": "cc.PrefabInfo", - "root": { - "__id__": 45 - }, - "asset": { - "__uuid__": "63c02880-bda6-4370-bb22-46bf4f49bbfe", - "__expectedType__": "cc.Prefab" - }, - "fileId": "fdklpBwCBM/qJ4WFlQF3kT", - "instance": { - "__id__": 47 - }, - "targetOverrides": null - }, - { - "__type__": "cc.PrefabInstance", - "fileId": "2fXaJzu7JM+6/jYrphb/fs", - "prefabRootNode": { - "__id__": 1 - }, - "mountedChildren": [], - "mountedComponents": [], - "propertyOverrides": [ - { - "__id__": 48 - }, - { - "__id__": 50 - }, - { - "__id__": 51 - }, - { - "__id__": 52 - }, - { - "__id__": 53 - }, - { - "__id__": 54 - }, - { - "__id__": 55 - }, - { - "__id__": 57 - }, - { - "__id__": 59 - }, - { - "__id__": 60 - }, - { - "__id__": 61 - }, - { - "__id__": 62 - }, - { - "__id__": 63 - }, - { - "__id__": 64 - } - ], - "removedComponents": [] - }, - { - "__type__": "CCPropertyOverrideInfo", - "targetInfo": { - "__id__": 49 - }, - "propertyPath": [ - "_name" - ], - "value": "own" - }, - { - "__type__": "cc.TargetInfo", - "localID": [ - "fdklpBwCBM/qJ4WFlQF3kT" - ] - }, - { - "__type__": "CCPropertyOverrideInfo", - "targetInfo": { - "__id__": 49 - }, - "propertyPath": [ - "_lpos" - ], - "value": { - "__type__": "cc.Vec3", - "x": -13.446, - "y": -13.431, - "z": 0 - } - }, - { - "__type__": "CCPropertyOverrideInfo", - "targetInfo": { - "__id__": 49 - }, - "propertyPath": [ - "_lrot" - ], - "value": { - "__type__": "cc.Quat", - "x": 0, - "y": 0, - "z": 0, - "w": 1 - } - }, - { - "__type__": "CCPropertyOverrideInfo", - "targetInfo": { - "__id__": 49 - }, - "propertyPath": [ - "_euler" - ], - "value": { - "__type__": "cc.Vec3", - "x": 0, - "y": 0, - "z": 0 - } - }, - { - "__type__": "CCPropertyOverrideInfo", - "targetInfo": { - "__id__": 49 - }, - "propertyPath": [ - "_active" - ], - "value": true - }, - { - "__type__": "CCPropertyOverrideInfo", - "targetInfo": { - "__id__": 49 - }, - "propertyPath": [ - "_lscale" - ], - "value": { - "__type__": "cc.Vec3", - "x": 1, - "y": 1, - "z": 1 - } - }, - { - "__type__": "CCPropertyOverrideInfo", - "targetInfo": { - "__id__": 56 - }, - "propertyPath": [ - "_group" - ], - "value": 4 - }, - { - "__type__": "cc.TargetInfo", - "localID": [ - "c8EJ1KQ3hNRbAw0cgsaNRx" - ] - }, - { - "__type__": "CCPropertyOverrideInfo", - "targetInfo": { - "__id__": 58 - }, - "propertyPath": [ - "_group" - ], - "value": 4 - }, - { - "__type__": "cc.TargetInfo", - "localID": [ - "62fAGknj9OypOrug6f/FI6" - ] - }, - { - "__type__": "CCPropertyOverrideInfo", - "targetInfo": { - "__id__": 58 - }, - "propertyPath": [ - "_sensor" - ], - "value": true - }, - { - "__type__": "CCPropertyOverrideInfo", - "targetInfo": { - "__id__": 56 - }, - "propertyPath": [ - "_type" - ], - "value": 2 - }, - { - "__type__": "CCPropertyOverrideInfo", - "targetInfo": { - "__id__": 58 - }, - "propertyPath": [ - "_density" - ], - "value": 0 - }, - { - "__type__": "CCPropertyOverrideInfo", - "targetInfo": { - "__id__": 58 - }, - "propertyPath": [ - "_offset" - ], - "value": { - "__type__": "cc.Vec2", - "x": 1.1, - "y": 35.9 - } - }, - { - "__type__": "CCPropertyOverrideInfo", - "targetInfo": { - "__id__": 58 - }, - "propertyPath": [ - "_size" - ], - "value": { - "__type__": "cc.Size", - "width": 57.5, - "height": 128 - } - }, - { - "__type__": "CCPropertyOverrideInfo", - "targetInfo": { - "__id__": 56 - }, - "propertyPath": [ - "_gravityScale" - ], - "value": 0 - }, { "__type__": "cc.UITransform", "_name": "", @@ -1338,7 +1073,225 @@ }, "_enabled": true, "__prefab": { - "__id__": 66 + "__id__": 46 + }, + "_contentSize": { + "__type__": "cc.Size", + "width": 100, + "height": 100 + }, + "_anchorPoint": { + "__type__": "cc.Vec2", + "x": 0, + "y": 0 + }, + "_id": "" + }, + { + "__type__": "cc.CompPrefabInfo", + "fileId": "f91Y4OCX1NFKfSWOAvmdSa" + }, + { + "__type__": "6639ayo4DFKZYCU2OBZzyb+", + "_name": "", + "_objFlags": 0, + "__editorExtras__": {}, + "node": { + "__id__": 44 + }, + "_enabled": true, + "__prefab": { + "__id__": 48 + }, + "_id": "" + }, + { + "__type__": "cc.CompPrefabInfo", + "fileId": "6fzmfjcbNPK6tOzQOKJfRV" + }, + { + "__type__": "cc.PrefabInfo", + "root": { + "__id__": 1 + }, + "asset": { + "__id__": 0 + }, + "fileId": "77ZGG4JjxGiol1pDVFrjGQ", + "instance": null, + "targetOverrides": null, + "nestedPrefabInstanceRoots": null + }, + { + "__type__": "cc.Node", + "_name": "EntityLayer2", + "_objFlags": 0, + "__editorExtras__": {}, + "_parent": { + "__id__": 7 + }, + "_children": [], + "_active": true, + "_components": [ + { + "__id__": 51 + }, + { + "__id__": 53 + } + ], + "_prefab": { + "__id__": 55 + }, + "_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__": 50 + }, + "_enabled": true, + "__prefab": { + "__id__": 52 + }, + "_contentSize": { + "__type__": "cc.Size", + "width": 100, + "height": 100 + }, + "_anchorPoint": { + "__type__": "cc.Vec2", + "x": 0, + "y": 0 + }, + "_id": "" + }, + { + "__type__": "cc.CompPrefabInfo", + "fileId": "fcl9eWhS9K6ZtX9Z626PPp" + }, + { + "__type__": "6639ayo4DFKZYCU2OBZzyb+", + "_name": "", + "_objFlags": 0, + "__editorExtras__": {}, + "node": { + "__id__": 50 + }, + "_enabled": true, + "__prefab": { + "__id__": 54 + }, + "_id": "" + }, + { + "__type__": "cc.CompPrefabInfo", + "fileId": "a2VlMB5DNOr4wbzGgH2lXk" + }, + { + "__type__": "cc.PrefabInfo", + "root": { + "__id__": 1 + }, + "asset": { + "__id__": 0 + }, + "fileId": "4fP7G4KUBB+56gZWSQoIpq", + "instance": null, + "targetOverrides": null, + "nestedPrefabInstanceRoots": null + }, + { + "__type__": "cc.Node", + "_name": "SkillLayer", + "_objFlags": 0, + "__editorExtras__": {}, + "_parent": { + "__id__": 7 + }, + "_children": [], + "_active": true, + "_components": [ + { + "__id__": 57 + }, + { + "__id__": 59 + } + ], + "_prefab": { + "__id__": 61 + }, + "_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__": 56 + }, + "_enabled": true, + "__prefab": { + "__id__": 58 }, "_contentSize": { "__type__": "cc.Size", @@ -1362,11 +1315,11 @@ "_objFlags": 0, "__editorExtras__": {}, "node": { - "__id__": 44 + "__id__": 56 }, "_enabled": true, "__prefab": { - "__id__": 68 + "__id__": 60 }, "light": { "__uuid__": "319c7eb8-9826-48b6-81e4-82559dbf82a8", @@ -1401,7 +1354,7 @@ }, "_enabled": true, "__prefab": { - "__id__": 71 + "__id__": 63 }, "_contentSize": { "__type__": "cc.Size", @@ -1442,7 +1395,7 @@ }, "_enabled": true, "__prefab": { - "__id__": 74 + "__id__": 66 }, "_contentSize": { "__type__": "cc.Size", @@ -1470,7 +1423,7 @@ }, "_enabled": true, "__prefab": { - "__id__": 76 + "__id__": 68 }, "camera": { "__id__": 3 @@ -1485,10 +1438,16 @@ "__id__": 34 }, "entityLayer": { + "__id__": 47 + }, + "entityLayer1": { "__id__": 41 }, + "entityLayer2": { + "__id__": 53 + }, "SkillLayer": { - "__id__": 67 + "__id__": 59 }, "isFollowPlayer": true, "_id": "" @@ -1507,7 +1466,7 @@ }, "_enabled": true, "__prefab": { - "__id__": 78 + "__id__": 70 }, "_id": "" }, @@ -1538,7 +1497,7 @@ }, "_enabled": true, "__prefab": { - "__id__": 81 + "__id__": 73 }, "_contentSize": { "__type__": "cc.Size", @@ -1566,7 +1525,7 @@ }, "_enabled": true, "__prefab": { - "__id__": 83 + "__id__": 75 }, "_cameraComponent": { "__id__": 3 @@ -1588,7 +1547,7 @@ }, "_enabled": true, "__prefab": { - "__id__": 85 + "__id__": 77 }, "_alignFlags": 45, "_target": null, @@ -1624,11 +1583,6 @@ }, "fileId": "32qENLKwZHV5S2IyZfpNx2", "instance": null, - "targetOverrides": null, - "nestedPrefabInstanceRoots": [ - { - "__id__": 45 - } - ] + "targetOverrides": null } ] \ No newline at end of file diff --git a/assets/script/game/map/MapMonsterComp.ts b/assets/script/game/map/MapMonsterComp.ts index 7f30bdba..3c10d9ee 100644 --- a/assets/script/game/map/MapMonsterComp.ts +++ b/assets/script/game/map/MapMonsterComp.ts @@ -29,7 +29,7 @@ export class MapMonsterComp extends CCComp { cur_mission:number = 1; //当前关卡方案 mission_list:any = [] setp_timer: Timer = new Timer(0.5); - setp_num:number = 50; + setp_num:number = 5; onLoad(){ // 监听全局事件 oops.message.on("do_add_monster", this.on_do_add_monster, this); @@ -40,7 +40,7 @@ export class MapMonsterComp extends CCComp { let num =RandomManager.instance.getRandomByObjectList(MissionNum,1) this.cur_mission = num[0] this.mission_list = MonsetList[this.cur_mission] - console.log("当前关卡方案",this.cur_mission,this.mission_list) + // console.log("当前关卡方案",this.cur_mission,this.mission_list) this.refresh_timer= new Timer(smc.vm_data.gold.cd); this.monster_refresh() } @@ -49,7 +49,7 @@ export class MapMonsterComp extends CCComp { this.monster_refresh() } if (this.refresh_timer.update(dt)) { - this.setp_num = RandomManager.instance.getRandomInt(this.min_monster_num,this.max_monster_num,2) + // this.setp_num = RandomManager.instance.getRandomInt(this.min_monster_num,this.max_monster_num,2) } if (this.mission_up_timer.update(dt)) { // 刷新怪物定时器 @@ -64,22 +64,36 @@ export class MapMonsterComp extends CCComp { if (this.setp_num <= 0){ return } - console.log("当前波数",this.cur_count) - console.log("当前怪物池",this.mission_list[this.monster_level]) + // console.log("当前波数",this.cur_count) + // console.log("当前怪物池",this.mission_list[this.monster_level]) let m:any = RandomManager.instance.getRandomByObjectList(this.mission_list[this.monster_level],1) - console.log("刷怪",m) + // console.log("刷怪",m) this.addMonster(m[0]) this.setp_num -= 1 } private addMonster(uuid:number=1101) { - let monster = ecs.getEntity(Monster); let pos:Vec3 = v3(BoxSet.MONSTER_START,BoxSet.GAME_LINE) let scale = -1 - monster.load(pos,scale,uuid); + var scene = smc.map.MapView.scene; + let x = RandomManager.instance.getRandomInt(0,2, 2); + let monster_layer = scene.entityLayer!.node! + switch (x) { + case 1: + monster_layer = scene.entityLayer1!.node!; + pos.y=pos.y+5; + break; + case 2: + monster_layer= scene.entityLayer2!.node!; + pos.y=pos.y-5; + default: + break; + } + monster.load(pos,scale,uuid,monster_layer); smc.monsters.splice(0,1) } + private on_do_add_monster(event: string, args: any) { // this.addMonster(args.uuid) } diff --git a/assets/script/game/map/MapSkillComp.ts b/assets/script/game/map/MapSkillComp.ts index da5d0c09..95099aec 100644 --- a/assets/script/game/map/MapSkillComp.ts +++ b/assets/script/game/map/MapSkillComp.ts @@ -29,12 +29,11 @@ export class MapSkillComp extends CCComp { csk.load(pos,scale,uuid); } doMonsterLoad(){ - // const light = instantiate(this.light); - // light.setPosition(300,-30,0); - // this.node.addChild(light); + const light = instantiate(this.light); + light.setPosition(BoxSet.MONSTER_START,BoxSet.GAME_LINE); + this.node.addChild(light); } doHeroLoad(){ - console.log(this.light) const light = instantiate(this.light); light.setPosition(BoxSet.HERO_START,BoxSet.GAME_LINE,0); this.node.addChild(light); diff --git a/assets/script/game/map/view/MapViewComp.ts b/assets/script/game/map/view/MapViewComp.ts index ffc06e09..5d7c61fd 100644 --- a/assets/script/game/map/view/MapViewComp.ts +++ b/assets/script/game/map/view/MapViewComp.ts @@ -2,7 +2,6 @@ import { v3, Vec3, _decorator ,Prefab,instantiate,JsonAsset} from "cc"; import { ecs } from "../../../../../extensions/oops-plugin-framework/assets/libs/ecs/ECS"; import { CCComp } from "../../../../../extensions/oops-plugin-framework/assets/module/common/CCComp"; import { smc } from "../../common/SingletonModuleComp"; -// import { Role } from "../../role/Role"; import { BoxSet } from "../../common/config/BoxSet"; import { Hero } from "../../monster/Hero"; import { Monster } from "../../monster/Monster"; @@ -12,7 +11,6 @@ import { Timer } from "../../../../../extensions/oops-plugin-framework/assets/co import { oops } from "../../../../../extensions/oops-plugin-framework/assets/core/Oops"; import { CardSet } from "../../common/config/CardSet"; - const { ccclass, property } = _decorator; @ccclass('MapViewComp') @@ -42,6 +40,10 @@ export class MapViewComp extends CCComp { start() { this.scene = this.getComponent(MapViewScene); this.load_data() + this.load_role() + } + load_role(){ + } load_data(){ // let heros = oops.res.get("config/game/heros") diff --git a/assets/script/game/map/view/MapViewScene.ts b/assets/script/game/map/view/MapViewScene.ts index 11691920..b3789408 100644 --- a/assets/script/game/map/view/MapViewScene.ts +++ b/assets/script/game/map/view/MapViewScene.ts @@ -28,6 +28,10 @@ export class MapViewScene extends Component { @property(EntityLayer) public entityLayer: EntityLayer | null = null; + @property(EntityLayer) + public entityLayer1: EntityLayer | null = null; + @property(EntityLayer) + public entityLayer2: EntityLayer | null = null; @property(SkillLayer) public SkillLayer: SkillLayer | null = null; diff --git a/assets/script/game/map/view/map/layer/EntityLayer.ts b/assets/script/game/map/view/map/layer/EntityLayer.ts index 6f8f4c50..e3b44568 100644 --- a/assets/script/game/map/view/map/layer/EntityLayer.ts +++ b/assets/script/game/map/view/map/layer/EntityLayer.ts @@ -26,7 +26,7 @@ export default class EntityLayer extends Component { } protected start(): void { - console.log("EntityLayer start") + console.log("EntityLayer start",this) } public clear() { diff --git a/assets/script/game/monster/BoxRangComp.ts b/assets/script/game/monster/BoxRangComp.ts index 974a6dc7..0f937936 100644 --- a/assets/script/game/monster/BoxRangComp.ts +++ b/assets/script/game/monster/BoxRangComp.ts @@ -1,4 +1,4 @@ -import { _decorator,Contact2DType,Collider2D ,IPhysics2DContact} from "cc"; +import { _decorator,Contact2DType,Collider2D ,IPhysics2DContact,v3, v2} from "cc"; import { ecs } from "../../../../extensions/oops-plugin-framework/assets/libs/ecs/ECS"; import { CCComp } from "../../../../extensions/oops-plugin-framework/assets/module/common/CCComp"; import { BoxSet } from "../common/config/BoxSet"; @@ -9,41 +9,46 @@ const { ccclass, property } = _decorator; @ccclass('BoxRangComp') @ecs.register('BoxRang', false) export class BoxRangComp extends CCComp { - @property(MonsterViewComp) - Hero_node:MonsterViewComp = null!; - + Hero_node: any=null!; + MonsterViewComp:MonsterViewComp = null!; box_group:number = BoxSet.DEFAULT; box_tag:number = BoxSet.ATK_RANGE; + offset_x:number = 0; /** 视图层逻辑代码分离演示 */ start() { let collider = this.getComponent(Collider2D); collider.group = this.box_group; collider.tag = this.box_tag; - // console.log(collider,this.Hero_node); + collider.offset = v2(this.offset_x,45); + this.Hero_node = this.node.parent; + this.MonsterViewComp=this.Hero_node.getComponent(MonsterViewComp); + // console.log("range box",this.MonsterViewComp); if (collider) { collider.on(Contact2DType.BEGIN_CONTACT, this.onBeginContact, this); - collider.on(Contact2DType.END_CONTACT, this.onEndContact, this); - collider.on(Contact2DType.PRE_SOLVE, this.onPreSolve, this); - collider.on(Contact2DType.POST_SOLVE, this.onPostSolve, this); + // collider.on(Contact2DType.END_CONTACT, this.onEndContact, this); + // collider.on(Contact2DType.PRE_SOLVE, this.onPreSolve, this); + // collider.on(Contact2DType.POST_SOLVE, this.onPostSolve, this); } } - onBeginContact (selfCollider: Collider2D, otherCollider: Collider2D, contact: IPhysics2DContact | null) { - - } - onEndContact (selfCollider: Collider2D, otherCollider: Collider2D, contact: IPhysics2DContact | null) { - - } - onPreSolve (selfCollider: Collider2D, otherCollider: Collider2D, contact: IPhysics2DContact | null) { - if(selfCollider.group != otherCollider.group&&otherCollider.tag != BoxSet.ATK_RANGE){ - this.Hero_node.is_atking = true; + onBeginContact (selfCollider: Collider2D, otherCollider: Collider2D, contact: IPhysics2DContact | null) { + if(selfCollider.group != otherCollider.group&&otherCollider.tag != BoxSet.ATK_RANGE&&otherCollider.tag != BoxSet.SKILL_TAG){ + // console.log("range box group: seft:"+selfCollider.group+"|other:"+otherCollider.group+"| tag: seft:"+selfCollider.tag+"|other:"+otherCollider.tag); + this.MonsterViewComp.is_atking = true; } + } + // onEndContact (selfCollider: Collider2D, otherCollider: Collider2D, contact: IPhysics2DContact | null) { + // // console.log("range box group: seft:"+selfCollider.group+"|other:"+otherCollider.group+"| range box tag: seft:"+selfCollider.tag+"|other:"+otherCollider.tag); - } - onPostSolve (selfCollider: Collider2D, otherCollider: Collider2D, contact: IPhysics2DContact | null) { + // } + // onPreSolve (selfCollider: Collider2D, otherCollider: Collider2D, contact: IPhysics2DContact | null) { + + + // } + // onPostSolve (selfCollider: Collider2D, otherCollider: Collider2D, contact: IPhysics2DContact | null) { - } + // } /** 视图对象通过 ecs.Entity.remove(ModuleViewComp) 删除组件是触发组件处理自定义释放逻辑 */ reset() { this.node.destroy(); diff --git a/assets/script/game/monster/CSkill.ts b/assets/script/game/monster/CSkill.ts index 3340db45..556229bc 100644 --- a/assets/script/game/monster/CSkill.ts +++ b/assets/script/game/monster/CSkill.ts @@ -27,7 +27,7 @@ export class CSkill extends ecs.Entity { /** 加载角色 */ load(pos: Vec3 = Vec3.ZERO,scale:number = 1,uuid:number=1001) { // var path = "game/monster/"+prefab_path; - console.log("load skill",this) + // console.log("load skill",this) var path = "game/heros/skill"; var prefab: Prefab = oops.res.get(path, Prefab)!; var node = instantiate(prefab); diff --git a/assets/script/game/monster/Monster.ts b/assets/script/game/monster/Monster.ts index 7da8311a..810b78f2 100644 --- a/assets/script/game/monster/Monster.ts +++ b/assets/script/game/monster/Monster.ts @@ -16,6 +16,7 @@ import { MonsterSpine } from "./MonsterSpine"; import { MonsterViewComp } from "./MonsterViewComp"; import { CardSet } from "../common/config/CardSet"; import { BoxSet } from "../common/config/BoxSet"; +import { RandomManager } from "../../../../extensions/oops-plugin-framework/assets/core/common/random/RandomManager"; /** 角色实体 */ @ecs.register(`Monster`) export class Monster extends ecs.Entity { @@ -36,23 +37,19 @@ export class Monster extends ecs.Entity { } /** 加载角色 */ - load(pos: Vec3 = Vec3.ZERO,scale:number = -1,uuid:number=1001) { + load(pos: Vec3 = Vec3.ZERO,scale:number = -1,uuid:number=1001,layer:Node=smc.map.MapView.scene.entityLayer!.node!) { // var path = "game/monster/"+prefab_path; var path = "game/heros/hero"; - var prefab: Prefab = oops.res.get(path, Prefab)!; var node = instantiate(prefab); - var scene = smc.map.MapView.scene; - node.parent = scene.entityLayer!.node!; - var as = node.getComponent(MonsterSpine); - + node.parent=layer + // var as = node.getComponent(MonsterSpine); node.getChildByName("avatar").setScale(node.getChildByName("avatar").scale.x*scale, node.getChildByName("avatar").scale.y, node.getChildByName("avatar").scale.z); node.setPosition(pos) // console.log(node.getChildByName("avatar").getChildByName("TNode").getChildByName("bb").getComponent(Sprite)) const url = 'game/heros/heros'; resources.load(url, SpriteAtlas, (err: any, atlas) => { const sprite = node.getChildByName("avatar").getChildByName("TNode").getChildByName("bb").getComponent(Sprite); - sprite.spriteFrame = atlas.getSpriteFrame(smc.heros[uuid].path); }); this.hero_init(uuid,node) diff --git a/assets/script/game/monster/MonsterViewComp.ts b/assets/script/game/monster/MonsterViewComp.ts index 2ff3b8f9..8ee40b78 100644 --- a/assets/script/game/monster/MonsterViewComp.ts +++ b/assets/script/game/monster/MonsterViewComp.ts @@ -26,13 +26,13 @@ const { ccclass, property } = _decorator; @ccclass('MonsterViewComp') // 定义为 Cocos Creator 组件 @ecs.register('MonsterView', false) // 定义为 ECS 组件 export class MonsterViewComp extends CCComp { - @property(Material) hitFlashMaterial: Material; orginalFlashMaterial: Material; sprite: Sprite; - @property(BoxRangComp) - BoxRang:BoxRangComp = null!; + + @property(Node) + BoxRang:Node =null! /** 角色动画 */ as: MonsterSpine = null!; hero_uuid:number = 1001; @@ -76,21 +76,25 @@ export class MonsterViewComp extends CCComp { onLoad() { this.as = this.getComponent(MonsterSpine); - // PhysicsSystem2D.instance.debugDrawFlags = EPhysics2DDrawFlags.Aabb | - // EPhysics2DDrawFlags.Pair | - // EPhysics2DDrawFlags.CenterOfMass | - // EPhysics2DDrawFlags.Joint | - // EPhysics2DDrawFlags.Shape; + PhysicsSystem2D.instance.debugDrawFlags = EPhysics2DDrawFlags.Aabb + // | EPhysics2DDrawFlags.Pair + // |EPhysics2DDrawFlags.CenterOfMass + // |EPhysics2DDrawFlags.Joint + // |EPhysics2DDrawFlags.Shape; } /** 视图层逻辑代码分离演示 */ start () { this.sprite = this.node.getChildByName("avatar").getChildByName("TNode").getChildByName("bb").getComponent(Sprite); + this.orginalFlashMaterial = this.sprite.getRenderMaterial(0); + + + this.BoxRang = this.node.getChildByName("range_box"); + this.BoxRang.getComponent(BoxRangComp).box_group = this.box_group; + this.BoxRang.getComponent(BoxRangComp).offset_x = this.scale*SkillSet[this.skill_uuid].dis-30; + // console.log("monseter ",this.BoxRang); - this.orginalFlashMaterial = this.sprite.getRenderMaterial(0); // 注册单个碰撞体的回调函数 let collider = this.getComponent(Collider2D); collider.group = this.box_group; - this.BoxRang.box_group = this.box_group; - // console.log(collider); if (collider) { collider.on(Contact2DType.BEGIN_CONTACT, this.onBeginContact, this); collider.on(Contact2DType.END_CONTACT, this.onEndContact, this); @@ -102,9 +106,10 @@ export class MonsterViewComp extends CCComp { } onBeginContact (selfCollider: Collider2D, otherCollider: Collider2D, contact: IPhysics2DContact | null) { - + } onEndContact (selfCollider: Collider2D, otherCollider: Collider2D, contact: IPhysics2DContact | null) { + if(otherCollider.tag==BoxSet.SKILL_TAG &&selfCollider.tag!=BoxSet.SKILL_TAG){ if(selfCollider.group != otherCollider.group){ let skill = otherCollider.node.getComponent(SkillCom)!; @@ -135,17 +140,19 @@ export class MonsterViewComp extends CCComp { let self_pos=selfCollider.node.getPosition(); let other_pos=otherCollider.node.getPosition(); if(selfCollider.group == BoxSet.HERO){ - if(self_pos.x < other_pos.x&&Math.abs(self_pos.x-other_pos.x) <= 20){ + if(self_pos.x < other_pos.x&&Math.abs(self_pos.x-other_pos.x) <= 20&&self_pos.y==other_pos.y){ this.stop_cd=0.1 } } if(selfCollider.group == BoxSet.MONSTER){ - if(self_pos.x > other_pos.x&&Math.abs(self_pos.x-other_pos.x) <= 20){ + if(self_pos.x > other_pos.x&&Math.abs(self_pos.x-other_pos.x) <= 20&&self_pos.y==other_pos.y){ this.stop_cd=0.1 } } } + }else{ + // console.log('monster onPostSolve'+selfCollider.group+"|"+otherCollider.group); } @@ -172,15 +179,6 @@ export class MonsterViewComp extends CCComp { this.in_destroy(); this.in_stop(dt); this.in_act(dt); - switch (this.type) { - case 1: - this.as.walk(); - break; - case 2: - this.as.idle(); - break; - } - this.move(dt); // this.update_pos(); @@ -213,7 +211,7 @@ export class MonsterViewComp extends CCComp { this.node.getChildByName("power").getComponent(ProgressBar)!.progress = power_progress; } shoot(skill_uuid:number){ - console.log("monster shoot"); + // console.log("monster shoot"); let skill = ecs.getEntity(Skill); let x=0 let pos = v3(x,40) diff --git a/assets/script/game/heros.meta b/assets/script/game/player.meta similarity index 100% rename from assets/script/game/heros.meta rename to assets/script/game/player.meta diff --git a/assets/script/game/heros/Hero.ts b/assets/script/game/player/Hero.ts similarity index 100% rename from assets/script/game/heros/Hero.ts rename to assets/script/game/player/Hero.ts diff --git a/assets/script/game/heros/Hero.ts.meta b/assets/script/game/player/Hero.ts.meta similarity index 100% rename from assets/script/game/heros/Hero.ts.meta rename to assets/script/game/player/Hero.ts.meta diff --git a/assets/script/game/heros/HeroModelComp.ts b/assets/script/game/player/HeroModelComp.ts similarity index 100% rename from assets/script/game/heros/HeroModelComp.ts rename to assets/script/game/player/HeroModelComp.ts diff --git a/assets/script/game/heros/HeroModelComp.ts.meta b/assets/script/game/player/HeroModelComp.ts.meta similarity index 100% rename from assets/script/game/heros/HeroModelComp.ts.meta rename to assets/script/game/player/HeroModelComp.ts.meta diff --git a/assets/script/game/heros/HeroSpine.ts b/assets/script/game/player/HeroSpine.ts similarity index 100% rename from assets/script/game/heros/HeroSpine.ts rename to assets/script/game/player/HeroSpine.ts diff --git a/assets/script/game/heros/HeroSpine.ts.meta b/assets/script/game/player/HeroSpine.ts.meta similarity index 100% rename from assets/script/game/heros/HeroSpine.ts.meta rename to assets/script/game/player/HeroSpine.ts.meta diff --git a/assets/script/game/heros/HeroSpineAnimator.ts b/assets/script/game/player/HeroSpineAnimator.ts similarity index 100% rename from assets/script/game/heros/HeroSpineAnimator.ts rename to assets/script/game/player/HeroSpineAnimator.ts diff --git a/assets/script/game/heros/HeroSpineAnimator.ts.meta b/assets/script/game/player/HeroSpineAnimator.ts.meta similarity index 100% rename from assets/script/game/heros/HeroSpineAnimator.ts.meta rename to assets/script/game/player/HeroSpineAnimator.ts.meta diff --git a/assets/script/game/heros/HeroViewComp.ts b/assets/script/game/player/HeroViewComp.ts similarity index 100% rename from assets/script/game/heros/HeroViewComp.ts rename to assets/script/game/player/HeroViewComp.ts diff --git a/assets/script/game/heros/HeroViewComp.ts.meta b/assets/script/game/player/HeroViewComp.ts.meta similarity index 100% rename from assets/script/game/heros/HeroViewComp.ts.meta rename to assets/script/game/player/HeroViewComp.ts.meta diff --git a/assets/script/game/role.meta b/assets/script/game/role.meta deleted file mode 100644 index 81c855c3..00000000 --- a/assets/script/game/role.meta +++ /dev/null @@ -1,12 +0,0 @@ -{ - "ver": "1.2.0", - "importer": "directory", - "imported": true, - "uuid": "ffdd5a80-e057-4f91-92af-a86e1b26cbc6", - "files": [], - "subMetas": {}, - "userData": { - "compressionType": {}, - "isRemoteBundle": {} - } -} diff --git a/assets/script/game/role/Role.ts b/assets/script/game/role/Role.ts deleted file mode 100644 index eca7d1ba..00000000 --- a/assets/script/game/role/Role.ts +++ /dev/null @@ -1,58 +0,0 @@ - -/* - * @Author: dgflash - * @Date: 2021-11-18 17:47:56 - * @LastEditors: dgflash - * @LastEditTime: 2022-08-04 15:43:04 - */ -import { instantiate, Node, Prefab, Vec3 } from "cc"; -import { UICallbacks } from "../../../../extensions/oops-plugin-framework/assets/core/gui/layer/Defines"; -import { oops } from "../../../../extensions/oops-plugin-framework/assets/core/Oops"; -import { ecs } from "../../../../extensions/oops-plugin-framework/assets/libs/ecs/ECS"; -import { UIID } from "../common/config/GameUIConfig"; -import { smc } from "../common/SingletonModuleComp"; -import { RoleModelComp } from "./model/RoleModelComp"; -import { RoleSpine } from "./view/RoleSpine"; -import { RoleViewComp } from "./view/RoleViewComp"; - -/** 角色实体 */ -@ecs.register(`Role`) -export class Role extends ecs.Entity { - // 数据层 - RoleModel!: RoleModelComp; - // 视图层 - RoleView!: RoleViewComp; - - protected init() { - this.addComponents( - RoleModelComp); - } - - destroy(): void { - this.remove(RoleViewComp); - super.destroy(); - } - - /** 加载角色 */ - load(pos: Vec3 = Vec3.ZERO, isMonster: boolean = false,type:string = "monster",anim:string = "idle") { - console.log("load role type",type); - var path = "game/player/player"; - - var prefab: Prefab = oops.res.get(path, Prefab)!; - var node = instantiate(prefab); - var scene = smc.map.MapView.scene; - node.parent = scene.entityLayer!.node!; - var as = node.getComponent(RoleSpine); - as.play(anim, true); - node.setPosition(pos) - - var mv = node.getComponent(RoleViewComp)!; - this.add(mv); - - if (isMonster) { - node.setScale(-1, 1, 1); - } - } - - -} \ No newline at end of file diff --git a/assets/script/game/role/Role.ts.meta b/assets/script/game/role/Role.ts.meta deleted file mode 100644 index 75c56403..00000000 --- a/assets/script/game/role/Role.ts.meta +++ /dev/null @@ -1,9 +0,0 @@ -{ - "ver": "4.0.23", - "importer": "typescript", - "imported": true, - "uuid": "deb5a90b-5729-4a03-9f73-28ed96202f8a", - "files": [], - "subMetas": {}, - "userData": {} -} diff --git a/assets/script/game/role/RoleEvent.ts b/assets/script/game/role/RoleEvent.ts deleted file mode 100644 index 17753543..00000000 --- a/assets/script/game/role/RoleEvent.ts +++ /dev/null @@ -1,4 +0,0 @@ -/** 角色模块全局事件 */ -export enum RoleEvent { - -} \ No newline at end of file diff --git a/assets/script/game/role/RoleEvent.ts.meta b/assets/script/game/role/RoleEvent.ts.meta deleted file mode 100644 index b5a11a02..00000000 --- a/assets/script/game/role/RoleEvent.ts.meta +++ /dev/null @@ -1,9 +0,0 @@ -{ - "ver": "4.0.23", - "importer": "typescript", - "imported": true, - "uuid": "a2e7abd7-21aa-4dfc-ab5c-6dd0dfba2a7c", - "files": [], - "subMetas": {}, - "userData": {} -} diff --git a/assets/script/game/role/bll.meta b/assets/script/game/role/bll.meta deleted file mode 100644 index d54ce4a8..00000000 --- a/assets/script/game/role/bll.meta +++ /dev/null @@ -1,12 +0,0 @@ -{ - "ver": "1.2.0", - "importer": "directory", - "imported": true, - "uuid": "8164d96e-0467-4bd2-9123-8a490de8c68f", - "files": [], - "subMetas": {}, - "userData": { - "compressionType": {}, - "isRemoteBundle": {} - } -} diff --git a/assets/script/game/role/bll/RoleBattle.ts.meta b/assets/script/game/role/bll/RoleBattle.ts.meta deleted file mode 100644 index a97ff52b..00000000 --- a/assets/script/game/role/bll/RoleBattle.ts.meta +++ /dev/null @@ -1,9 +0,0 @@ -{ - "ver": "4.0.23", - "importer": "typescript", - "imported": true, - "uuid": "5130ca90-66bd-4c87-8db9-f9f847396454", - "files": [], - "subMetas": {}, - "userData": {} -} diff --git a/assets/script/game/role/bll/action.meta b/assets/script/game/role/bll/action.meta deleted file mode 100644 index b40adbd7..00000000 --- a/assets/script/game/role/bll/action.meta +++ /dev/null @@ -1,12 +0,0 @@ -{ - "ver": "1.1.0", - "importer": "directory", - "imported": true, - "uuid": "52966ec2-355b-4c89-a608-5d5f34ba8ae9", - "files": [], - "subMetas": {}, - "userData": { - "compressionType": {}, - "isRemoteBundle": {} - } -} diff --git a/assets/script/game/role/bll/ai.meta b/assets/script/game/role/bll/ai.meta deleted file mode 100644 index 686d13c0..00000000 --- a/assets/script/game/role/bll/ai.meta +++ /dev/null @@ -1,12 +0,0 @@ -{ - "ver": "1.1.0", - "importer": "directory", - "imported": true, - "uuid": "7bde0e45-7d4e-4cf5-b0ce-f8b6a5ca4d12", - "files": [], - "subMetas": {}, - "userData": { - "compressionType": {}, - "isRemoteBundle": {} - } -} diff --git a/assets/script/game/role/bll/skill.meta b/assets/script/game/role/bll/skill.meta deleted file mode 100644 index 5d8ef1c0..00000000 --- a/assets/script/game/role/bll/skill.meta +++ /dev/null @@ -1,12 +0,0 @@ -{ - "ver": "1.1.0", - "importer": "directory", - "imported": true, - "uuid": "20fb6abb-3b0e-4361-8200-941b98891456", - "files": [], - "subMetas": {}, - "userData": { - "compressionType": {}, - "isRemoteBundle": {} - } -} diff --git a/assets/script/game/role/model.meta b/assets/script/game/role/model.meta deleted file mode 100644 index d331bd09..00000000 --- a/assets/script/game/role/model.meta +++ /dev/null @@ -1,12 +0,0 @@ -{ - "ver": "1.2.0", - "importer": "directory", - "imported": true, - "uuid": "3fba28ee-42f7-4be0-a42d-776301b37fbc", - "files": [], - "subMetas": {}, - "userData": { - "compressionType": {}, - "isRemoteBundle": {} - } -} diff --git a/assets/script/game/role/model/RoleCharacteristicModelComp.ts.meta b/assets/script/game/role/model/RoleCharacteristicModelComp.ts.meta deleted file mode 100644 index 1e03b14c..00000000 --- a/assets/script/game/role/model/RoleCharacteristicModelComp.ts.meta +++ /dev/null @@ -1,9 +0,0 @@ -{ - "ver": "4.0.23", - "importer": "typescript", - "imported": true, - "uuid": "2fc06e2a-6834-4ce6-9a7b-96eae66f0abe", - "files": [], - "subMetas": {}, - "userData": {} -} diff --git a/assets/script/game/role/model/RoleDescentModelComp.ts.meta b/assets/script/game/role/model/RoleDescentModelComp.ts.meta deleted file mode 100644 index 984f6412..00000000 --- a/assets/script/game/role/model/RoleDescentModelComp.ts.meta +++ /dev/null @@ -1,9 +0,0 @@ -{ - "ver": "4.0.23", - "importer": "typescript", - "imported": true, - "uuid": "d299c6b5-6424-4c27-ab35-013e8ad0c433", - "files": [], - "subMetas": {}, - "userData": {} -} diff --git a/assets/script/game/role/model/RoleDrawSixModelComp.ts.meta b/assets/script/game/role/model/RoleDrawSixModelComp.ts.meta deleted file mode 100644 index ea526520..00000000 --- a/assets/script/game/role/model/RoleDrawSixModelComp.ts.meta +++ /dev/null @@ -1,9 +0,0 @@ -{ - "ver": "4.0.23", - "importer": "typescript", - "imported": true, - "uuid": "1ca33287-9c39-44a8-b8dd-c6e0c21dd8a7", - "files": [], - "subMetas": {}, - "userData": {} -} diff --git a/assets/script/game/role/model/RoleEnum.ts b/assets/script/game/role/model/RoleEnum.ts deleted file mode 100644 index dd43cdf6..00000000 --- a/assets/script/game/role/model/RoleEnum.ts +++ /dev/null @@ -1,18 +0,0 @@ -/* - * @Author: dgflash - * @Date: 2022-01-26 14:14:34 - * @LastEditors: dgflash - * @LastEditTime: 2022-01-27 15:49:36 - */ - -/** 角色动作名 */ -export enum RoleAnimatorType { - /** 待机 */ - idle = "idle", - /** 攻击 */ - act1 = "act1", - /** 受击 */ - magic1 = "magic1", - /** 死亡 */ - move = "move" -} \ No newline at end of file diff --git a/assets/script/game/role/model/RoleEnum.ts.meta b/assets/script/game/role/model/RoleEnum.ts.meta deleted file mode 100644 index 6d2f23b4..00000000 --- a/assets/script/game/role/model/RoleEnum.ts.meta +++ /dev/null @@ -1,9 +0,0 @@ -{ - "ver": "4.0.23", - "importer": "typescript", - "imported": true, - "uuid": "a8fd6149-fa4b-4b2c-83c0-c08b3813b9f7", - "files": [], - "subMetas": {}, - "userData": {} -} diff --git a/assets/script/game/role/model/RoleEquipModelComp.ts.meta b/assets/script/game/role/model/RoleEquipModelComp.ts.meta deleted file mode 100644 index 6f02d738..00000000 --- a/assets/script/game/role/model/RoleEquipModelComp.ts.meta +++ /dev/null @@ -1,9 +0,0 @@ -{ - "ver": "4.0.23", - "importer": "typescript", - "imported": true, - "uuid": "5c21f8a7-8fd1-4845-a777-a2e03256526b", - "files": [], - "subMetas": {}, - "userData": {} -} diff --git a/assets/script/game/role/model/RoleFamilyModelComp.ts.meta b/assets/script/game/role/model/RoleFamilyModelComp.ts.meta deleted file mode 100644 index 1cfe2004..00000000 --- a/assets/script/game/role/model/RoleFamilyModelComp.ts.meta +++ /dev/null @@ -1,9 +0,0 @@ -{ - "ver": "4.0.23", - "importer": "typescript", - "imported": true, - "uuid": "b53c6b75-188b-46ae-93a9-4c1ecd6009c8", - "files": [], - "subMetas": {}, - "userData": {} -} diff --git a/assets/script/game/role/model/RoleModelComp.ts b/assets/script/game/role/model/RoleModelComp.ts deleted file mode 100644 index 50719420..00000000 --- a/assets/script/game/role/model/RoleModelComp.ts +++ /dev/null @@ -1,27 +0,0 @@ -/* - * @Author: dgflash - * @Date: 2021-11-18 15:56:01 - * @LastEditors: dgflash - * @LastEditTime: 2022-08-17 13:43:25 - */ -import { ecs } from "../../../../../extensions/oops-plugin-framework/assets/libs/ecs/ECS"; - -/** - * 角色属性数据 - */ -@ecs.register('RoleModel') -export class RoleModelComp extends ecs.Comp { - /** 角色编号 */ - id: number = -1; - - /** 角色名 */ - name: string = "oops-framework"; - - /** 动画名资源 */ - anim: string = "model1"; - - reset() { - this.id = -1; - this.name = ""; - } -} diff --git a/assets/script/game/role/model/RoleModelComp.ts.meta b/assets/script/game/role/model/RoleModelComp.ts.meta deleted file mode 100644 index 72141302..00000000 --- a/assets/script/game/role/model/RoleModelComp.ts.meta +++ /dev/null @@ -1,9 +0,0 @@ -{ - "ver": "4.0.23", - "importer": "typescript", - "imported": true, - "uuid": "0b31330a-261d-4b13-a0d5-15d2727b1dbd", - "files": [], - "subMetas": {}, - "userData": {} -} diff --git a/assets/script/game/role/model/RoleNobilityModelComp.ts.meta b/assets/script/game/role/model/RoleNobilityModelComp.ts.meta deleted file mode 100644 index 701046a4..00000000 --- a/assets/script/game/role/model/RoleNobilityModelComp.ts.meta +++ /dev/null @@ -1,9 +0,0 @@ -{ - "ver": "4.0.23", - "importer": "typescript", - "imported": true, - "uuid": "58956230-0127-4793-ad43-621ceedb7d25", - "files": [], - "subMetas": {}, - "userData": {} -} diff --git a/assets/script/game/role/model/RoleSkillModelComp.ts.meta b/assets/script/game/role/model/RoleSkillModelComp.ts.meta deleted file mode 100644 index ab12c604..00000000 --- a/assets/script/game/role/model/RoleSkillModelComp.ts.meta +++ /dev/null @@ -1,9 +0,0 @@ -{ - "ver": "4.0.23", - "importer": "typescript", - "imported": true, - "uuid": "25e1a634-f8fe-44ca-9650-0d287532b566", - "files": [], - "subMetas": {}, - "userData": {} -} diff --git a/assets/script/game/role/view.meta b/assets/script/game/role/view.meta deleted file mode 100644 index 07449276..00000000 --- a/assets/script/game/role/view.meta +++ /dev/null @@ -1,12 +0,0 @@ -{ - "ver": "1.2.0", - "importer": "directory", - "imported": true, - "uuid": "b6c9dfb2-45d4-485c-8d0e-55a7f98e324e", - "files": [], - "subMetas": {}, - "userData": { - "compressionType": {}, - "isRemoteBundle": {} - } -} diff --git a/assets/script/game/role/view/AnimationEventHandler.ts.meta b/assets/script/game/role/view/AnimationEventHandler.ts.meta deleted file mode 100644 index e9648d29..00000000 --- a/assets/script/game/role/view/AnimationEventHandler.ts.meta +++ /dev/null @@ -1,9 +0,0 @@ -{ - "ver": "4.0.23", - "importer": "typescript", - "imported": true, - "uuid": "71fe316b-1691-4a24-b0b8-8c6e88938401", - "files": [], - "subMetas": {}, - "userData": {} -} diff --git a/assets/script/game/role/view/RoleSpine.ts b/assets/script/game/role/view/RoleSpine.ts deleted file mode 100644 index f332b7fa..00000000 --- a/assets/script/game/role/view/RoleSpine.ts +++ /dev/null @@ -1,74 +0,0 @@ -/* - * @Author: dgflash - * @Date: 2022-08-04 15:08:35 - * @LastEditors: dgflash - * @LastEditTime: 2022-08-04 15:26:26 - */ -import { Color, Component, EventTouch, sp, Vec3, _decorator } from "cc"; -import { LayerUtil } from "../../../../../extensions/oops-plugin-framework/assets/core/utils/LayerUtil"; -import { smc } from "../../common/SingletonModuleComp"; -import RoleSpineAnimator from "./RoleSpineAnimator"; - -const { ccclass, property } = _decorator; - -/** - * RPG SPINE角色模型 - */ -@ccclass('RoleSpine') -export class RoleSpine extends Component { - @property({ type: RoleSpineAnimator, tooltip: '动画控制器' }) - animator: RoleSpineAnimator = null!; - - private spine!: sp.Skeleton; - - onLoad() { - // 角色控制组件 - - this.initAnimator(); - // this.setSkin("magic"); - // this.animator.play("idle", true); - LayerUtil.setNodeLayer(LayerUtil.MAP, this.node); - } - - /** 初始化动画 */ - protected initAnimator() { - this.spine = this.animator.getComponent(sp.Skeleton)!; - } - - - - atk() { - this.spine.setAnimation(0, "atk", false); - } - magic(){ - this.spine.setAnimation(0, "magic", false); - } - - setSkin(value: string): void { - console.log("RoleSpine setSkin", value); - this.spine.setSkin(value); - } - play(animName: string, loop: boolean): void { - this.spine.setAnimation(0, animName, loop); - } - setAlpha(value: number): void { - var color: Color = this.spine.color; - color.a = 255 * (value / 1); - this.spine.color = color; - } - - - - - onDestroy() { - this.node.destroy(); - } - - walk() { - - } - - idle() { - - } -} diff --git a/assets/script/game/role/view/RoleSpine.ts.meta b/assets/script/game/role/view/RoleSpine.ts.meta deleted file mode 100644 index 48a2149c..00000000 --- a/assets/script/game/role/view/RoleSpine.ts.meta +++ /dev/null @@ -1,9 +0,0 @@ -{ - "ver": "4.0.23", - "importer": "typescript", - "imported": true, - "uuid": "9b5610bf-dad3-4695-bb64-92006701ea56", - "files": [], - "subMetas": {}, - "userData": {} -} diff --git a/assets/script/game/role/view/RoleSpineAnimator.ts b/assets/script/game/role/view/RoleSpineAnimator.ts deleted file mode 100644 index 8c811f6d..00000000 --- a/assets/script/game/role/view/RoleSpineAnimator.ts +++ /dev/null @@ -1,71 +0,0 @@ -/* - * @Author: dgflash - * @Date: 2022-08-04 15:08:35 - * @LastEditors: dgflash - * @LastEditTime: 2022-08-04 15:26:38 - */ -import { sp, _decorator ,Component} from "cc"; -import { smc } from "../../common/SingletonModuleComp"; - -const { ccclass, property, requireComponent, disallowMultiple } = _decorator; - -/** - * Spine状态机组件(主状态机),trackIndex为0 - */ -@ccclass -@disallowMultiple -@requireComponent(sp.Skeleton) -export default class RoleSpineAnimator extends Component { - private animName: string = "move"; - private loop: boolean = true; - private spine!: sp.Skeleton; - mixTime:number= 0.2; - - protected onLoad(): void { - this.spine = this.getComponent(sp.Skeleton)!; - this.spine.setEndListener(trackEntry => { - var animationName = trackEntry.animation ? trackEntry.animation.name : ""; - // console.log("[track %s][animation %s] end.", trackEntry.trackIndex, animationName); - if (animationName == "atk"||animationName == "magic") { - this.spine.setAnimation(0, "move", true); - } - }); - } - start() { - this.spine = this.getComponent(sp.Skeleton)!; - this.playAnimation(this.animName, this.loop); - - } - - lateUpdate(dt: number) { - - } - - play(animName: string, loop: boolean) { - if (animName) { - this.animName = animName; - this.loop = loop; - this.spine.setAnimation(0, this.animName, this.loop); - } - else { - } - } - /** - * 播放动画 - * @override - * @param animName 动画名 - * @param loop 是否循环播放 - */ - protected playAnimation(animName: string, loop: boolean) { - console.log("RoleSpineAnimator playAnimation"); - if (animName) { - console.log("RoleSpineAnimator playAnimation animName", animName); - this.animName = animName; - this.loop = loop; - this.spine.setAnimation(0, this.animName, this.loop); - } - else { - } - } - -} \ No newline at end of file diff --git a/assets/script/game/role/view/RoleSpineAnimator.ts.meta b/assets/script/game/role/view/RoleSpineAnimator.ts.meta deleted file mode 100644 index cf04108c..00000000 --- a/assets/script/game/role/view/RoleSpineAnimator.ts.meta +++ /dev/null @@ -1,9 +0,0 @@ -{ - "ver": "4.0.23", - "importer": "typescript", - "imported": true, - "uuid": "eb846c27-0bd3-4d9c-8261-e6ed8ac379a3", - "files": [], - "subMetas": {}, - "userData": {} -} diff --git a/assets/script/game/role/view/RoleStateAttack.ts.meta b/assets/script/game/role/view/RoleStateAttack.ts.meta deleted file mode 100644 index 1e937281..00000000 --- a/assets/script/game/role/view/RoleStateAttack.ts.meta +++ /dev/null @@ -1,9 +0,0 @@ -{ - "ver": "4.0.23", - "importer": "typescript", - "imported": true, - "uuid": "6842e219-fc64-4f36-94ad-5874aa08735f", - "files": [], - "subMetas": {}, - "userData": {} -} diff --git a/assets/script/game/role/view/RoleStateDead.ts.meta b/assets/script/game/role/view/RoleStateDead.ts.meta deleted file mode 100644 index b9d34d3a..00000000 --- a/assets/script/game/role/view/RoleStateDead.ts.meta +++ /dev/null @@ -1,9 +0,0 @@ -{ - "ver": "4.0.23", - "importer": "typescript", - "imported": true, - "uuid": "95fb600c-f0c6-4720-94da-b222ff2a3574", - "files": [], - "subMetas": {}, - "userData": {} -} diff --git a/assets/script/game/role/view/RoleStateHit.ts.meta b/assets/script/game/role/view/RoleStateHit.ts.meta deleted file mode 100644 index 5b67b826..00000000 --- a/assets/script/game/role/view/RoleStateHit.ts.meta +++ /dev/null @@ -1,9 +0,0 @@ -{ - "ver": "4.0.23", - "importer": "typescript", - "imported": true, - "uuid": "495b1f8f-d6a5-48bb-9a8c-4ed84361f127", - "files": [], - "subMetas": {}, - "userData": {} -} diff --git a/assets/script/game/role/view/RoleViewComp.ts b/assets/script/game/role/view/RoleViewComp.ts deleted file mode 100644 index 10023b40..00000000 --- a/assets/script/game/role/view/RoleViewComp.ts +++ /dev/null @@ -1,113 +0,0 @@ -/* - * @Author: dgflash - * @Date: 2021-11-18 17:42:59 - * @LastEditors: dgflash - * @LastEditTime: 2022-08-17 12:36:18 - */ - -import { Vec3, _decorator ,v3,Collider2D,Contact2DType,IPhysics2DContact,Prefab,instantiate} from "cc"; -import { ecs } from "../../../../../extensions/oops-plugin-framework/assets/libs/ecs/ECS"; -import { CCComp } from "../../../../../extensions/oops-plugin-framework/assets/module/common/CCComp"; -import { RoleSpine } from "./RoleSpine"; -import { BoxSet } from "../../common/config/BoxSet"; -import { smc } from "../../common/SingletonModuleComp"; -import { oops } from "../../../../../extensions/oops-plugin-framework/assets/core/Oops"; -import { Timer } from "../../../../../extensions/oops-plugin-framework/assets/core/common/timer/Timer"; -import { SkillCom } from "../../skills/SkillCom"; -import { Skill } from "../../skills/Skill"; -const { ccclass, property } = _decorator; - -/** 角色显示组件 */ -@ccclass('RoleViewComp') // 定义为 Cocos Creator 组件 -@ecs.register('RoleView', false) // 定义为 ECS 组件 -export class RoleViewComp extends CCComp { - as: RoleSpine = null!; - hero_uuid:string = 'h001'; - hero_name : string = "hero"; - level:number =1; - state: number = 1; /** 状态 1:move ,2: act 3: stop */ - - hp: number = 100; /** 血量 */ - hp_max: number = 100; /** 最大血量 */ - hp_speed: number = 0; //回复速度 - - power: number = 0; /**能量**/ - power_max: number = 100; /** 能量最大值 */ - power_speed: number = 1; //能量回复速度每0.1秒回复量 - - skill_name: string = "base"; //技能名称 - max_skill_name: string = "base"; //大技能名称 - - atk: number = 2; /**攻击力 */ - // atk_speed: number = 1; - atk_cd: number = 2; /**攻击速度 攻击间隔 */ - atk_time: number = 0; /** 冷却时间 */ - - stop_cd: number = 0; /*停止倒计时*/ - - is_dead:boolean = false; //是否摧毁 - shield:number = 0; //护盾量 - shield_time:number = 0; //护盾持续时间 - - private timer:Timer = new Timer(0.1); //计时器 - onLoad() { - this.as = this.getComponent(RoleSpine); - } - protected start(): void { - let collider = this.getComponent(Collider2D); - if (collider) { - collider.on(Contact2DType.BEGIN_CONTACT, this.onBeginContact, this); - collider.on(Contact2DType.END_CONTACT, this.onEndContact, this); - collider.on(Contact2DType.POST_SOLVE, this.onPostSolve, this); - } - } - onBeginContact (selfCollider: Collider2D, otherCollider: Collider2D, contact: IPhysics2DContact | null) { - } - onEndContact (selfCollider: Collider2D, otherCollider: Collider2D, contact: IPhysics2DContact | null) { - // 只在两个碰撞体结束接触时被调用一次 - } - onPostSolve (selfCollider: Collider2D, otherCollider: Collider2D, contact: IPhysics2DContact | null) { - if(otherCollider.group== BoxSet.HERO_SKILL || otherCollider.group== BoxSet.MONSTER_SKILL){ - let skill = otherCollider.node.getComponent(SkillCom)!; - // console.log('onPostSolve',skill); - this.in_atked(); - // this.hp_change(skill.atk); - } - } - update(dt: number){ - if (this.timer.update(dt)) { - - } - this.in_act(dt); - - } - in_act(dt: number) { - if(this.atk_time >= this.atk_cd){ - this.atk_time = 0; - // console.log("atk_cd:"+this.atk_cd); - this.as.atk(); - this.load_skill(this.skill_name); - } - - this.atk_time += dt; - } - load_skill(skill_name:string){ - // let skill = ecs.getEntity(Skill); - // let pos = v3(30,30) - // let speed =400 - // let scale = 1 - // let range = 720 - // skill.load(pos,speed,range,scale,this.node,skill_name,this.atk); - } - in_atked() { - var path = "game/skills/atked"; - var prefab: Prefab = oops.res.get(path, Prefab)!; - var node = instantiate(prefab); - let pos = v3(0,30) - node.setPosition(pos) - node.parent = this.node; - } - reset() { - this.node.destroy(); - } -} \ No newline at end of file diff --git a/assets/script/game/role/view/RoleViewComp.ts.meta b/assets/script/game/role/view/RoleViewComp.ts.meta deleted file mode 100644 index 2f0209f3..00000000 --- a/assets/script/game/role/view/RoleViewComp.ts.meta +++ /dev/null @@ -1,9 +0,0 @@ -{ - "ver": "4.0.23", - "importer": "typescript", - "imported": true, - "uuid": "60726b1a-adbb-480c-97cb-2c4fbbe7228b", - "files": [], - "subMetas": {}, - "userData": {} -} diff --git a/assets/script/game/role/view/RoleViewOwn.ts b/assets/script/game/role/view/RoleViewOwn.ts deleted file mode 100644 index 7dc40dbb..00000000 --- a/assets/script/game/role/view/RoleViewOwn.ts +++ /dev/null @@ -1,30 +0,0 @@ -/* - * @Author: dgflash - * @Date: 2022-08-04 15:08:35 - * @LastEditors: dgflash - * @LastEditTime: 2022-08-04 15:28:02 - */ - -import { Component, v3, _decorator } from "cc"; -import { smc } from "../../common/SingletonModuleComp"; -import MapRoadUtils from "../../map/view/map/road/MapRoadUtils"; - -const { ccclass, property } = _decorator; - -@ccclass('RoleViewOwn') -export class RoleViewOwn extends Component { - - onLoad() { - - } - - - - private aStarToVec3(str: string) { - let array = str.split(","); - let x = parseInt(array[0]); - let y = parseInt(array[1]); - let p = MapRoadUtils.instance.getPixelByDerect(x, y); - return v3(p.x, p.y); - } -} diff --git a/assets/script/game/role/view/RoleViewOwn.ts.meta b/assets/script/game/role/view/RoleViewOwn.ts.meta deleted file mode 100644 index b6f182ab..00000000 --- a/assets/script/game/role/view/RoleViewOwn.ts.meta +++ /dev/null @@ -1,9 +0,0 @@ -{ - "ver": "4.0.23", - "importer": "typescript", - "imported": true, - "uuid": "dce416c5-4d4c-4ccd-b79f-ebdcf9bd0ddc", - "files": [], - "subMetas": {}, - "userData": {} -} diff --git a/assets/script/game/role/view/RoleViewUIControllerComp.ts b/assets/script/game/role/view/RoleViewUIControllerComp.ts deleted file mode 100644 index d57b3615..00000000 --- a/assets/script/game/role/view/RoleViewUIControllerComp.ts +++ /dev/null @@ -1,34 +0,0 @@ -/* - * @Author: dgflash - * @Date: 2022-02-12 13:38:13 - * @LastEditors: dgflash - * @LastEditTime: 2022-08-17 12:36:31 - */ - -import { EventTouch, Vec3, _decorator } from 'cc'; -import { ecs } from '../../../../../extensions/oops-plugin-framework/assets/libs/ecs/ECS'; -import { CCComp } from '../../../../../extensions/oops-plugin-framework/assets/module/common/CCComp'; -import { smc } from '../../common/SingletonModuleComp'; -// import { Role } from '../Role'; - -const { ccclass, property } = _decorator; - -@ccclass("RoleViewUIControllerComp") -@ecs.register('RoleViewUIController', false) -export class RoleViewUIControllerComp extends CCComp { - - // private target: Role = null!; - - start() { - // this.target = smc.own; - } - - onDestroy() { - this.ent.remove(RoleViewUIControllerComp); - super.onDestroy(); - } - - reset(): void { - - } -} \ No newline at end of file diff --git a/assets/script/game/role/view/RoleViewUIControllerComp.ts.meta b/assets/script/game/role/view/RoleViewUIControllerComp.ts.meta deleted file mode 100644 index 3654c234..00000000 --- a/assets/script/game/role/view/RoleViewUIControllerComp.ts.meta +++ /dev/null @@ -1,9 +0,0 @@ -{ - "ver": "4.0.23", - "importer": "typescript", - "imported": true, - "uuid": "adad65c3-b462-4ea5-8d65-060a5f2de25d", - "files": [], - "subMetas": {}, - "userData": {} -} diff --git a/assets/script/game/role/view/RoleViewUIJoystick.ts b/assets/script/game/role/view/RoleViewUIJoystick.ts deleted file mode 100644 index b47ecab7..00000000 --- a/assets/script/game/role/view/RoleViewUIJoystick.ts +++ /dev/null @@ -1,250 +0,0 @@ -import { CCFloat, Component, Enum, error, EventTouch, macro, Node, UIOpacity, UITransform, Vec2, Vec3, _decorator } from "cc"; -import { Vec3Util } from "../../../../../extensions/oops-plugin-framework/assets/core/utils/Vec3Util"; - -const { ccclass, property } = _decorator; - -/** - * 方向类型 - */ -export enum DirectionType { - FOUR, - EIGHT, - ALL, -} - -/** - * 速度类型 - */ -export enum SpeedType { - Start, - STOP, - NORMAL, - FAST, -} - -/** - * 摇杆类型 - */ -export enum JoystickType { - FIXED, - FOLLOW, -} - -export interface JoystickDataType { - /** 速度类型 */ - type: SpeedType; - - /** 移动向量 */ - vector: Vec3; - - /** 角度 */ - angle: number; -} - - -export type ControllerFunc = (event: EventTouch, data: JoystickDataType) => void; - -/** 摇杆 */ -@ccclass("RoleViewUIJoystick") -export class RoleViewUIJoystick extends Component { - @property({ - type: Node, - tooltip: "摇杆操纵点", - }) - dot: Node | null = null; - - @property({ - type: Node, - tooltip: "摇杆背景节点", - }) - ring: Node | null = null; - - @property({ - type: Enum(JoystickType), - tooltip: "触摸类型", - }) - joystickType = JoystickType.FIXED; - - @property({ - type: Enum(DirectionType), - tooltip: "方向类型", - }) - directionType = DirectionType.ALL; - - @property({ - tooltip: "摇杆所在位置" - }) - _stickPos = new Vec3(); - - @property({ - tooltip: "触摸位置" - }) - _touchLocation = new Vec2(); - - @property({ - type: CCFloat, - tooltip: "摇杆背景半径" - }) - radius = -1; - - onController: ControllerFunc | null = null; - - onLoad() { - if (!this.dot) { - error("Joystick Dot is null!"); - return; - } - - if (!this.ring) { - error("Joystick Ring is null!"); - return; - } - - // 摇杆背景半径 - if (this.radius == -1) - this.radius = this.ring.getComponent(UITransform)!.width / 2; - - // 摇杆跟随跟随时默认隐藏界面 - const uiOpacity = this.node.getComponent(UIOpacity); - if (this.joystickType === JoystickType.FOLLOW && uiOpacity) { - uiOpacity.opacity = 0; - } - - this._initTouchEvent(); - } - - /** - * 改变摇杆类型 - * @param type - */ - setJoystickType(type: JoystickType) { - this.joystickType = type; - const uiOpacity = this.node.getComponent(UIOpacity); - if (uiOpacity) { - uiOpacity.opacity = type === JoystickType.FIXED ? 255 : 0; - } - } - - /** - * 初始化触摸事件 - */ - private _initTouchEvent() { - this.node.on(Node.EventType.TOUCH_START, this._touchStartEvent, this); - this.node.on(Node.EventType.TOUCH_MOVE, this._touchMoveEvent, this); - this.node.on(Node.EventType.TOUCH_END, this._touchEndEvent, this); - this.node.on(Node.EventType.TOUCH_CANCEL, this._touchEndEvent, this); - } - - /** - * 触摸开始回调函数 - * @param event - */ - private _touchStartEvent(event: EventTouch) { - if (!this.ring || !this.dot) return; - - if (this.onController) { - this.onController(event, { - type: SpeedType.Start, - vector: Vec3Util.zero, - angle: 0 - }); - } - - const location = event.getUILocation(); - const touchPos = new Vec3(location.x, location.y); - - if (this.joystickType === JoystickType.FIXED) { - this._stickPos = this.ring.getWorldPosition(); - - // 相对中心的向量 - const moveVec = touchPos.subtract(this.ring.getWorldPosition()); - // 触摸点与圆圈中心的距离 - const distance = moveVec.length(); - - // 手指在圆圈内触摸,控杆跟随触摸点 - if (this.radius > distance) { - this.dot.setPosition(moveVec); - } - } - else if (this.joystickType === JoystickType.FOLLOW) { - // 记录摇杆位置,给 touch move 使用 - this.node.getComponent(UIOpacity)!.opacity = 255; - this._stickPos = touchPos; - this._touchLocation = event.getUILocation(); - // 更改摇杆的位置 - - this.ring.setWorldPosition(touchPos); - this.dot.setPosition(Vec3.ZERO); - } - } - - /** - * 触摸移动回调函数 - * @param event - */ - private _touchMoveEvent(event: EventTouch) { - if (!this.dot || !this.ring) return; - - // 如果 touch start 位置和 touch move 相同,禁止移动 - if (this.joystickType === JoystickType.FOLLOW && this._touchLocation === event.getUILocation()) { - return false; - } - - // 以圆圈为锚点获取触摸坐标 - const location = event.getUILocation(); - const touchPos = new Vec3(location.x, location.y); - - // 移动向量 - const moveVec = touchPos.subtract(this.ring.getWorldPosition()); - const distance = moveVec.length(); - - let speedType = SpeedType.NORMAL; - if (this.radius > distance) { - this.dot.setPosition(moveVec); - speedType = SpeedType.NORMAL; - } - else { - // 控杆永远保持在圈内,并在圈内跟随触摸更新角度 - this.dot.setPosition(moveVec.normalize().multiplyScalar(this.radius)); - speedType = SpeedType.FAST; - } - - // 算出与(1,0)的夹角 - let angle = this.covertToAngle(moveVec); - - if (this.onController) { - this.onController(event, { - type: speedType, - vector: moveVec.normalize(), - angle - }); - } - } - - /** 根据位置转化角度 */ - private covertToAngle(pos: Vec3) { - let angle = Math.atan2(pos.y, pos.x); - return angle * macro.DEG; - } - - /** - * 触摸结束回调函数 - * @param event - */ - private _touchEndEvent(event: EventTouch) { - if (!this.dot || !this.ring) return; - - this.dot.setPosition(new Vec3()); - if (this.joystickType === JoystickType.FOLLOW) { - this.node.getComponent(UIOpacity)!.opacity = 0; - } - - if (this.onController) { - this.onController(event, { - type: SpeedType.STOP, - vector: Vec3Util.zero, - angle: 0 - }); - } - } -} diff --git a/assets/script/game/role/view/RoleViewUIJoystick.ts.meta b/assets/script/game/role/view/RoleViewUIJoystick.ts.meta deleted file mode 100644 index 4a9e6d74..00000000 --- a/assets/script/game/role/view/RoleViewUIJoystick.ts.meta +++ /dev/null @@ -1,9 +0,0 @@ -{ - "ver": "4.0.23", - "importer": "typescript", - "imported": true, - "uuid": "472d9967-6ca2-4293-b18d-b056a5a82fec", - "files": [], - "subMetas": {}, - "userData": {} -} diff --git a/assets/script/game/role/view/component.meta b/assets/script/game/role/view/component.meta deleted file mode 100644 index 50b7e3f4..00000000 --- a/assets/script/game/role/view/component.meta +++ /dev/null @@ -1,12 +0,0 @@ -{ - "ver": "1.1.0", - "importer": "directory", - "imported": true, - "uuid": "b3bb384b-5a96-4e00-a5f8-29bd621bdf99", - "files": [], - "subMetas": {}, - "userData": { - "compressionType": {}, - "isRemoteBundle": {} - } -} diff --git a/assets/script/game/skills/SkillCom.ts b/assets/script/game/skills/SkillCom.ts index 516259fc..e3c54ea9 100644 --- a/assets/script/game/skills/SkillCom.ts +++ b/assets/script/game/skills/SkillCom.ts @@ -3,6 +3,7 @@ import { ecs } from "../../../../extensions/oops-plugin-framework/assets/libs/ec import { CCComp } from "../../../../extensions/oops-plugin-framework/assets/module/common/CCComp"; import { BoxSet } from "../common/config/BoxSet"; import { smc } from "../common/SingletonModuleComp"; +import { Timer } from "../../../../extensions/oops-plugin-framework/assets/core/common/timer/Timer"; const { ccclass, property } = _decorator; @@ -26,6 +27,7 @@ export class SkillCom extends CCComp { is_destroy:boolean = false; box_group:number = 0; box_tag:number=0; + time:Timer = new Timer(0.01); start() { this.node.active=true this.node.angle = this.angle; @@ -45,12 +47,10 @@ export class SkillCom extends CCComp { tween(this.node).to( 1,{ angle:this.angle,position: this.t_pos}, { onUpdate: (target: Vec3, ratio: number) => { // onUpdate 接受当前缓动的进度 - if(target.y <= 200 ){ - this.toDestroy() - } // 将缓动系统计算出的结果赋予 node 的位置 + // 将缓动系统计算出的结果赋予 node 的位置 }, onComplete: (target?: object) => { - this.toDestroy() + this.is_destroy=true }, } ).start(); @@ -59,7 +59,7 @@ export class SkillCom extends CCComp { { position: new Vec3(this.node.position.x+this.scale*this.dis,this.node.position.y) }, { onComplete: (target?: object) => { - this.toDestroy() + this.is_destroy=true }, } ).start(); @@ -68,10 +68,8 @@ export class SkillCom extends CCComp { } onEndContact (selfCollider: Collider2D, otherCollider: Collider2D, contact: IPhysics2DContact | null) { if(otherCollider.group != selfCollider.group){ - console.log("skill end contact",selfCollider.group,otherCollider.group) - setTimeout(() => { - this.toDestroy() - }, 10); + // console.log("skill end contact",selfCollider.group,otherCollider.group) + this.is_destroy=true } } onPostSolve (selfCollider: Collider2D, otherCollider: Collider2D, contact: IPhysics2DContact | null) { @@ -104,24 +102,18 @@ export class SkillCom extends CCComp { update(deltaTime: number) { // this.node.setScale(v3(this.scale,this.node.scale.y,this.node.scale.z)) // this.move(deltaTime) - - + this.toDestroy() } move(dt: number) { // this.node.setPosition(v3(this.node.position.x+dt*this.x_speed*this.scale,this.node.position.y+this.y_speed,this.node.position.z)) } - check_to_destroy(){ - if(!this.is_destroy){ - this.is_destroy = true; - this.toDestroy(); - } - } + toDestroy() { - if(!this.is_destroy){ - this.is_destroy = true; + if(this.is_destroy){ if(this.node.isValid) this.ent.destroy() } } + /** 视图对象通过 ecs.Entity.remove(ModuleViewComp) 删除组件是触发组件处理自定义释放逻辑 */ reset() { this.is_destroy=false