feat(hero): 添加受击闪光效果并重构相关代码

新增FlashSprite组件实现受击闪光效果
重构HeroAnmComp和HeroViewComp以支持闪光效果
更新多个英雄prefab以包含闪光材质和组件
This commit is contained in:
walkpan
2025-11-15 11:15:30 +08:00
parent 4af9a6fd9e
commit 46a779633a
28 changed files with 2800 additions and 862 deletions

View File

@@ -22,23 +22,20 @@
"__id__": 2
},
{
"__id__": 12
"__id__": 14
},
{
"__id__": 24
"__id__": 26
},
{
"__id__": 35
"__id__": 37
},
{
"__id__": 44
"__id__": 46
}
],
"_active": true,
"_components": [
{
"__id__": 53
},
{
"__id__": 55
},
@@ -50,10 +47,13 @@
},
{
"__id__": 61
},
{
"__id__": 63
}
],
"_prefab": {
"__id__": 63
"__id__": 65
},
"_lpos": {
"__type__": "cc.Vec3",
@@ -106,10 +106,13 @@
},
{
"__id__": 9
},
{
"__id__": 11
}
],
"_prefab": {
"__id__": 11
"__id__": 13
},
"_lpos": {
"__type__": "cc.Vec3",
@@ -296,6 +299,28 @@
"__type__": "cc.CompPrefabInfo",
"fileId": "1dn32Q7fxNOrkpyNeazdIo"
},
{
"__type__": "954e43Y+QJHNIUpmqTCWA7A",
"_name": "",
"_objFlags": 0,
"__editorExtras__": {},
"node": {
"__id__": 2
},
"_enabled": true,
"__prefab": {
"__id__": 12
},
"hitFlashMaterial": {
"__uuid__": "8eee8ab1-fe48-4b22-b956-3f5c18fc4810",
"__expectedType__": "cc.Material"
},
"_id": ""
},
{
"__type__": "cc.CompPrefabInfo",
"fileId": "devH7HFXJH/5FNGHYdEhes"
},
{
"__type__": "cc.PrefabInfo",
"root": {
@@ -316,14 +341,14 @@
"__id__": 1
},
"_prefab": {
"__id__": 13
"__id__": 15
},
"__editorExtras__": {}
},
{
"__type__": "cc.PrefabInfo",
"root": {
"__id__": 12
"__id__": 14
},
"asset": {
"__uuid__": "e1b8a315-ece3-41a2-941e-a66861753f1b",
@@ -331,7 +356,7 @@
},
"fileId": "c46/YsCPVOJYA4mWEpNYRx",
"instance": {
"__id__": 14
"__id__": 16
},
"targetOverrides": null
},
@@ -344,15 +369,9 @@
"mountedChildren": [],
"mountedComponents": [],
"propertyOverrides": [
{
"__id__": 15
},
{
"__id__": 17
},
{
"__id__": 18
},
{
"__id__": 19
},
@@ -362,8 +381,14 @@
{
"__id__": 21
},
{
"__id__": 22
},
{
"__id__": 23
},
{
"__id__": 25
}
],
"removedComponents": []
@@ -371,7 +396,7 @@
{
"__type__": "CCPropertyOverrideInfo",
"targetInfo": {
"__id__": 16
"__id__": 18
},
"propertyPath": [
"_name"
@@ -387,7 +412,7 @@
{
"__type__": "CCPropertyOverrideInfo",
"targetInfo": {
"__id__": 16
"__id__": 18
},
"propertyPath": [
"_lpos"
@@ -402,7 +427,7 @@
{
"__type__": "CCPropertyOverrideInfo",
"targetInfo": {
"__id__": 16
"__id__": 18
},
"propertyPath": [
"_lrot"
@@ -418,7 +443,7 @@
{
"__type__": "CCPropertyOverrideInfo",
"targetInfo": {
"__id__": 16
"__id__": 18
},
"propertyPath": [
"_euler"
@@ -433,7 +458,7 @@
{
"__type__": "CCPropertyOverrideInfo",
"targetInfo": {
"__id__": 16
"__id__": 18
},
"propertyPath": [
"_active"
@@ -443,7 +468,7 @@
{
"__type__": "CCPropertyOverrideInfo",
"targetInfo": {
"__id__": 22
"__id__": 24
},
"propertyPath": [
"_contentSize"
@@ -463,7 +488,7 @@
{
"__type__": "CCPropertyOverrideInfo",
"targetInfo": {
"__id__": 16
"__id__": 18
},
"propertyPath": [
"_lscale"
@@ -482,14 +507,14 @@
"__id__": 1
},
"_prefab": {
"__id__": 25
"__id__": 27
},
"__editorExtras__": {}
},
{
"__type__": "cc.PrefabInfo",
"root": {
"__id__": 24
"__id__": 26
},
"asset": {
"__uuid__": "50c3d5e4-49f8-4bd7-a15b-cda359a0ae5c",
@@ -497,7 +522,7 @@
},
"fileId": "5fqU0L3/FOhKaco5UkHuWT",
"instance": {
"__id__": 26
"__id__": 28
},
"targetOverrides": null
},
@@ -510,23 +535,23 @@
"mountedChildren": [],
"mountedComponents": [],
"propertyOverrides": [
{
"__id__": 27
},
{
"__id__": 29
},
{
"__id__": 30
},
{
"__id__": 31
},
{
"__id__": 32
},
{
"__id__": 33
},
{
"__id__": 34
},
{
"__id__": 36
}
],
"removedComponents": []
@@ -534,7 +559,7 @@
{
"__type__": "CCPropertyOverrideInfo",
"targetInfo": {
"__id__": 28
"__id__": 30
},
"propertyPath": [
"_name"
@@ -550,7 +575,7 @@
{
"__type__": "CCPropertyOverrideInfo",
"targetInfo": {
"__id__": 28
"__id__": 30
},
"propertyPath": [
"_lpos"
@@ -565,7 +590,7 @@
{
"__type__": "CCPropertyOverrideInfo",
"targetInfo": {
"__id__": 28
"__id__": 30
},
"propertyPath": [
"_lrot"
@@ -581,7 +606,7 @@
{
"__type__": "CCPropertyOverrideInfo",
"targetInfo": {
"__id__": 28
"__id__": 30
},
"propertyPath": [
"_euler"
@@ -596,7 +621,7 @@
{
"__type__": "CCPropertyOverrideInfo",
"targetInfo": {
"__id__": 33
"__id__": 35
},
"propertyPath": [
"_lpos"
@@ -617,7 +642,7 @@
{
"__type__": "CCPropertyOverrideInfo",
"targetInfo": {
"__id__": 28
"__id__": 30
},
"propertyPath": [
"_lscale"
@@ -636,14 +661,14 @@
"__id__": 1
},
"_prefab": {
"__id__": 36
"__id__": 38
},
"__editorExtras__": {}
},
{
"__type__": "cc.PrefabInfo",
"root": {
"__id__": 35
"__id__": 37
},
"asset": {
"__uuid__": "5b4ca49e-0f12-4478-b56d-bf8198b36b90",
@@ -651,7 +676,7 @@
},
"fileId": "0d6ZXmA5dHkZxoGONDL2sE",
"instance": {
"__id__": 37
"__id__": 39
},
"targetOverrides": null
},
@@ -664,20 +689,20 @@
"mountedChildren": [],
"mountedComponents": [],
"propertyOverrides": [
{
"__id__": 38
},
{
"__id__": 40
},
{
"__id__": 41
},
{
"__id__": 42
},
{
"__id__": 43
},
{
"__id__": 44
},
{
"__id__": 45
}
],
"removedComponents": []
@@ -685,7 +710,7 @@
{
"__type__": "CCPropertyOverrideInfo",
"targetInfo": {
"__id__": 39
"__id__": 41
},
"propertyPath": [
"_name"
@@ -701,7 +726,7 @@
{
"__type__": "CCPropertyOverrideInfo",
"targetInfo": {
"__id__": 39
"__id__": 41
},
"propertyPath": [
"_lpos"
@@ -716,7 +741,7 @@
{
"__type__": "CCPropertyOverrideInfo",
"targetInfo": {
"__id__": 39
"__id__": 41
},
"propertyPath": [
"_lrot"
@@ -732,7 +757,7 @@
{
"__type__": "CCPropertyOverrideInfo",
"targetInfo": {
"__id__": 39
"__id__": 41
},
"propertyPath": [
"_euler"
@@ -747,7 +772,7 @@
{
"__type__": "CCPropertyOverrideInfo",
"targetInfo": {
"__id__": 39
"__id__": 41
},
"propertyPath": [
"_active"
@@ -761,14 +786,14 @@
"__id__": 1
},
"_prefab": {
"__id__": 45
"__id__": 47
},
"__editorExtras__": {}
},
{
"__type__": "cc.PrefabInfo",
"root": {
"__id__": 44
"__id__": 46
},
"asset": {
"__uuid__": "ae4493bd-cbcc-4392-921c-3e2b0fcd5338",
@@ -776,7 +801,7 @@
},
"fileId": "91yoyAQGNDm5ziI7NUChZ+",
"instance": {
"__id__": 46
"__id__": 48
},
"targetOverrides": null
},
@@ -789,20 +814,20 @@
"mountedChildren": [],
"mountedComponents": [],
"propertyOverrides": [
{
"__id__": 47
},
{
"__id__": 49
},
{
"__id__": 50
},
{
"__id__": 51
},
{
"__id__": 52
},
{
"__id__": 53
},
{
"__id__": 54
}
],
"removedComponents": []
@@ -810,7 +835,7 @@
{
"__type__": "CCPropertyOverrideInfo",
"targetInfo": {
"__id__": 48
"__id__": 50
},
"propertyPath": [
"_name"
@@ -826,7 +851,7 @@
{
"__type__": "CCPropertyOverrideInfo",
"targetInfo": {
"__id__": 48
"__id__": 50
},
"propertyPath": [
"_lpos"
@@ -841,7 +866,7 @@
{
"__type__": "CCPropertyOverrideInfo",
"targetInfo": {
"__id__": 48
"__id__": 50
},
"propertyPath": [
"_lrot"
@@ -857,7 +882,7 @@
{
"__type__": "CCPropertyOverrideInfo",
"targetInfo": {
"__id__": 48
"__id__": 50
},
"propertyPath": [
"_euler"
@@ -872,7 +897,7 @@
{
"__type__": "CCPropertyOverrideInfo",
"targetInfo": {
"__id__": 48
"__id__": 50
},
"propertyPath": [
"_active"
@@ -889,7 +914,7 @@
},
"_enabled": true,
"__prefab": {
"__id__": 54
"__id__": 56
},
"_contentSize": {
"__type__": "cc.Size",
@@ -917,7 +942,7 @@
},
"_enabled": true,
"__prefab": {
"__id__": 56
"__id__": 58
},
"anm": {
"__id__": 5
@@ -932,13 +957,12 @@
"__type__": "873f8d+SolMEo8DiTTxZRh4",
"_name": "",
"_objFlags": 0,
"__editorExtras__": {},
"node": {
"__id__": 1
},
"_enabled": true,
"__prefab": {
"__id__": 58
"__id__": 60
},
"_id": ""
},
@@ -956,7 +980,7 @@
},
"_enabled": true,
"__prefab": {
"__id__": 60
"__id__": 62
},
"enabledContactListener": true,
"bullet": false,
@@ -990,7 +1014,7 @@
},
"_enabled": true,
"__prefab": {
"__id__": 62
"__id__": 64
},
"tag": 0,
"_group": 4,
@@ -1027,16 +1051,16 @@
"targetOverrides": null,
"nestedPrefabInstanceRoots": [
{
"__id__": 44
"__id__": 46
},
{
"__id__": 35
"__id__": 37
},
{
"__id__": 24
"__id__": 26
},
{
"__id__": 12
"__id__": 14
}
]
}