diff --git a/assets/resources/game/gui/hui.prefab b/assets/resources/game/gui/hui.prefab new file mode 100644 index 00000000..11e3a7bf --- /dev/null +++ b/assets/resources/game/gui/hui.prefab @@ -0,0 +1,210 @@ +[ + { + "__type__": "cc.Prefab", + "_name": "hui", + "_objFlags": 0, + "__editorExtras__": {}, + "_native": "", + "data": { + "__id__": 1 + }, + "optimizationPolicy": 0, + "persistent": false + }, + { + "__type__": "cc.Node", + "_name": "hui", + "_objFlags": 0, + "__editorExtras__": {}, + "_parent": null, + "_children": [], + "_active": true, + "_components": [ + { + "__id__": 2 + }, + { + "__id__": 4 + }, + { + "__id__": 6 + }, + { + "__id__": 8 + } + ], + "_prefab": { + "__id__": 10 + }, + "_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": -0.8, + "y": 0.8, + "z": 1 + }, + "_mobility": 0, + "_layer": 1073741824, + "_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": 256, + "height": 256 + }, + "_anchorPoint": { + "__type__": "cc.Vec2", + "x": 0.5, + "y": 0 + }, + "_id": "" + }, + { + "__type__": "cc.CompPrefabInfo", + "fileId": "cewibQgK1ALbFhMuuspMmN" + }, + { + "__type__": "cc.Sprite", + "_name": "", + "_objFlags": 0, + "__editorExtras__": {}, + "node": { + "__id__": 1 + }, + "_enabled": true, + "__prefab": { + "__id__": 5 + }, + "_customMaterial": null, + "_srcBlendFactor": 2, + "_dstBlendFactor": 4, + "_color": { + "__type__": "cc.Color", + "r": 255, + "g": 255, + "b": 255, + "a": 255 + }, + "_spriteFrame": { + "__uuid__": "9e5ec114-01a4-47d3-b7b7-df3b90209c91@6ce90", + "__expectedType__": "cc.SpriteFrame" + }, + "_type": 0, + "_fillType": 0, + "_sizeMode": 1, + "_fillCenter": { + "__type__": "cc.Vec2", + "x": 0, + "y": 0 + }, + "_fillStart": 0, + "_fillRange": 0, + "_isTrimmedMode": true, + "_useGrayscale": false, + "_atlas": null, + "_id": "" + }, + { + "__type__": "cc.CompPrefabInfo", + "fileId": "ed71tIQFtJtbSwrQYOmOPP" + }, + { + "__type__": "cc.Animation", + "_name": "", + "_objFlags": 0, + "__editorExtras__": {}, + "node": { + "__id__": 1 + }, + "_enabled": true, + "__prefab": { + "__id__": 7 + }, + "playOnLoad": true, + "_clips": [], + "_defaultClip": null, + "_id": "" + }, + { + "__type__": "cc.CompPrefabInfo", + "fileId": "3dBJqUbmFPGIhxjbVKe/vR" + }, + { + "__type__": "cc.Widget", + "_name": "", + "_objFlags": 0, + "__editorExtras__": {}, + "node": { + "__id__": 1 + }, + "_enabled": false, + "__prefab": { + "__id__": 9 + }, + "_alignFlags": 18, + "_target": null, + "_left": 180.8, + "_right": 180.8, + "_top": 460.8, + "_bottom": 450, + "_horizontalCenter": 0, + "_verticalCenter": 160, + "_isAbsLeft": true, + "_isAbsRight": true, + "_isAbsTop": true, + "_isAbsBottom": true, + "_isAbsHorizontalCenter": true, + "_isAbsVerticalCenter": true, + "_originalWidth": 256, + "_originalHeight": 0, + "_alignMode": 2, + "_lockFlags": 0, + "_id": "" + }, + { + "__type__": "cc.CompPrefabInfo", + "fileId": "bbvPKZM+VNTrQG0iMfRGDW" + }, + { + "__type__": "cc.PrefabInfo", + "root": { + "__id__": 1 + }, + "asset": { + "__id__": 0 + }, + "fileId": "9anvHdhj5D1opINsPLBLgs", + "instance": null, + "targetOverrides": null + } +] \ No newline at end of file diff --git a/assets/resources/game/gui/hui.prefab.meta b/assets/resources/game/gui/hui.prefab.meta new file mode 100644 index 00000000..6cd42610 --- /dev/null +++ b/assets/resources/game/gui/hui.prefab.meta @@ -0,0 +1,13 @@ +{ + "ver": "1.1.50", + "importer": "prefab", + "imported": true, + "uuid": "4489091b-29ab-4906-972b-978bd4279a8e", + "files": [ + ".json" + ], + "subMetas": {}, + "userData": { + "syncNodeName": "hui" + } +} diff --git a/assets/resources/gui/role_controller.prefab b/assets/resources/gui/role_controller.prefab index c5c352f0..8402ab40 100644 --- a/assets/resources/gui/role_controller.prefab +++ b/assets/resources/gui/role_controller.prefab @@ -25,29 +25,29 @@ "__id__": 53 }, { - "__id__": 322 + "__id__": 272 }, { - "__id__": 350 + "__id__": 300 } ], "_active": true, "_components": [ { - "__id__": 396 + "__id__": 346 }, { - "__id__": 398 + "__id__": 348 }, { - "__id__": 400 + "__id__": 350 }, { - "__id__": 402 + "__id__": 352 } ], "_prefab": { - "__id__": 404 + "__id__": 354 }, "_lpos": { "__type__": "cc.Vec3", @@ -1242,20 +1242,20 @@ "_active": true, "_components": [ { - "__id__": 313 + "__id__": 263 }, { - "__id__": 315 + "__id__": 265 }, { - "__id__": 317 + "__id__": 267 }, { - "__id__": 319 + "__id__": 269 } ], "_prefab": { - "__id__": 321 + "__id__": 271 }, "_lpos": { "__type__": "cc.Vec3", @@ -1561,7 +1561,7 @@ "_lpos": { "__type__": "cc.Vec3", "x": 0, - "y": 180.984, + "y": 286.646, "z": 0 }, "_lrot": { @@ -3619,7 +3619,7 @@ "_lpos": { "__type__": "cc.Vec3", "x": 0, - "y": 108.116, + "y": 203.619, "z": 0 }, "_lrot": { @@ -5583,35 +5583,20 @@ "__id__": 232 }, { - "__id__": 242 - }, - { - "__id__": 252 - }, - { - "__id__": 262 - }, - { - "__id__": 272 - }, - { - "__id__": 282 - }, - { - "__id__": 288 + "__id__": 238 } ], "_active": true, "_components": [ { - "__id__": 308 + "__id__": 258 }, { - "__id__": 310 + "__id__": 260 } ], "_prefab": { - "__id__": 312 + "__id__": 262 }, "_lpos": { "__type__": "cc.Vec3", @@ -5644,7 +5629,7 @@ }, { "__type__": "cc.Node", - "_name": "Node", + "_name": "light", "_objFlags": 0, "__editorExtras__": {}, "_parent": { @@ -5658,1005 +5643,10 @@ }, { "__id__": 235 - }, - { - "__id__": 237 - }, - { - "__id__": 239 } ], "_prefab": { - "__id__": 241 - }, - "_lpos": { - "__type__": "cc.Vec3", - "x": 0, - "y": -108.93, - "z": 0 - }, - "_lrot": { - "__type__": "cc.Quat", - "x": 0, - "y": 0, - "z": 0, - "w": 1 - }, - "_lscale": { - "__type__": "cc.Vec3", - "x": -0.8, - "y": 0.8, - "z": 1 - }, - "_mobility": 0, - "_layer": 1073741824, - "_euler": { - "__type__": "cc.Vec3", - "x": 0, - "y": 0, - "z": 0 - }, - "_id": "" - }, - { - "__type__": "cc.UITransform", - "_name": "", - "_objFlags": 0, - "__editorExtras__": {}, - "node": { - "__id__": 232 - }, - "_enabled": true, - "__prefab": { - "__id__": 234 - }, - "_contentSize": { - "__type__": "cc.Size", - "width": 256, - "height": 256 - }, - "_anchorPoint": { - "__type__": "cc.Vec2", - "x": 0.5, - "y": 0 - }, - "_id": "" - }, - { - "__type__": "cc.CompPrefabInfo", - "fileId": "cewibQgK1ALbFhMuuspMmN" - }, - { - "__type__": "cc.Sprite", - "_name": "", - "_objFlags": 0, - "__editorExtras__": {}, - "node": { - "__id__": 232 - }, - "_enabled": true, - "__prefab": { - "__id__": 236 - }, - "_customMaterial": null, - "_srcBlendFactor": 2, - "_dstBlendFactor": 4, - "_color": { - "__type__": "cc.Color", - "r": 255, - "g": 255, - "b": 255, - "a": 255 - }, - "_spriteFrame": { - "__uuid__": "9e5ec114-01a4-47d3-b7b7-df3b90209c91@6ce90", - "__expectedType__": "cc.SpriteFrame" - }, - "_type": 0, - "_fillType": 0, - "_sizeMode": 1, - "_fillCenter": { - "__type__": "cc.Vec2", - "x": 0, - "y": 0 - }, - "_fillStart": 0, - "_fillRange": 0, - "_isTrimmedMode": true, - "_useGrayscale": false, - "_atlas": null, - "_id": "" - }, - { - "__type__": "cc.CompPrefabInfo", - "fileId": "ed71tIQFtJtbSwrQYOmOPP" - }, - { - "__type__": "cc.Animation", - "_name": "", - "_objFlags": 0, - "__editorExtras__": {}, - "node": { - "__id__": 232 - }, - "_enabled": true, - "__prefab": { - "__id__": 238 - }, - "playOnLoad": true, - "_clips": [], - "_defaultClip": null, - "_id": "" - }, - { - "__type__": "cc.CompPrefabInfo", - "fileId": "3dBJqUbmFPGIhxjbVKe/vR" - }, - { - "__type__": "cc.Widget", - "_name": "", - "_objFlags": 0, - "__editorExtras__": {}, - "node": { - "__id__": 232 - }, - "_enabled": false, - "__prefab": { - "__id__": 240 - }, - "_alignFlags": 18, - "_target": null, - "_left": 180.8, - "_right": 180.8, - "_top": 460.8, - "_bottom": 450, - "_horizontalCenter": 0, - "_verticalCenter": 160, - "_isAbsLeft": true, - "_isAbsRight": true, - "_isAbsTop": true, - "_isAbsBottom": true, - "_isAbsHorizontalCenter": true, - "_isAbsVerticalCenter": true, - "_originalWidth": 256, - "_originalHeight": 0, - "_alignMode": 2, - "_lockFlags": 0, - "_id": "" - }, - { - "__type__": "cc.CompPrefabInfo", - "fileId": "bbvPKZM+VNTrQG0iMfRGDW" - }, - { - "__type__": "cc.PrefabInfo", - "root": { - "__id__": 1 - }, - "asset": { - "__id__": 0 - }, - "fileId": "9anvHdhj5D1opINsPLBLgs", - "instance": null, - "targetOverrides": null, - "nestedPrefabInstanceRoots": null - }, - { - "__type__": "cc.Node", - "_name": "Node1", - "_objFlags": 0, - "__editorExtras__": {}, - "_parent": { - "__id__": 231 - }, - "_children": [], - "_active": true, - "_components": [ - { - "__id__": 243 - }, - { - "__id__": 245 - }, - { - "__id__": 247 - }, - { - "__id__": 249 - } - ], - "_prefab": { - "__id__": 251 - }, - "_lpos": { - "__type__": "cc.Vec3", - "x": 250, - "y": -108.93, - "z": 0 - }, - "_lrot": { - "__type__": "cc.Quat", - "x": 0, - "y": 0, - "z": 0, - "w": 1 - }, - "_lscale": { - "__type__": "cc.Vec3", - "x": -0.8, - "y": 0.8, - "z": 1 - }, - "_mobility": 0, - "_layer": 1073741824, - "_euler": { - "__type__": "cc.Vec3", - "x": 0, - "y": 0, - "z": 0 - }, - "_id": "" - }, - { - "__type__": "cc.UITransform", - "_name": "", - "_objFlags": 0, - "__editorExtras__": {}, - "node": { - "__id__": 242 - }, - "_enabled": true, - "__prefab": { - "__id__": 244 - }, - "_contentSize": { - "__type__": "cc.Size", - "width": 256, - "height": 256 - }, - "_anchorPoint": { - "__type__": "cc.Vec2", - "x": 0.5, - "y": 0 - }, - "_id": "" - }, - { - "__type__": "cc.CompPrefabInfo", - "fileId": "0bOzXim85Nrqdu6emwVWrd" - }, - { - "__type__": "cc.Sprite", - "_name": "", - "_objFlags": 0, - "__editorExtras__": {}, - "node": { - "__id__": 242 - }, - "_enabled": true, - "__prefab": { - "__id__": 246 - }, - "_customMaterial": null, - "_srcBlendFactor": 2, - "_dstBlendFactor": 4, - "_color": { - "__type__": "cc.Color", - "r": 255, - "g": 255, - "b": 255, - "a": 255 - }, - "_spriteFrame": { - "__uuid__": "9e5ec114-01a4-47d3-b7b7-df3b90209c91@6ce90", - "__expectedType__": "cc.SpriteFrame" - }, - "_type": 0, - "_fillType": 0, - "_sizeMode": 1, - "_fillCenter": { - "__type__": "cc.Vec2", - "x": 0, - "y": 0 - }, - "_fillStart": 0, - "_fillRange": 0, - "_isTrimmedMode": true, - "_useGrayscale": false, - "_atlas": null, - "_id": "" - }, - { - "__type__": "cc.CompPrefabInfo", - "fileId": "8cSo8eD4NA4rfgphTdy9eR" - }, - { - "__type__": "cc.Animation", - "_name": "", - "_objFlags": 0, - "__editorExtras__": {}, - "node": { - "__id__": 242 - }, - "_enabled": true, - "__prefab": { - "__id__": 248 - }, - "playOnLoad": true, - "_clips": [], - "_defaultClip": null, - "_id": "" - }, - { - "__type__": "cc.CompPrefabInfo", - "fileId": "f7HQlCCfZBrqa1bIx/lWAx" - }, - { - "__type__": "cc.Widget", - "_name": "", - "_objFlags": 0, - "__editorExtras__": {}, - "node": { - "__id__": 242 - }, - "_enabled": false, - "__prefab": { - "__id__": 250 - }, - "_alignFlags": 18, - "_target": null, - "_left": 180.8, - "_right": 180.8, - "_top": 460.8, - "_bottom": 450, - "_horizontalCenter": 0, - "_verticalCenter": 160, - "_isAbsLeft": true, - "_isAbsRight": true, - "_isAbsTop": true, - "_isAbsBottom": true, - "_isAbsHorizontalCenter": true, - "_isAbsVerticalCenter": true, - "_originalWidth": 256, - "_originalHeight": 0, - "_alignMode": 2, - "_lockFlags": 0, - "_id": "" - }, - { - "__type__": "cc.CompPrefabInfo", - "fileId": "98oVY+B55MwLBpCxBZ7LV+" - }, - { - "__type__": "cc.PrefabInfo", - "root": { - "__id__": 1 - }, - "asset": { - "__id__": 0 - }, - "fileId": "4cpK6SwURGcb6CS1ipzSlk", - "instance": null, - "targetOverrides": null, - "nestedPrefabInstanceRoots": null - }, - { - "__type__": "cc.Node", - "_name": "Node2", - "_objFlags": 0, - "__editorExtras__": {}, - "_parent": { - "__id__": 231 - }, - "_children": [], - "_active": true, - "_components": [ - { - "__id__": 253 - }, - { - "__id__": 255 - }, - { - "__id__": 257 - }, - { - "__id__": 259 - } - ], - "_prefab": { - "__id__": 261 - }, - "_lpos": { - "__type__": "cc.Vec3", - "x": 125, - "y": -108.93, - "z": 0 - }, - "_lrot": { - "__type__": "cc.Quat", - "x": 0, - "y": 0, - "z": 0, - "w": 1 - }, - "_lscale": { - "__type__": "cc.Vec3", - "x": -0.8, - "y": 0.8, - "z": 1 - }, - "_mobility": 0, - "_layer": 1073741824, - "_euler": { - "__type__": "cc.Vec3", - "x": 0, - "y": 0, - "z": 0 - }, - "_id": "" - }, - { - "__type__": "cc.UITransform", - "_name": "", - "_objFlags": 0, - "__editorExtras__": {}, - "node": { - "__id__": 252 - }, - "_enabled": true, - "__prefab": { - "__id__": 254 - }, - "_contentSize": { - "__type__": "cc.Size", - "width": 256, - "height": 256 - }, - "_anchorPoint": { - "__type__": "cc.Vec2", - "x": 0.5, - "y": 0 - }, - "_id": "" - }, - { - "__type__": "cc.CompPrefabInfo", - "fileId": "05ik20FAJFoo/Oluh7gcfx" - }, - { - "__type__": "cc.Sprite", - "_name": "", - "_objFlags": 0, - "__editorExtras__": {}, - "node": { - "__id__": 252 - }, - "_enabled": true, - "__prefab": { - "__id__": 256 - }, - "_customMaterial": null, - "_srcBlendFactor": 2, - "_dstBlendFactor": 4, - "_color": { - "__type__": "cc.Color", - "r": 255, - "g": 255, - "b": 255, - "a": 255 - }, - "_spriteFrame": { - "__uuid__": "9e5ec114-01a4-47d3-b7b7-df3b90209c91@6ce90", - "__expectedType__": "cc.SpriteFrame" - }, - "_type": 0, - "_fillType": 0, - "_sizeMode": 1, - "_fillCenter": { - "__type__": "cc.Vec2", - "x": 0, - "y": 0 - }, - "_fillStart": 0, - "_fillRange": 0, - "_isTrimmedMode": true, - "_useGrayscale": false, - "_atlas": null, - "_id": "" - }, - { - "__type__": "cc.CompPrefabInfo", - "fileId": "adrozLaepIqK0dIXHT2E15" - }, - { - "__type__": "cc.Animation", - "_name": "", - "_objFlags": 0, - "__editorExtras__": {}, - "node": { - "__id__": 252 - }, - "_enabled": true, - "__prefab": { - "__id__": 258 - }, - "playOnLoad": true, - "_clips": [], - "_defaultClip": null, - "_id": "" - }, - { - "__type__": "cc.CompPrefabInfo", - "fileId": "77AJkLfwBNMpQwYcyn+mkn" - }, - { - "__type__": "cc.Widget", - "_name": "", - "_objFlags": 0, - "__editorExtras__": {}, - "node": { - "__id__": 252 - }, - "_enabled": false, - "__prefab": { - "__id__": 260 - }, - "_alignFlags": 18, - "_target": null, - "_left": 180.8, - "_right": 180.8, - "_top": 460.8, - "_bottom": 450, - "_horizontalCenter": 0, - "_verticalCenter": 160, - "_isAbsLeft": true, - "_isAbsRight": true, - "_isAbsTop": true, - "_isAbsBottom": true, - "_isAbsHorizontalCenter": true, - "_isAbsVerticalCenter": true, - "_originalWidth": 256, - "_originalHeight": 0, - "_alignMode": 2, - "_lockFlags": 0, - "_id": "" - }, - { - "__type__": "cc.CompPrefabInfo", - "fileId": "195CIKEVNOLpbeqxNY3dmd" - }, - { - "__type__": "cc.PrefabInfo", - "root": { - "__id__": 1 - }, - "asset": { - "__id__": 0 - }, - "fileId": "497txozZlFuJ+xZxTO7CcX", - "instance": null, - "targetOverrides": null, - "nestedPrefabInstanceRoots": null - }, - { - "__type__": "cc.Node", - "_name": "Node3", - "_objFlags": 0, - "__editorExtras__": {}, - "_parent": { - "__id__": 231 - }, - "_children": [], - "_active": true, - "_components": [ - { - "__id__": 263 - }, - { - "__id__": 265 - }, - { - "__id__": 267 - }, - { - "__id__": 269 - } - ], - "_prefab": { - "__id__": 271 - }, - "_lpos": { - "__type__": "cc.Vec3", - "x": -125, - "y": -108.93, - "z": 0 - }, - "_lrot": { - "__type__": "cc.Quat", - "x": 0, - "y": 0, - "z": 0, - "w": 1 - }, - "_lscale": { - "__type__": "cc.Vec3", - "x": -0.8, - "y": 0.8, - "z": 1 - }, - "_mobility": 0, - "_layer": 1073741824, - "_euler": { - "__type__": "cc.Vec3", - "x": 0, - "y": 0, - "z": 0 - }, - "_id": "" - }, - { - "__type__": "cc.UITransform", - "_name": "", - "_objFlags": 0, - "__editorExtras__": {}, - "node": { - "__id__": 262 - }, - "_enabled": true, - "__prefab": { - "__id__": 264 - }, - "_contentSize": { - "__type__": "cc.Size", - "width": 256, - "height": 256 - }, - "_anchorPoint": { - "__type__": "cc.Vec2", - "x": 0.5, - "y": 0 - }, - "_id": "" - }, - { - "__type__": "cc.CompPrefabInfo", - "fileId": "757fOqqcNJaZS7F87kpuPI" - }, - { - "__type__": "cc.Sprite", - "_name": "", - "_objFlags": 0, - "__editorExtras__": {}, - "node": { - "__id__": 262 - }, - "_enabled": true, - "__prefab": { - "__id__": 266 - }, - "_customMaterial": null, - "_srcBlendFactor": 2, - "_dstBlendFactor": 4, - "_color": { - "__type__": "cc.Color", - "r": 255, - "g": 255, - "b": 255, - "a": 255 - }, - "_spriteFrame": { - "__uuid__": "9e5ec114-01a4-47d3-b7b7-df3b90209c91@6ce90", - "__expectedType__": "cc.SpriteFrame" - }, - "_type": 0, - "_fillType": 0, - "_sizeMode": 1, - "_fillCenter": { - "__type__": "cc.Vec2", - "x": 0, - "y": 0 - }, - "_fillStart": 0, - "_fillRange": 0, - "_isTrimmedMode": true, - "_useGrayscale": false, - "_atlas": null, - "_id": "" - }, - { - "__type__": "cc.CompPrefabInfo", - "fileId": "5daoPyEdJMBpgiTsNNEXWY" - }, - { - "__type__": "cc.Animation", - "_name": "", - "_objFlags": 0, - "__editorExtras__": {}, - "node": { - "__id__": 262 - }, - "_enabled": true, - "__prefab": { - "__id__": 268 - }, - "playOnLoad": true, - "_clips": [], - "_defaultClip": null, - "_id": "" - }, - { - "__type__": "cc.CompPrefabInfo", - "fileId": "f4mUEcealHTp4qH7rlJ4w4" - }, - { - "__type__": "cc.Widget", - "_name": "", - "_objFlags": 0, - "__editorExtras__": {}, - "node": { - "__id__": 262 - }, - "_enabled": false, - "__prefab": { - "__id__": 270 - }, - "_alignFlags": 18, - "_target": null, - "_left": 180.8, - "_right": 180.8, - "_top": 460.8, - "_bottom": 450, - "_horizontalCenter": 0, - "_verticalCenter": 160, - "_isAbsLeft": true, - "_isAbsRight": true, - "_isAbsTop": true, - "_isAbsBottom": true, - "_isAbsHorizontalCenter": true, - "_isAbsVerticalCenter": true, - "_originalWidth": 256, - "_originalHeight": 0, - "_alignMode": 2, - "_lockFlags": 0, - "_id": "" - }, - { - "__type__": "cc.CompPrefabInfo", - "fileId": "c21MPmhC5BkIu0vp+C1yaN" - }, - { - "__type__": "cc.PrefabInfo", - "root": { - "__id__": 1 - }, - "asset": { - "__id__": 0 - }, - "fileId": "4ehoNUbBZHbrQBMGxgZGnP", - "instance": null, - "targetOverrides": null, - "nestedPrefabInstanceRoots": null - }, - { - "__type__": "cc.Node", - "_name": "Node4", - "_objFlags": 0, - "__editorExtras__": {}, - "_parent": { - "__id__": 231 - }, - "_children": [], - "_active": true, - "_components": [ - { - "__id__": 273 - }, - { - "__id__": 275 - }, - { - "__id__": 277 - }, - { - "__id__": 279 - } - ], - "_prefab": { - "__id__": 281 - }, - "_lpos": { - "__type__": "cc.Vec3", - "x": -250, - "y": -108.93, - "z": 0 - }, - "_lrot": { - "__type__": "cc.Quat", - "x": 0, - "y": 0, - "z": 0, - "w": 1 - }, - "_lscale": { - "__type__": "cc.Vec3", - "x": -0.8, - "y": 0.8, - "z": 1 - }, - "_mobility": 0, - "_layer": 1073741824, - "_euler": { - "__type__": "cc.Vec3", - "x": 0, - "y": 0, - "z": 0 - }, - "_id": "" - }, - { - "__type__": "cc.UITransform", - "_name": "", - "_objFlags": 0, - "__editorExtras__": {}, - "node": { - "__id__": 272 - }, - "_enabled": true, - "__prefab": { - "__id__": 274 - }, - "_contentSize": { - "__type__": "cc.Size", - "width": 256, - "height": 256 - }, - "_anchorPoint": { - "__type__": "cc.Vec2", - "x": 0.5, - "y": 0 - }, - "_id": "" - }, - { - "__type__": "cc.CompPrefabInfo", - "fileId": "05WGCOyctCk7eRkzpOcKtN" - }, - { - "__type__": "cc.Sprite", - "_name": "", - "_objFlags": 0, - "__editorExtras__": {}, - "node": { - "__id__": 272 - }, - "_enabled": true, - "__prefab": { - "__id__": 276 - }, - "_customMaterial": null, - "_srcBlendFactor": 2, - "_dstBlendFactor": 4, - "_color": { - "__type__": "cc.Color", - "r": 255, - "g": 255, - "b": 255, - "a": 255 - }, - "_spriteFrame": { - "__uuid__": "9e5ec114-01a4-47d3-b7b7-df3b90209c91@6ce90", - "__expectedType__": "cc.SpriteFrame" - }, - "_type": 0, - "_fillType": 0, - "_sizeMode": 1, - "_fillCenter": { - "__type__": "cc.Vec2", - "x": 0, - "y": 0 - }, - "_fillStart": 0, - "_fillRange": 0, - "_isTrimmedMode": true, - "_useGrayscale": false, - "_atlas": null, - "_id": "" - }, - { - "__type__": "cc.CompPrefabInfo", - "fileId": "adqojmTF5Nor6HRX4k6zTx" - }, - { - "__type__": "cc.Animation", - "_name": "", - "_objFlags": 0, - "__editorExtras__": {}, - "node": { - "__id__": 272 - }, - "_enabled": true, - "__prefab": { - "__id__": 278 - }, - "playOnLoad": true, - "_clips": [], - "_defaultClip": null, - "_id": "" - }, - { - "__type__": "cc.CompPrefabInfo", - "fileId": "85U9D7V5ZE4JU/AJ9OPk8w" - }, - { - "__type__": "cc.Widget", - "_name": "", - "_objFlags": 0, - "__editorExtras__": {}, - "node": { - "__id__": 272 - }, - "_enabled": false, - "__prefab": { - "__id__": 280 - }, - "_alignFlags": 18, - "_target": null, - "_left": 180.8, - "_right": 180.8, - "_top": 460.8, - "_bottom": 450, - "_horizontalCenter": 0, - "_verticalCenter": 160, - "_isAbsLeft": true, - "_isAbsRight": true, - "_isAbsTop": true, - "_isAbsBottom": true, - "_isAbsHorizontalCenter": true, - "_isAbsVerticalCenter": true, - "_originalWidth": 256, - "_originalHeight": 0, - "_alignMode": 2, - "_lockFlags": 0, - "_id": "" - }, - { - "__type__": "cc.CompPrefabInfo", - "fileId": "48L6Fjp11IJad25Nrjuplt" - }, - { - "__type__": "cc.PrefabInfo", - "root": { - "__id__": 1 - }, - "asset": { - "__id__": 0 - }, - "fileId": "b24JojnI9Jarep64hb5wSB", - "instance": null, - "targetOverrides": null, - "nestedPrefabInstanceRoots": null - }, - { - "__type__": "cc.Node", - "_name": "light", - "_objFlags": 0, - "__editorExtras__": {}, - "_parent": { - "__id__": 231 - }, - "_children": [], - "_active": true, - "_components": [ - { - "__id__": 283 - }, - { - "__id__": 285 - } - ], - "_prefab": { - "__id__": 287 + "__id__": 237 }, "_lpos": { "__type__": "cc.Vec3", @@ -6693,11 +5683,11 @@ "_objFlags": 0, "__editorExtras__": {}, "node": { - "__id__": 282 + "__id__": 232 }, "_enabled": true, "__prefab": { - "__id__": 284 + "__id__": 234 }, "_contentSize": { "__type__": "cc.Size", @@ -6721,11 +5711,11 @@ "_objFlags": 0, "__editorExtras__": {}, "node": { - "__id__": 282 + "__id__": 232 }, "_enabled": true, "__prefab": { - "__id__": 286 + "__id__": 236 }, "_customMaterial": null, "_srcBlendFactor": 2, @@ -6786,23 +5776,23 @@ }, "_children": [ { - "__id__": 289 + "__id__": 239 }, { - "__id__": 297 + "__id__": 247 } ], "_active": true, "_components": [ { - "__id__": 303 + "__id__": 253 }, { - "__id__": 305 + "__id__": 255 } ], "_prefab": { - "__id__": 307 + "__id__": 257 }, "_lpos": { "__type__": "cc.Vec3", @@ -6839,23 +5829,23 @@ "_objFlags": 0, "__editorExtras__": {}, "_parent": { - "__id__": 288 + "__id__": 238 }, "_children": [], "_active": true, "_components": [ { - "__id__": 290 + "__id__": 240 }, { - "__id__": 292 + "__id__": 242 }, { - "__id__": 294 + "__id__": 244 } ], "_prefab": { - "__id__": 296 + "__id__": 246 }, "_lpos": { "__type__": "cc.Vec3", @@ -6892,11 +5882,11 @@ "_objFlags": 0, "__editorExtras__": {}, "node": { - "__id__": 289 + "__id__": 239 }, "_enabled": true, "__prefab": { - "__id__": 291 + "__id__": 241 }, "_contentSize": { "__type__": "cc.Size", @@ -6920,11 +5910,11 @@ "_objFlags": 0, "__editorExtras__": {}, "node": { - "__id__": 289 + "__id__": 239 }, "_enabled": true, "__prefab": { - "__id__": 293 + "__id__": 243 }, "_customMaterial": null, "_srcBlendFactor": 2, @@ -6988,11 +5978,11 @@ "_objFlags": 0, "__editorExtras__": {}, "node": { - "__id__": 289 + "__id__": 239 }, "_enabled": true, "__prefab": { - "__id__": 295 + "__id__": 245 }, "_alignFlags": 1, "_target": null, @@ -7037,20 +6027,20 @@ "_objFlags": 0, "__editorExtras__": {}, "_parent": { - "__id__": 288 + "__id__": 238 }, "_children": [], "_active": true, "_components": [ { - "__id__": 298 + "__id__": 248 }, { - "__id__": 300 + "__id__": 250 } ], "_prefab": { - "__id__": 302 + "__id__": 252 }, "_lpos": { "__type__": "cc.Vec3", @@ -7087,11 +6077,11 @@ "_objFlags": 0, "__editorExtras__": {}, "node": { - "__id__": 297 + "__id__": 247 }, "_enabled": true, "__prefab": { - "__id__": 299 + "__id__": 249 }, "_contentSize": { "__type__": "cc.Size", @@ -7115,11 +6105,11 @@ "_objFlags": 0, "__editorExtras__": {}, "node": { - "__id__": 297 + "__id__": 247 }, "_enabled": true, "__prefab": { - "__id__": 301 + "__id__": 251 }, "_customMaterial": null, "_srcBlendFactor": 2, @@ -7196,11 +6186,11 @@ "_objFlags": 0, "__editorExtras__": {}, "node": { - "__id__": 288 + "__id__": 238 }, "_enabled": true, "__prefab": { - "__id__": 304 + "__id__": 254 }, "_contentSize": { "__type__": "cc.Size", @@ -7224,11 +6214,11 @@ "_objFlags": 0, "__editorExtras__": {}, "node": { - "__id__": 288 + "__id__": 238 }, "_enabled": true, "__prefab": { - "__id__": 306 + "__id__": 256 }, "_customMaterial": null, "_srcBlendFactor": 2, @@ -7289,7 +6279,7 @@ }, "_enabled": true, "__prefab": { - "__id__": 309 + "__id__": 259 }, "_contentSize": { "__type__": "cc.Size", @@ -7317,7 +6307,7 @@ }, "_enabled": true, "__prefab": { - "__id__": 311 + "__id__": 261 }, "_alignFlags": 18, "_target": null, @@ -7366,7 +6356,7 @@ }, "_enabled": true, "__prefab": { - "__id__": 314 + "__id__": 264 }, "_contentSize": { "__type__": "cc.Size", @@ -7394,7 +6384,7 @@ }, "_enabled": true, "__prefab": { - "__id__": 316 + "__id__": 266 }, "_alignFlags": 21, "_target": null, @@ -7430,7 +6420,7 @@ }, "_enabled": true, "__prefab": { - "__id__": 318 + "__id__": 268 }, "_id": "" }, @@ -7448,7 +6438,7 @@ }, "_enabled": true, "__prefab": { - "__id__": 320 + "__id__": 270 }, "_id": "" }, @@ -7479,26 +6469,26 @@ }, "_children": [ { - "__id__": 323 + "__id__": 273 }, { - "__id__": 331 + "__id__": 281 } ], "_active": false, "_components": [ { - "__id__": 343 + "__id__": 293 }, { - "__id__": 345 + "__id__": 295 }, { - "__id__": 347 + "__id__": 297 } ], "_prefab": { - "__id__": 349 + "__id__": 299 }, "_lpos": { "__type__": "cc.Vec3", @@ -7535,23 +6525,23 @@ "_objFlags": 0, "__editorExtras__": {}, "_parent": { - "__id__": 322 + "__id__": 272 }, "_children": [], "_active": true, "_components": [ { - "__id__": 324 + "__id__": 274 }, { - "__id__": 326 + "__id__": 276 }, { - "__id__": 328 + "__id__": 278 } ], "_prefab": { - "__id__": 330 + "__id__": 280 }, "_lpos": { "__type__": "cc.Vec3", @@ -7588,11 +6578,11 @@ "_objFlags": 0, "__editorExtras__": {}, "node": { - "__id__": 323 + "__id__": 273 }, "_enabled": true, "__prefab": { - "__id__": 325 + "__id__": 275 }, "_contentSize": { "__type__": "cc.Size", @@ -7616,11 +6606,11 @@ "_objFlags": 0, "__editorExtras__": {}, "node": { - "__id__": 323 + "__id__": 273 }, "_enabled": true, "__prefab": { - "__id__": 327 + "__id__": 277 }, "_customMaterial": null, "_srcBlendFactor": 2, @@ -7664,11 +6654,11 @@ "_objFlags": 0, "__editorExtras__": {}, "node": { - "__id__": 323 + "__id__": 273 }, "_enabled": true, "__prefab": { - "__id__": 329 + "__id__": 279 }, "_alignFlags": 45, "_target": null, @@ -7711,17 +6701,17 @@ "__type__": "cc.Node", "_objFlags": 0, "_parent": { - "__id__": 322 + "__id__": 272 }, "_prefab": { - "__id__": 332 + "__id__": 282 }, "__editorExtras__": {} }, { "__type__": "cc.PrefabInfo", "root": { - "__id__": 331 + "__id__": 281 }, "asset": { "__uuid__": "9cc71d8c-192a-4234-8204-352f42b95c65", @@ -7729,7 +6719,7 @@ }, "fileId": "a0daVw8DRLi6ToMaTA0VS2", "instance": { - "__id__": 333 + "__id__": 283 }, "targetOverrides": null }, @@ -7743,22 +6733,22 @@ "mountedComponents": [], "propertyOverrides": [ { - "__id__": 334 + "__id__": 284 }, { - "__id__": 336 + "__id__": 286 }, { - "__id__": 337 + "__id__": 287 }, { - "__id__": 338 + "__id__": 288 }, { - "__id__": 339 + "__id__": 289 }, { - "__id__": 341 + "__id__": 291 } ], "removedComponents": [] @@ -7766,7 +6756,7 @@ { "__type__": "CCPropertyOverrideInfo", "targetInfo": { - "__id__": 335 + "__id__": 285 }, "propertyPath": [ "_name" @@ -7782,7 +6772,7 @@ { "__type__": "CCPropertyOverrideInfo", "targetInfo": { - "__id__": 335 + "__id__": 285 }, "propertyPath": [ "_lpos" @@ -7797,7 +6787,7 @@ { "__type__": "CCPropertyOverrideInfo", "targetInfo": { - "__id__": 335 + "__id__": 285 }, "propertyPath": [ "_lrot" @@ -7813,7 +6803,7 @@ { "__type__": "CCPropertyOverrideInfo", "targetInfo": { - "__id__": 335 + "__id__": 285 }, "propertyPath": [ "_euler" @@ -7828,7 +6818,7 @@ { "__type__": "CCPropertyOverrideInfo", "targetInfo": { - "__id__": 340 + "__id__": 290 }, "propertyPath": [ "_contentSize" @@ -7848,7 +6838,7 @@ { "__type__": "CCPropertyOverrideInfo", "targetInfo": { - "__id__": 342 + "__id__": 292 }, "propertyPath": [ "_contentSize" @@ -7871,11 +6861,11 @@ "_objFlags": 0, "__editorExtras__": {}, "node": { - "__id__": 322 + "__id__": 272 }, "_enabled": true, "__prefab": { - "__id__": 344 + "__id__": 294 }, "_contentSize": { "__type__": "cc.Size", @@ -7899,11 +6889,11 @@ "_objFlags": 0, "__editorExtras__": {}, "node": { - "__id__": 322 + "__id__": 272 }, "_enabled": true, "__prefab": { - "__id__": 346 + "__id__": 296 }, "_alignFlags": 45, "_target": null, @@ -7935,11 +6925,11 @@ "_objFlags": 0, "__editorExtras__": {}, "node": { - "__id__": 322 + "__id__": 272 }, "_enabled": true, "__prefab": { - "__id__": 348 + "__id__": 298 }, "_id": "" }, @@ -7970,23 +6960,23 @@ }, "_children": [ { - "__id__": 351 + "__id__": 301 } ], "_active": true, "_components": [ { - "__id__": 389 + "__id__": 339 }, { - "__id__": 391 + "__id__": 341 }, { - "__id__": 393 + "__id__": 343 } ], "_prefab": { - "__id__": 395 + "__id__": 345 }, "_lpos": { "__type__": "cc.Vec3", @@ -8023,30 +7013,30 @@ "_objFlags": 0, "__editorExtras__": {}, "_parent": { - "__id__": 350 + "__id__": 300 }, "_children": [ { - "__id__": 352 + "__id__": 302 } ], "_active": true, "_components": [ { - "__id__": 380 + "__id__": 330 }, { - "__id__": 382 + "__id__": 332 }, { - "__id__": 384 + "__id__": 334 }, { - "__id__": 386 + "__id__": 336 } ], "_prefab": { - "__id__": 388 + "__id__": 338 }, "_lpos": { "__type__": "cc.Vec3", @@ -8083,27 +7073,27 @@ "_objFlags": 0, "__editorExtras__": {}, "_parent": { - "__id__": 351 + "__id__": 301 }, "_children": [ { - "__id__": 353 + "__id__": 303 }, { - "__id__": 361 + "__id__": 311 }, { - "__id__": 367 + "__id__": 317 } ], "_active": true, "_components": [ { - "__id__": 377 + "__id__": 327 } ], "_prefab": { - "__id__": 379 + "__id__": 329 }, "_lpos": { "__type__": "cc.Vec3", @@ -8140,23 +7130,23 @@ "_objFlags": 0, "__editorExtras__": {}, "_parent": { - "__id__": 352 + "__id__": 302 }, "_children": [], "_active": true, "_components": [ { - "__id__": 354 + "__id__": 304 }, { - "__id__": 356 + "__id__": 306 }, { - "__id__": 358 + "__id__": 308 } ], "_prefab": { - "__id__": 360 + "__id__": 310 }, "_lpos": { "__type__": "cc.Vec3", @@ -8193,11 +7183,11 @@ "_objFlags": 0, "__editorExtras__": {}, "node": { - "__id__": 353 + "__id__": 303 }, "_enabled": true, "__prefab": { - "__id__": 355 + "__id__": 305 }, "_contentSize": { "__type__": "cc.Size", @@ -8221,11 +7211,11 @@ "_objFlags": 0, "__editorExtras__": {}, "node": { - "__id__": 353 + "__id__": 303 }, "_enabled": true, "__prefab": { - "__id__": 357 + "__id__": 307 }, "_customMaterial": null, "_srcBlendFactor": 2, @@ -8269,11 +7259,11 @@ "_objFlags": 0, "__editorExtras__": {}, "node": { - "__id__": 353 + "__id__": 303 }, "_enabled": true, "__prefab": { - "__id__": 359 + "__id__": 309 }, "_alignFlags": 40, "_target": null, @@ -8318,20 +7308,20 @@ "_objFlags": 0, "__editorExtras__": {}, "_parent": { - "__id__": 352 + "__id__": 302 }, "_children": [], "_active": true, "_components": [ { - "__id__": 362 + "__id__": 312 }, { - "__id__": 364 + "__id__": 314 } ], "_prefab": { - "__id__": 366 + "__id__": 316 }, "_lpos": { "__type__": "cc.Vec3", @@ -8368,11 +7358,11 @@ "_objFlags": 0, "__editorExtras__": {}, "node": { - "__id__": 361 + "__id__": 311 }, "_enabled": true, "__prefab": { - "__id__": 363 + "__id__": 313 }, "_contentSize": { "__type__": "cc.Size", @@ -8396,11 +7386,11 @@ "_objFlags": 0, "__editorExtras__": {}, "node": { - "__id__": 361 + "__id__": 311 }, "_enabled": true, "__prefab": { - "__id__": 365 + "__id__": 315 }, "_customMaterial": null, "_srcBlendFactor": 2, @@ -8457,26 +7447,26 @@ "_objFlags": 0, "__editorExtras__": {}, "_parent": { - "__id__": 352 + "__id__": 302 }, "_children": [], "_active": true, "_components": [ { - "__id__": 368 + "__id__": 318 }, { - "__id__": 370 + "__id__": 320 }, { - "__id__": 372 + "__id__": 322 }, { - "__id__": 374 + "__id__": 324 } ], "_prefab": { - "__id__": 376 + "__id__": 326 }, "_lpos": { "__type__": "cc.Vec3", @@ -8513,11 +7503,11 @@ "_objFlags": 0, "__editorExtras__": {}, "node": { - "__id__": 367 + "__id__": 317 }, "_enabled": true, "__prefab": { - "__id__": 369 + "__id__": 319 }, "_contentSize": { "__type__": "cc.Size", @@ -8541,11 +7531,11 @@ "_objFlags": 0, "__editorExtras__": {}, "node": { - "__id__": 367 + "__id__": 317 }, "_enabled": true, "__prefab": { - "__id__": 371 + "__id__": 321 }, "_customMaterial": null, "_srcBlendFactor": 2, @@ -8609,11 +7599,11 @@ "_objFlags": 0, "__editorExtras__": {}, "node": { - "__id__": 367 + "__id__": 317 }, "_enabled": true, "__prefab": { - "__id__": 373 + "__id__": 323 }, "_alignFlags": 10, "_target": null, @@ -8645,11 +7635,11 @@ "_objFlags": 0, "__editorExtras__": {}, "node": { - "__id__": 367 + "__id__": 317 }, "_enabled": true, "__prefab": { - "__id__": 375 + "__id__": 325 }, "templateMode": true, "watchPath": "data.data.gold", @@ -8682,11 +7672,11 @@ "_objFlags": 0, "__editorExtras__": {}, "node": { - "__id__": 352 + "__id__": 302 }, "_enabled": true, "__prefab": { - "__id__": 378 + "__id__": 328 }, "_contentSize": { "__type__": "cc.Size", @@ -8723,11 +7713,11 @@ "_objFlags": 0, "__editorExtras__": {}, "node": { - "__id__": 351 + "__id__": 301 }, "_enabled": true, "__prefab": { - "__id__": 381 + "__id__": 331 }, "_contentSize": { "__type__": "cc.Size", @@ -8751,11 +7741,11 @@ "_objFlags": 0, "__editorExtras__": {}, "node": { - "__id__": 351 + "__id__": 301 }, "_enabled": true, "__prefab": { - "__id__": 383 + "__id__": 333 }, "_alignFlags": 8, "_target": null, @@ -8787,11 +7777,11 @@ "_objFlags": 0, "__editorExtras__": {}, "node": { - "__id__": 351 + "__id__": 301 }, "_enabled": true, "__prefab": { - "__id__": 385 + "__id__": 335 }, "_resizeMode": 0, "_layoutType": 1, @@ -8825,11 +7815,11 @@ "_objFlags": 0, "__editorExtras__": {}, "node": { - "__id__": 351 + "__id__": 301 }, "_enabled": true, "__prefab": { - "__id__": 387 + "__id__": 337 }, "_alignFlags": 40, "_target": null, @@ -8874,11 +7864,11 @@ "_objFlags": 0, "__editorExtras__": {}, "node": { - "__id__": 350 + "__id__": 300 }, "_enabled": true, "__prefab": { - "__id__": 390 + "__id__": 340 }, "_contentSize": { "__type__": "cc.Size", @@ -8902,11 +7892,11 @@ "_objFlags": 0, "__editorExtras__": {}, "node": { - "__id__": 350 + "__id__": 300 }, "_enabled": true, "__prefab": { - "__id__": 392 + "__id__": 342 }, "_alignFlags": 17, "_target": null, @@ -8938,11 +7928,11 @@ "_objFlags": 0, "__editorExtras__": {}, "node": { - "__id__": 350 + "__id__": 300 }, "_enabled": true, "__prefab": { - "__id__": 394 + "__id__": 344 }, "_id": "" }, @@ -8973,7 +7963,7 @@ }, "_enabled": true, "__prefab": { - "__id__": 397 + "__id__": 347 }, "_contentSize": { "__type__": "cc.Size", @@ -9001,7 +7991,7 @@ }, "_enabled": true, "__prefab": { - "__id__": 399 + "__id__": 349 }, "_alignFlags": 45, "_target": null, @@ -9037,7 +8027,7 @@ }, "_enabled": true, "__prefab": { - "__id__": 401 + "__id__": 351 }, "_id": "" }, @@ -9055,7 +8045,7 @@ }, "_enabled": false, "__prefab": { - "__id__": 403 + "__id__": 353 }, "_id": "" }, @@ -9076,7 +8066,7 @@ "targetOverrides": [], "nestedPrefabInstanceRoots": [ { - "__id__": 331 + "__id__": 281 } ] } diff --git a/assets/script/game/map/HInfoComp.ts b/assets/script/game/map/HInfoComp.ts index 58899962..93916b69 100644 --- a/assets/script/game/map/HInfoComp.ts +++ b/assets/script/game/map/HInfoComp.ts @@ -1,4 +1,4 @@ -import { _decorator, Animation, AnimationClip, Component, instantiate, Label, Node, Prefab, resources, Sprite, SpriteFrame, v3 } from 'cc'; +import { _decorator, Animation, AnimationClip, Component, instantiate, Label, Node, Prefab, resources, Sprite, SpriteFrame, v3, tween, Vec3 } from 'cc'; import { oops } from 'db://oops-framework/core/Oops'; import { getHeroList, HeroInfo, HType, HTypeName } from '../common/config/heroSet'; import { smc } from '../common/SingletonModuleComp'; @@ -38,34 +38,72 @@ export class HInfoComp extends Component { this.def_node=this.node.getChildByName("info").getChildByName("base").getChildByName("def").getChildByName("num") this.h_uuid=smc.fight_hero this.update_data(this.h_uuid) + this.load_all_hero(this.h_uuid) } update(deltaTime: number) { } update_data(uuid:number){ this.h_uuid=uuid - console.log("[HInfoComp]:update_data",uuid,HeroInfo[uuid],this.node) this.name_node.getComponent(Label).string=HeroInfo[uuid].name this.type_node.getComponent(Label).string=HTypeName[HeroInfo[uuid].type] this.ap_node.getComponent(Label).string=HeroInfo[uuid].ap.toString() this.hp_node.getComponent(Label).string=HeroInfo[uuid].hp.toString() this.def_node.getComponent(Label).string=HeroInfo[uuid].def.toString() - this.load_all_hero(uuid) } load_all_hero(uuid:number){ - + // 清除之前的英雄节点 + this.claear_hero(); + + // 获取英雄列表 + let heros = getHeroList(); + let currentIndex = heros.indexOf(uuid); + + // 载入7个英雄节点(当前英雄及前后各3个) + for(let i = 0; i < 7; i++) { + // 计算索引位置(考虑循环) + let indexOffset = i - 3; // -3, -2, -1, 0, 1, 2, 3 + let heroIndex = currentIndex + indexOffset; + + // 处理循环边界 + if(heroIndex < 0) { + heroIndex = heros.length + heroIndex; + } else if(heroIndex >= heros.length) { + heroIndex = heroIndex - heros.length; + } + + // 获取英雄UUID + let heroUuid = heros[heroIndex]; + + // 载入英雄预制体并设置位置 + this.heroNodes[i] = this.load_hui(heroUuid, i); + } } - load_hui(uuid:number,pos_index: number){ - var path = "game/heros/"+HeroInfo[uuid].path; + load_hui(uuid:number, pos_index: number){ + var path = "game/gui/hui"; var prefab: Prefab = oops.res.get(path, Prefab)!; var node = instantiate(prefab); - HeroInfo[uuid] - let anm_path=HeroInfo[uuid].path + // 将节点添加到父节点下 + this.node.getChildByName("hero").addChild(node); + + // 设置节点位置 + node.setPosition(this.hero_pos[pos_index]); + + // 加载并播放动画 + let anm_path=HeroInfo[uuid].path; resources.load("game/heros/hero/"+anm_path+"/idle", AnimationClip, (err, clip) => { - node.getComponent(Animation).addClip(clip); - node.getComponent(Animation).play("idle"); + if (!err && clip) { + let animComponent = node.getComponent(Animation); + if(animComponent) { + animComponent.addClip(clip); + animComponent.play("idle"); + } + } else { + console.error(`[HInfoComp]: Failed to load animation for hero ${uuid}`, err); + } }); - node.setPosition(this.hero_pos[pos_index]) + + return node; } claear_hero(){ @@ -78,21 +116,117 @@ export class HInfoComp extends Component { } next_hero(){ - let heros=getHeroList() + // 获取英雄列表 + let heros = getHeroList(); let index = heros.indexOf(this.h_uuid); - index++ - if(index==heros.length) index=0 + index++; + if(index == heros.length) index = 0; let nextHero = heros[index]; - this.update_data(nextHero) + + // 更新数据 + this.h_uuid = nextHero; + this.update_data(nextHero); + + // 执行平滑移动动画 + this.moveHeroesRight(); } + prev_hero(){ - let heros=getHeroList() + // 获取英雄列表 + let heros = getHeroList(); let index = heros.indexOf(this.h_uuid); - index-- - if(index==-1) index=heros.length-1 + index--; + if(index == -1) index = heros.length - 1; let prevHero = heros[index]; - this.update_data(prevHero) + + // 更新数据 + this.h_uuid = prevHero; + this.update_data(prevHero); + + // 执行平滑移动动画 + this.moveHeroesLeft(); } + + moveHeroesRight() { + // 移动所有现有节点向右 + for (let i = 0; i < this.heroNodes.length; i++) { + if (this.heroNodes[i]) { + // 计算目标位置 + let targetPos = this.hero_pos[i + 1] || this.hero_pos[0]; + + // 使用Tween执行平滑移动 + tween(this.heroNodes[i]) + .to(0.3, { position: targetPos }) + .start(); + } + } + + // 延迟创建新节点和删除旧节点,等待动画完成 + setTimeout(() => { + // 删除原先位于hero_pos[6]位置的节点 + if (this.heroNodes[6]) { + this.heroNodes[6].destroy(); + } + + // 移动数组元素 + for (let i = 6; i > 0; i--) { + this.heroNodes[i] = this.heroNodes[i - 1]; + } + + // 创建新节点放在hero_pos[0]位置 + let heros = getHeroList(); + let currentIndex = heros.indexOf(this.h_uuid); + let newIndex = currentIndex - 3; // 新的最左侧英雄索引 + + // 处理循环边界 + if (newIndex < 0) { + newIndex = heros.length + newIndex; + } + + this.heroNodes[0] = this.load_hui(heros[newIndex], 0); + }, 300); // 与动画时间保持一致 + } + + moveHeroesLeft() { + // 移动所有现有节点向左 + for (let i = 0; i < this.heroNodes.length; i++) { + if (this.heroNodes[i]) { + // 计算目标位置 + let targetPos = this.hero_pos[i - 1] || this.hero_pos[6]; + + // 使用Tween执行平滑移动 + tween(this.heroNodes[i]) + .to(0.3, { position: targetPos }) + .start(); + } + } + + // 延迟创建新节点和删除旧节点,等待动画完成 + setTimeout(() => { + // 删除原先位于hero_pos[0]位置的节点 + if (this.heroNodes[0]) { + this.heroNodes[0].destroy(); + } + + // 移动数组元素 + for (let i = 0; i < 6; i++) { + this.heroNodes[i] = this.heroNodes[i + 1]; + } + + // 创建新节点放在hero_pos[6]位置 + let heros = getHeroList(); + let currentIndex = heros.indexOf(this.h_uuid); + let newIndex = currentIndex + 3; // 新的最右侧英雄索引 + + // 处理循环边界 + if (newIndex >= heros.length) { + newIndex = newIndex - heros.length; + } + + this.heroNodes[6] = this.load_hui(heros[newIndex], 6); + }, 300); // 与动画时间保持一致 + } + close(){ oops.gui.removeByNode(this.node) }