diff --git a/.codely/clipboard/clipboard-1790394631163.png b/.codely/clipboard/clipboard-1790394631163.png deleted file mode 100644 index a513e02..0000000 Binary files a/.codely/clipboard/clipboard-1790394631163.png and /dev/null differ diff --git a/.codely/clipboard/clipboard-1790668979158.png b/.codely/clipboard/clipboard-1790668979158.png new file mode 100644 index 0000000..be9f621 Binary files /dev/null and b/.codely/clipboard/clipboard-1790668979158.png differ diff --git a/Assets/Prefabs/第一章/人类士兵.prefab b/Assets/Prefabs/第一章/人类士兵.prefab index 14cb25f..58d6b8c 100644 --- a/Assets/Prefabs/第一章/人类士兵.prefab +++ b/Assets/Prefabs/第一章/人类士兵.prefab @@ -402,10 +402,10 @@ NavMeshAgent: m_GameObject: {fileID: 7945271050725079514} m_Enabled: 1 m_AgentTypeID: 0 - m_Radius: 0.5 + m_Radius: 0.7 m_Speed: 1.8 m_Acceleration: 8 - avoidancePriority: 50 + avoidancePriority: 35 m_AngularSpeed: 120 m_StoppingDistance: 0 m_AutoTraverseOffMeshLink: 1 diff --git a/Assets/Prefabs/第一章/小怪/城堡弓童.prefab b/Assets/Prefabs/第一章/小怪/城堡弓童.prefab index 80e99be..0b0d4b9 100644 --- a/Assets/Prefabs/第一章/小怪/城堡弓童.prefab +++ b/Assets/Prefabs/第一章/小怪/城堡弓童.prefab @@ -145,17 +145,17 @@ PrefabInstance: - target: {fileID: 2733343371218911198, guid: 588bce5844a3f4b22a97acad504461e6, type: 3} propertyPath: m_LocalScale.x - value: 0.55 + value: 3.5 objectReference: {fileID: 0} - target: {fileID: 2733343371218911198, guid: 588bce5844a3f4b22a97acad504461e6, type: 3} propertyPath: m_LocalScale.y - value: 0.33 + value: 2.1 objectReference: {fileID: 0} - target: {fileID: 2733343371218911198, guid: 588bce5844a3f4b22a97acad504461e6, type: 3} propertyPath: m_LocalScale.z - value: 0.55 + value: 3.5 objectReference: {fileID: 0} - target: {fileID: 2733343371218911198, guid: 588bce5844a3f4b22a97acad504461e6, type: 3} @@ -210,7 +210,7 @@ PrefabInstance: - target: {fileID: 7413351822284119071, guid: 588bce5844a3f4b22a97acad504461e6, type: 3} propertyPath: m_Color.a - value: 0.35 + value: 1 objectReference: {fileID: 0} m_RemovedComponents: [] m_RemovedGameObjects: [] @@ -462,10 +462,10 @@ NavMeshAgent: m_GameObject: {fileID: 5353056374797990493} m_Enabled: 1 m_AgentTypeID: 0 - m_Radius: 0.5 + m_Radius: 0.65 m_Speed: 3.5 m_Acceleration: 8 - avoidancePriority: 50 + avoidancePriority: 58 m_AngularSpeed: 120 m_StoppingDistance: 5.7 m_AutoTraverseOffMeshLink: 1 diff --git a/Assets/Prefabs/第一章/小怪/城堡蓝卫Q.prefab b/Assets/Prefabs/第一章/小怪/城堡蓝卫Q.prefab index 942abc4..da87d1a 100644 --- a/Assets/Prefabs/第一章/小怪/城堡蓝卫Q.prefab +++ b/Assets/Prefabs/第一章/小怪/城堡蓝卫Q.prefab @@ -15,17 +15,17 @@ PrefabInstance: - target: {fileID: 2733343371218911198, guid: 588bce5844a3f4b22a97acad504461e6, type: 3} propertyPath: m_LocalScale.x - value: 0.6 + value: 3.5 objectReference: {fileID: 0} - target: {fileID: 2733343371218911198, guid: 588bce5844a3f4b22a97acad504461e6, type: 3} propertyPath: m_LocalScale.y - value: 0.36 + value: 2.1 objectReference: {fileID: 0} - target: {fileID: 2733343371218911198, guid: 588bce5844a3f4b22a97acad504461e6, type: 3} propertyPath: m_LocalScale.z - value: 0.6 + value: 3.5 objectReference: {fileID: 0} - target: {fileID: 2733343371218911198, guid: 588bce5844a3f4b22a97acad504461e6, type: 3} @@ -80,7 +80,7 @@ PrefabInstance: - target: {fileID: 7413351822284119071, guid: 588bce5844a3f4b22a97acad504461e6, type: 3} propertyPath: m_Color.a - value: 0.35 + value: 1 objectReference: {fileID: 0} m_RemovedComponents: [] m_RemovedGameObjects: [] @@ -409,10 +409,10 @@ NavMeshAgent: m_GameObject: {fileID: 6831747914582959299} m_Enabled: 1 m_AgentTypeID: 0 - m_Radius: 0.5 + m_Radius: 0.65 m_Speed: 3.5 m_Acceleration: 8 - avoidancePriority: 50 + avoidancePriority: 55 m_AngularSpeed: 120 m_StoppingDistance: 1.425 m_AutoTraverseOffMeshLink: 1 diff --git a/Assets/Prefabs/第一章/小怪/城堡金盾卫.prefab b/Assets/Prefabs/第一章/小怪/城堡金盾卫.prefab index 62d49d9..cde6be7 100644 --- a/Assets/Prefabs/第一章/小怪/城堡金盾卫.prefab +++ b/Assets/Prefabs/第一章/小怪/城堡金盾卫.prefab @@ -109,17 +109,17 @@ PrefabInstance: - target: {fileID: 2733343371218911198, guid: 588bce5844a3f4b22a97acad504461e6, type: 3} propertyPath: m_LocalScale.x - value: 0.75 + value: 3.5 objectReference: {fileID: 0} - target: {fileID: 2733343371218911198, guid: 588bce5844a3f4b22a97acad504461e6, type: 3} propertyPath: m_LocalScale.y - value: 0.45000002 + value: 2.1 objectReference: {fileID: 0} - target: {fileID: 2733343371218911198, guid: 588bce5844a3f4b22a97acad504461e6, type: 3} propertyPath: m_LocalScale.z - value: 0.75 + value: 3.5 objectReference: {fileID: 0} - target: {fileID: 2733343371218911198, guid: 588bce5844a3f4b22a97acad504461e6, type: 3} @@ -174,7 +174,7 @@ PrefabInstance: - target: {fileID: 7413351822284119071, guid: 588bce5844a3f4b22a97acad504461e6, type: 3} propertyPath: m_Color.a - value: 0.35 + value: 1 objectReference: {fileID: 0} m_RemovedComponents: [] m_RemovedGameObjects: [] @@ -413,7 +413,7 @@ NavMeshAgent: m_GameObject: {fileID: 6097483073022240836} m_Enabled: 1 m_AgentTypeID: 0 - m_Radius: 0.5 + m_Radius: 0.65 m_Speed: 2.6 m_Acceleration: 6 avoidancePriority: 50 diff --git a/Assets/Prefabs/第一章/小怪/蓝角蛮卒.prefab b/Assets/Prefabs/第一章/小怪/蓝角蛮卒.prefab index 7d445d8..62a95c3 100644 --- a/Assets/Prefabs/第一章/小怪/蓝角蛮卒.prefab +++ b/Assets/Prefabs/第一章/小怪/蓝角蛮卒.prefab @@ -1,5 +1,98 @@ %YAML 1.1 %TAG !u! tag:yousandi.cn,2023: +--- !u!1001 &5373680895525663899 +PrefabInstance: + m_ObjectHideFlags: 0 + serializedVersion: 2 + m_Modification: + serializedVersion: 3 + m_TransformParent: {fileID: 5972527175421201135} + m_Modifications: + - target: {fileID: 716420681276659, guid: 588bce5844a3f4b22a97acad504461e6, type: 3} + propertyPath: m_Name + value: ShadowBlob + objectReference: {fileID: 0} + - target: {fileID: 2733343371218911198, guid: 588bce5844a3f4b22a97acad504461e6, + type: 3} + propertyPath: m_LocalScale.x + value: 3.5 + objectReference: {fileID: 0} + - target: {fileID: 2733343371218911198, guid: 588bce5844a3f4b22a97acad504461e6, + type: 3} + propertyPath: m_LocalScale.y + value: 2.1 + objectReference: {fileID: 0} + - target: {fileID: 2733343371218911198, guid: 588bce5844a3f4b22a97acad504461e6, + type: 3} + propertyPath: m_LocalScale.z + value: 3.5 + objectReference: {fileID: 0} + - target: {fileID: 2733343371218911198, guid: 588bce5844a3f4b22a97acad504461e6, + type: 3} + propertyPath: m_LocalPosition.x + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 2733343371218911198, guid: 588bce5844a3f4b22a97acad504461e6, + type: 3} + propertyPath: m_LocalPosition.y + value: 0.015 + objectReference: {fileID: 0} + - target: {fileID: 2733343371218911198, guid: 588bce5844a3f4b22a97acad504461e6, + type: 3} + propertyPath: m_LocalPosition.z + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 2733343371218911198, guid: 588bce5844a3f4b22a97acad504461e6, + type: 3} + propertyPath: m_LocalRotation.w + value: 0.7071068 + objectReference: {fileID: 0} + - target: {fileID: 2733343371218911198, guid: 588bce5844a3f4b22a97acad504461e6, + type: 3} + propertyPath: m_LocalRotation.x + value: 0.7071068 + objectReference: {fileID: 0} + - target: {fileID: 2733343371218911198, guid: 588bce5844a3f4b22a97acad504461e6, + type: 3} + propertyPath: m_LocalRotation.y + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 2733343371218911198, guid: 588bce5844a3f4b22a97acad504461e6, + type: 3} + propertyPath: m_LocalRotation.z + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 2733343371218911198, guid: 588bce5844a3f4b22a97acad504461e6, + type: 3} + propertyPath: m_LocalEulerAnglesHint.x + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 2733343371218911198, guid: 588bce5844a3f4b22a97acad504461e6, + type: 3} + propertyPath: m_LocalEulerAnglesHint.y + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 2733343371218911198, guid: 588bce5844a3f4b22a97acad504461e6, + type: 3} + propertyPath: m_LocalEulerAnglesHint.z + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 7413351822284119071, guid: 588bce5844a3f4b22a97acad504461e6, + type: 3} + propertyPath: m_Color.a + value: 1 + objectReference: {fileID: 0} + m_RemovedComponents: [] + m_RemovedGameObjects: [] + m_AddedGameObjects: [] + m_AddedComponents: [] + m_SourcePrefab: {fileID: 100100000, guid: 588bce5844a3f4b22a97acad504461e6, type: 3} +--- !u!4 &8033840221365193541 stripped +Transform: + m_CorrespondingSourceObject: {fileID: 2733343371218911198, guid: 588bce5844a3f4b22a97acad504461e6, + type: 3} + m_PrefabInstance: {fileID: 5373680895525663899} + m_PrefabAsset: {fileID: 0} --- !u!1001 &6154191632668585220 PrefabInstance: m_ObjectHideFlags: 0 @@ -75,7 +168,11 @@ PrefabInstance: objectReference: {fileID: 9100000, guid: dcd6c5d547650449dbe66bdadf484951, type: 2} m_RemovedComponents: [] m_RemovedGameObjects: [] - m_AddedGameObjects: [] + m_AddedGameObjects: + - targetCorrespondingSourceObject: {fileID: -8679921383154817045, guid: 277440f23387a46aa83d5db718a19dbb, + type: 3} + insertIndex: -1 + addedObject: {fileID: 8033840221365193541} m_AddedComponents: - targetCorrespondingSourceObject: {fileID: 919132149155446097, guid: 277440f23387a46aa83d5db718a19dbb, type: 3} @@ -102,6 +199,12 @@ PrefabInstance: insertIndex: -1 addedObject: {fileID: 8356120077022717922} m_SourcePrefab: {fileID: 100100000, guid: 277440f23387a46aa83d5db718a19dbb, type: 3} +--- !u!4 &5972527175421201135 stripped +Transform: + m_CorrespondingSourceObject: {fileID: -8679921383154817045, guid: 277440f23387a46aa83d5db718a19dbb, + type: 3} + m_PrefabInstance: {fileID: 6154191632668585220} + m_PrefabAsset: {fileID: 0} --- !u!1 &6460833124399534165 stripped GameObject: m_CorrespondingSourceObject: {fileID: 919132149155446097, guid: 277440f23387a46aa83d5db718a19dbb, @@ -149,6 +252,8 @@ MonoBehaviour: energyPerAttack: 0 targetSpreadBias: 6 summonerMode: 0 + returnToAnchorWhenIdle: 0 + anchorArrivalDistance: 0.35 target: {fileID: 0} --- !u!114 &4885855534280859690 MonoBehaviour: @@ -199,10 +304,10 @@ NavMeshAgent: m_GameObject: {fileID: 6460833124399534165} m_Enabled: 1 m_AgentTypeID: 0 - m_Radius: 0.5 + m_Radius: 0.65 m_Speed: 3.5 m_Acceleration: 8 - avoidancePriority: 50 + avoidancePriority: 55 m_AngularSpeed: 120 m_StoppingDistance: 1.425 m_AutoTraverseOffMeshLink: 1 diff --git a/Assets/Prefabs/第一章/弓箭手.prefab b/Assets/Prefabs/第一章/弓箭手.prefab index 031b43d..e5060cd 100644 --- a/Assets/Prefabs/第一章/弓箭手.prefab +++ b/Assets/Prefabs/第一章/弓箭手.prefab @@ -307,10 +307,10 @@ NavMeshAgent: m_GameObject: {fileID: 5200308054099318121} m_Enabled: 1 m_AgentTypeID: 0 - m_Radius: 0.5 + m_Radius: 0.7 m_Speed: 1.8 m_Acceleration: 8 - avoidancePriority: 50 + avoidancePriority: 38 m_AngularSpeed: 120 m_StoppingDistance: 0 m_AutoTraverseOffMeshLink: 1 @@ -479,17 +479,17 @@ PrefabInstance: - target: {fileID: 2733343371218911198, guid: 588bce5844a3f4b22a97acad504461e6, type: 3} propertyPath: m_LocalScale.x - value: 0.85 + value: 4.81 objectReference: {fileID: 0} - target: {fileID: 2733343371218911198, guid: 588bce5844a3f4b22a97acad504461e6, type: 3} propertyPath: m_LocalScale.y - value: 0.51000005 + value: 2.886 objectReference: {fileID: 0} - target: {fileID: 2733343371218911198, guid: 588bce5844a3f4b22a97acad504461e6, type: 3} propertyPath: m_LocalScale.z - value: 0.85 + value: 4.81 objectReference: {fileID: 0} - target: {fileID: 2733343371218911198, guid: 588bce5844a3f4b22a97acad504461e6, type: 3} @@ -544,7 +544,7 @@ PrefabInstance: - target: {fileID: 7413351822284119071, guid: 588bce5844a3f4b22a97acad504461e6, type: 3} propertyPath: m_Color.a - value: 0.45 + value: 1 objectReference: {fileID: 0} m_RemovedComponents: [] m_RemovedGameObjects: [] diff --git a/Assets/Prefabs/第一章/法师.prefab b/Assets/Prefabs/第一章/法师.prefab index 472731a..60a5d02 100644 --- a/Assets/Prefabs/第一章/法师.prefab +++ b/Assets/Prefabs/第一章/法师.prefab @@ -48,17 +48,17 @@ PrefabInstance: - target: {fileID: 2733343371218911198, guid: 588bce5844a3f4b22a97acad504461e6, type: 3} propertyPath: m_LocalScale.x - value: 0.85 + value: 4.81 objectReference: {fileID: 0} - target: {fileID: 2733343371218911198, guid: 588bce5844a3f4b22a97acad504461e6, type: 3} propertyPath: m_LocalScale.y - value: 0.51000005 + value: 2.886 objectReference: {fileID: 0} - target: {fileID: 2733343371218911198, guid: 588bce5844a3f4b22a97acad504461e6, type: 3} propertyPath: m_LocalScale.z - value: 0.85 + value: 4.81 objectReference: {fileID: 0} - target: {fileID: 2733343371218911198, guid: 588bce5844a3f4b22a97acad504461e6, type: 3} @@ -113,7 +113,7 @@ PrefabInstance: - target: {fileID: 7413351822284119071, guid: 588bce5844a3f4b22a97acad504461e6, type: 3} propertyPath: m_Color.a - value: 0.45 + value: 1 objectReference: {fileID: 0} m_RemovedComponents: [] m_RemovedGameObjects: [] @@ -383,10 +383,10 @@ NavMeshAgent: m_GameObject: {fileID: 7062617501994129594} m_Enabled: 1 m_AgentTypeID: 0 - m_Radius: 0.5 + m_Radius: 0.7 m_Speed: 1.5 m_Acceleration: 8 - avoidancePriority: 50 + avoidancePriority: 38 m_AngularSpeed: 120 m_StoppingDistance: 0 m_AutoTraverseOffMeshLink: 1 diff --git a/Assets/Prefabs/第一章/盾卫.prefab b/Assets/Prefabs/第一章/盾卫.prefab index 4f92bfd..9e48348 100644 --- a/Assets/Prefabs/第一章/盾卫.prefab +++ b/Assets/Prefabs/第一章/盾卫.prefab @@ -363,10 +363,10 @@ NavMeshAgent: m_GameObject: {fileID: 1242979668690031507} m_Enabled: 1 m_AgentTypeID: 0 - m_Radius: 0.5 + m_Radius: 0.7 m_Speed: 1.4 m_Acceleration: 8 - avoidancePriority: 50 + avoidancePriority: 30 m_AngularSpeed: 120 m_StoppingDistance: 0 m_AutoTraverseOffMeshLink: 1 @@ -413,10 +413,20 @@ PrefabInstance: propertyPath: m_Name value: ShadowBlob objectReference: {fileID: 0} + - target: {fileID: 2733343371218911198, guid: 588bce5844a3f4b22a97acad504461e6, + type: 3} + propertyPath: m_LocalScale.x + value: 4.81 + objectReference: {fileID: 0} - target: {fileID: 2733343371218911198, guid: 588bce5844a3f4b22a97acad504461e6, type: 3} propertyPath: m_LocalScale.y - value: 0.6 + value: 2.886 + objectReference: {fileID: 0} + - target: {fileID: 2733343371218911198, guid: 588bce5844a3f4b22a97acad504461e6, + type: 3} + propertyPath: m_LocalScale.z + value: 4.81 objectReference: {fileID: 0} - target: {fileID: 2733343371218911198, guid: 588bce5844a3f4b22a97acad504461e6, type: 3} @@ -471,7 +481,7 @@ PrefabInstance: - target: {fileID: 7413351822284119071, guid: 588bce5844a3f4b22a97acad504461e6, type: 3} propertyPath: m_Color.a - value: 0.45 + value: 1 objectReference: {fileID: 0} m_RemovedComponents: [] m_RemovedGameObjects: [] diff --git a/Assets/Prefabs/第一章/精锐士兵.prefab b/Assets/Prefabs/第一章/精锐士兵.prefab index 6c4b622..69ceae5 100644 --- a/Assets/Prefabs/第一章/精锐士兵.prefab +++ b/Assets/Prefabs/第一章/精锐士兵.prefab @@ -348,10 +348,10 @@ NavMeshAgent: m_GameObject: {fileID: 3933539425749946856} m_Enabled: 1 m_AgentTypeID: 0 - m_Radius: 0.5 + m_Radius: 0.7 m_Speed: 2 m_Acceleration: 8 - avoidancePriority: 50 + avoidancePriority: 35 m_AngularSpeed: 120 m_StoppingDistance: 0 m_AutoTraverseOffMeshLink: 1 @@ -392,10 +392,20 @@ PrefabInstance: propertyPath: m_Name value: ShadowBlob objectReference: {fileID: 0} + - target: {fileID: 2733343371218911198, guid: 588bce5844a3f4b22a97acad504461e6, + type: 3} + propertyPath: m_LocalScale.x + value: 4.81 + objectReference: {fileID: 0} - target: {fileID: 2733343371218911198, guid: 588bce5844a3f4b22a97acad504461e6, type: 3} propertyPath: m_LocalScale.y - value: 0.6 + value: 2.886 + objectReference: {fileID: 0} + - target: {fileID: 2733343371218911198, guid: 588bce5844a3f4b22a97acad504461e6, + type: 3} + propertyPath: m_LocalScale.z + value: 4.81 objectReference: {fileID: 0} - target: {fileID: 2733343371218911198, guid: 588bce5844a3f4b22a97acad504461e6, type: 3} @@ -450,7 +460,7 @@ PrefabInstance: - target: {fileID: 7413351822284119071, guid: 588bce5844a3f4b22a97acad504461e6, type: 3} propertyPath: m_Color.a - value: 0.45 + value: 1 objectReference: {fileID: 0} m_RemovedComponents: [] m_RemovedGameObjects: [] diff --git a/Assets/Resources/Data/人类士兵Data.asset b/Assets/Resources/Data/人类士兵Data.asset index 2e6b586..bd3c299 100644 --- a/Assets/Resources/Data/人类士兵Data.asset +++ b/Assets/Resources/Data/人类士兵Data.asset @@ -19,8 +19,8 @@ MonoBehaviour: unitPrefab: {fileID: 7945271050725079514, guid: 04ae1b1fe51474dda8ae5daf0b1df7c1, type: 3} baseMaxHealth: 300 - baseAttackPower: 42 + baseAttackPower: 25 baseMoveSpeed: 2.2 healthPerLevel: 35 - attackPerLevel: 4 + attackPerLevel: 2 moveSpeedPerLevel: 0 diff --git a/Assets/Resources/Data/城堡弓童Data.asset b/Assets/Resources/Data/城堡弓童Data.asset index c9e9b31..8f295f8 100644 --- a/Assets/Resources/Data/城堡弓童Data.asset +++ b/Assets/Resources/Data/城堡弓童Data.asset @@ -19,7 +19,7 @@ MonoBehaviour: unitPrefab: {fileID: 5353056374797990493, guid: c441f52bd7de14f7980881b0aff3ed62, type: 3} baseMaxHealth: 150 - baseAttackPower: 28 + baseAttackPower: 17 baseMoveSpeed: 3.5 healthPerLevel: 0 attackPerLevel: 0 diff --git a/Assets/Resources/Data/城堡蓝卫QData.asset b/Assets/Resources/Data/城堡蓝卫QData.asset index 8ff7bcb..e31c7f3 100644 --- a/Assets/Resources/Data/城堡蓝卫QData.asset +++ b/Assets/Resources/Data/城堡蓝卫QData.asset @@ -19,7 +19,7 @@ MonoBehaviour: unitPrefab: {fileID: 6831747914582959299, guid: 1fed8c7a79ffa4ce386e4b260c81330d, type: 3} baseMaxHealth: 170 - baseAttackPower: 22 + baseAttackPower: 13 baseMoveSpeed: 3.5 healthPerLevel: 0 attackPerLevel: 0 diff --git a/Assets/Resources/Data/城堡金盾卫Data.asset b/Assets/Resources/Data/城堡金盾卫Data.asset index 3ec6ac1..f8baf72 100644 --- a/Assets/Resources/Data/城堡金盾卫Data.asset +++ b/Assets/Resources/Data/城堡金盾卫Data.asset @@ -19,7 +19,7 @@ MonoBehaviour: unitPrefab: {fileID: 6097483073022240836, guid: ec2510b8f554e42d89d7aad24ddded11, type: 3} baseMaxHealth: 360 - baseAttackPower: 36 + baseAttackPower: 22 baseMoveSpeed: 2.6 healthPerLevel: 0 attackPerLevel: 0 diff --git a/Assets/Resources/Data/弓箭手Data.asset b/Assets/Resources/Data/弓箭手Data.asset index ebbf165..bb27f3b 100644 --- a/Assets/Resources/Data/弓箭手Data.asset +++ b/Assets/Resources/Data/弓箭手Data.asset @@ -19,8 +19,8 @@ MonoBehaviour: unitPrefab: {fileID: 5200308054099318121, guid: 7d2074c48a1b3544eb534bb509ffc845, type: 3} baseMaxHealth: 220 - baseAttackPower: 55 + baseAttackPower: 33 baseMoveSpeed: 2 healthPerLevel: 25 - attackPerLevel: 5 + attackPerLevel: 3 moveSpeedPerLevel: 0 diff --git a/Assets/Resources/Data/弓箭猎人Data.asset b/Assets/Resources/Data/弓箭猎人Data.asset index d4bc9a8..8b64cf4 100644 --- a/Assets/Resources/Data/弓箭猎人Data.asset +++ b/Assets/Resources/Data/弓箭猎人Data.asset @@ -18,12 +18,8 @@ MonoBehaviour: cardIcon: {fileID: 21300000, guid: cce78877f842f5c4e863240a06535cc4, type: 3} unitPrefab: {fileID: 4059575966999087028, guid: 4331d3c67d9c243cf8320a3a815cd03c, type: 3} - manaCost: 3 - cooldownTime: 1 - productionInterval: 8 - buildingCost: 120 baseMaxHealth: 220 - baseAttackPower: 35 + baseAttackPower: 21 baseMoveSpeed: 2.2 healthPerLevel: 20 attackPerLevel: 1 diff --git a/Assets/Resources/Data/法师Data.asset b/Assets/Resources/Data/法师Data.asset index 34e23ad..47f8b55 100644 --- a/Assets/Resources/Data/法师Data.asset +++ b/Assets/Resources/Data/法师Data.asset @@ -19,8 +19,8 @@ MonoBehaviour: unitPrefab: {fileID: 7062617501994129594, guid: 6fb249c0311f442ecb190db77248eafc, type: 3} baseMaxHealth: 240 - baseAttackPower: 100 + baseAttackPower: 60 baseMoveSpeed: 1.7 healthPerLevel: 22 - attackPerLevel: 8 + attackPerLevel: 5 moveSpeedPerLevel: 0 diff --git a/Assets/Resources/Data/狂暴狼人Data.asset b/Assets/Resources/Data/狂暴狼人Data.asset index a8f51dc..606d5e0 100644 --- a/Assets/Resources/Data/狂暴狼人Data.asset +++ b/Assets/Resources/Data/狂暴狼人Data.asset @@ -18,13 +18,9 @@ MonoBehaviour: cardIcon: {fileID: 21300000, guid: 828dd51ecae0cc3418d2f1f675ffba3e, type: 3} unitPrefab: {fileID: 6708744566382593167, guid: f3b0d9efccd74475dbbbcdc1ddcdf129, type: 3} - manaCost: 4 - cooldownTime: 1 - productionInterval: 10 - buildingCost: 150 baseMaxHealth: 360 - baseAttackPower: 36 + baseAttackPower: 22 baseMoveSpeed: 2.5 healthPerLevel: 38 - attackPerLevel: 3 + attackPerLevel: 2 moveSpeedPerLevel: 0 diff --git a/Assets/Resources/Data/盾卫Data.asset b/Assets/Resources/Data/盾卫Data.asset index f9ad2a7..9f50a9d 100644 --- a/Assets/Resources/Data/盾卫Data.asset +++ b/Assets/Resources/Data/盾卫Data.asset @@ -19,8 +19,8 @@ MonoBehaviour: unitPrefab: {fileID: 1242979668690031507, guid: 5a43e36885a204515891085639dd22c4, type: 3} baseMaxHealth: 700 - baseAttackPower: 30 + baseAttackPower: 18 baseMoveSpeed: 1.6 healthPerLevel: 80 - attackPerLevel: 3 + attackPerLevel: 2 moveSpeedPerLevel: 0 diff --git a/Assets/Resources/Data/石巨人Data.asset b/Assets/Resources/Data/石巨人Data.asset index ab14c7e..ea36a28 100644 --- a/Assets/Resources/Data/石巨人Data.asset +++ b/Assets/Resources/Data/石巨人Data.asset @@ -18,13 +18,9 @@ MonoBehaviour: cardIcon: {fileID: 21300000, guid: 7a686535436b593458a50fecbe0315ce, type: 3} unitPrefab: {fileID: 4471054466352856454, guid: 52e49b3af34914387b829cef0563b36e, type: 3} - manaCost: 7 - cooldownTime: 1 - productionInterval: 20 - buildingCost: 250 baseMaxHealth: 1300 - baseAttackPower: 95 + baseAttackPower: 57 baseMoveSpeed: 1.1 healthPerLevel: 140 - attackPerLevel: 9 + attackPerLevel: 5 moveSpeedPerLevel: 0 diff --git a/Assets/Resources/Data/精锐士兵Data.asset b/Assets/Resources/Data/精锐士兵Data.asset index 9ffd327..e4fe882 100644 --- a/Assets/Resources/Data/精锐士兵Data.asset +++ b/Assets/Resources/Data/精锐士兵Data.asset @@ -19,8 +19,8 @@ MonoBehaviour: unitPrefab: {fileID: 3933539425749946856, guid: 6be579752d2424feea054ce267928002, type: 3} baseMaxHealth: 520 - baseAttackPower: 78 + baseAttackPower: 47 baseMoveSpeed: 2 healthPerLevel: 50 - attackPerLevel: 6 + attackPerLevel: 4 moveSpeedPerLevel: 0 diff --git a/Assets/Resources/Data/绿色史莱姆Data.asset b/Assets/Resources/Data/绿色史莱姆Data.asset index 56d9183..0cd5e02 100644 --- a/Assets/Resources/Data/绿色史莱姆Data.asset +++ b/Assets/Resources/Data/绿色史莱姆Data.asset @@ -17,11 +17,9 @@ MonoBehaviour: description: cardIcon: {fileID: 0} unitPrefab: {fileID: 0} - manaCost: 1 - cooldownTime: 1 baseMaxHealth: 150 - baseAttackPower: 18 + baseAttackPower: 11 baseMoveSpeed: 3 healthPerLevel: 7.5 - attackPerLevel: 0.9 + attackPerLevel: 1 moveSpeedPerLevel: 0 diff --git a/Assets/Resources/Data/荒野之王Data.asset b/Assets/Resources/Data/荒野之王Data.asset index 13ea3f7..4333439 100644 --- a/Assets/Resources/Data/荒野之王Data.asset +++ b/Assets/Resources/Data/荒野之王Data.asset @@ -17,11 +17,9 @@ MonoBehaviour: description: cardIcon: {fileID: 0} unitPrefab: {fileID: 0} - manaCost: 8 - cooldownTime: 1 baseMaxHealth: 900 - baseAttackPower: 82 + baseAttackPower: 49 baseMoveSpeed: 2.8 healthPerLevel: 45 - attackPerLevel: 4.1 + attackPerLevel: 2 moveSpeedPerLevel: 0 diff --git a/Assets/Resources/Data/荒野流寇Data.asset b/Assets/Resources/Data/荒野流寇Data.asset index 8a6423c..d755ae2 100644 --- a/Assets/Resources/Data/荒野流寇Data.asset +++ b/Assets/Resources/Data/荒野流寇Data.asset @@ -17,11 +17,9 @@ MonoBehaviour: description: cardIcon: {fileID: 0} unitPrefab: {fileID: 0} - manaCost: 2 - cooldownTime: 1 baseMaxHealth: 240 - baseAttackPower: 30 + baseAttackPower: 18 baseMoveSpeed: 3.5 healthPerLevel: 12 - attackPerLevel: 1.5 + attackPerLevel: 1 moveSpeedPerLevel: 0 diff --git a/Assets/Resources/Data/荒野祭司Data.asset b/Assets/Resources/Data/荒野祭司Data.asset index cd83b68..2397b0a 100644 --- a/Assets/Resources/Data/荒野祭司Data.asset +++ b/Assets/Resources/Data/荒野祭司Data.asset @@ -17,11 +17,9 @@ MonoBehaviour: description: cardIcon: {fileID: 0} unitPrefab: {fileID: 0} - manaCost: 5 - cooldownTime: 1 baseMaxHealth: 260 - baseAttackPower: 24 + baseAttackPower: 14 baseMoveSpeed: 3 healthPerLevel: 13 - attackPerLevel: 1.2 + attackPerLevel: 1 moveSpeedPerLevel: 0 diff --git a/Assets/Resources/Data/蓝色怪物Data.asset b/Assets/Resources/Data/蓝色怪物Data.asset index a5152cb..a90b99e 100644 --- a/Assets/Resources/Data/蓝色怪物Data.asset +++ b/Assets/Resources/Data/蓝色怪物Data.asset @@ -17,12 +17,8 @@ MonoBehaviour: description: cardIcon: {fileID: 0} unitPrefab: {fileID: 0} - manaCost: 1 - cooldownTime: 1 - productionInterval: 5 - buildingCost: 80 baseMaxHealth: 340 - baseAttackPower: 16 + baseAttackPower: 10 baseMoveSpeed: 1.6 healthPerLevel: 34 attackPerLevel: 1 diff --git a/Assets/Scenes/DefenseTest.scene b/Assets/Scenes/DefenseTest.scene index fede4d1..3125176 100644 Binary files a/Assets/Scenes/DefenseTest.scene and b/Assets/Scenes/DefenseTest.scene differ diff --git a/Assets/Script/AutoBindHeroes.cs b/Assets/Script/AutoBindHeroes.cs new file mode 100644 index 0000000..658f26a --- /dev/null +++ b/Assets/Script/AutoBindHeroes.cs @@ -0,0 +1,137 @@ +using UnityEngine; +using System.Collections.Generic; + +/// +/// 自动绑定友方英雄到UI卡片(Play Mode自动运行) +/// +public class AutoBindHeroes : MonoBehaviour +{ + [Header("UI引用")] + [Tooltip("英雄卡片面板的父物体")] + public Transform heroCardsPanel; + + [Header("英雄头像资源")] + public Sprite soldierIcon; + public Sprite archerIcon; + public Sprite shieldIcon; + public Sprite mageIcon; + public Sprite eliteSoldierIcon; + + private bool hasBindOnce = false; + + void Start() + { + // 延迟1秒等待所有英雄生成 + Invoke(nameof(BindHeroesToCards), 1f); + } + + void BindHeroesToCards() + { + if (hasBindOnce) + { + Debug.LogWarning("英雄已经绑定过了,跳过重复绑定"); + return; + } + + if (heroCardsPanel == null) + { + Debug.LogError("AutoBindHeroes: heroCardsPanel 未赋值!"); + return; + } + + // 1. 查找所有友方英雄(teamId=0) + var allUnits = FindObjectsOfType(); + var heroes = new List(); + + foreach (var unit in allUnits) + { + var team = unit.GetComponent(); + if (team != null && team.teamId == 0) + { + heroes.Add(unit); + } + } + + if (heroes.Count == 0) + { + Debug.LogWarning("AutoBindHeroes: 未找到友方英雄(teamId=0)"); + return; + } + + Debug.Log($"AutoBindHeroes: 找到 {heroes.Count} 个友方英雄"); + + // 2. 设置所有英雄为可复活 + foreach (var hero in heroes) + { + var health = hero.GetComponent(); + if (health != null) + { + health.canRevive = true; + } + } + + // 3. 绑定到UI卡片(最多5个) + int bindCount = Mathf.Min(heroes.Count, 5); + for (int i = 0; i < bindCount; i++) + { + var hero = heroes[i]; + var cardObj = heroCardsPanel.Find($"HeroCard{i + 1}"); + + if (cardObj == null) + { + Debug.LogWarning($"AutoBindHeroes: 未找到 HeroCard{i + 1}"); + continue; + } + + var heroCardUI = cardObj.GetComponent(); + if (heroCardUI == null) + { + Debug.LogWarning($"AutoBindHeroes: HeroCard{i + 1} 缺少 HeroCardUI 组件"); + continue; + } + + // 根据英雄名字匹配头像 + Sprite icon = GetHeroIcon(hero.name); + if (icon == null) + { + Debug.LogWarning($"AutoBindHeroes: {hero.name} 没有匹配的头像,使用默认图标"); + } + + // 绑定英雄 + heroCardUI.SetHero(hero, icon, hero.transform.position); + Debug.Log($"✅ HeroCard{i + 1} 已绑定: {hero.name}"); + } + + hasBindOnce = true; + Debug.Log($"✅ 英雄自动绑定完成!共绑定 {bindCount} 个英雄"); + } + + /// + /// 根据英雄名字获取对应头像 + /// + Sprite GetHeroIcon(string heroName) + { + if (heroName.Contains("人类士兵") || heroName.Contains("士兵")) + { + return soldierIcon; + } + else if (heroName.Contains("弓箭手") || heroName.Contains("弓箭")) + { + return archerIcon; + } + else if (heroName.Contains("盾卫")) + { + return shieldIcon; + } + else if (heroName.Contains("法师")) + { + return mageIcon; + } + else if (heroName.Contains("精锐")) + { + return eliteSoldierIcon; + } + + return null; + } +} diff --git a/Assets/Script/AutoBindHeroes.cs.meta b/Assets/Script/AutoBindHeroes.cs.meta new file mode 100644 index 0000000..c0f35fb --- /dev/null +++ b/Assets/Script/AutoBindHeroes.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: BntLsXv+VCiekq1pfBLqrcgPxyOKiyT9GMwu39MKq/rePWiFpCWwjlw= +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/Script/BattleFormationSpawner.cs b/Assets/Script/BattleFormationSpawner.cs index 46e4679..a6843ed 100644 --- a/Assets/Script/BattleFormationSpawner.cs +++ b/Assets/Script/BattleFormationSpawner.cs @@ -19,6 +19,7 @@ public class BattleFormationSpawner : MonoBehaviour private void Start() { + spawnedHeroCount = 0; // 重置计数器 SpawnHeroes(); } @@ -88,10 +89,13 @@ public class BattleFormationSpawner : MonoBehaviour return -1; } + private static int spawnedHeroCount = 0; // 记录已生成英雄数量 + private void Spawn(GameObject prefab, int cell) { CharacterData characterData = FindCharacterDataForPrefab(prefab); - GameObject unit = Instantiate(prefab, DeployGrid.CellPosition(cell), Quaternion.identity); + Vector3 spawnPos = DeployGrid.CellPosition(cell); + GameObject unit = Instantiate(prefab, spawnPos, Quaternion.identity); unit.name = "英雄_" + prefab.name; if (heroParent != null) @@ -123,6 +127,49 @@ public class BattleFormationSpawner : MonoBehaviour characterData.GetAttackPower(level), characterData.GetMoveSpeed(level)); } + + // 设置友方英雄可复活 + WorldHealthBar healthBar = unit.GetComponent(); + if (healthBar != null && playerTeamId == 0) + { + healthBar.canRevive = true; + } + + // 绑定到英雄卡片UI + BindHeroToCard(unit, characterData, spawnPos); + } + + private void BindHeroToCard(GameObject heroUnit, CharacterData characterData, Vector3 spawnPos) + { + if (spawnedHeroCount >= 5) return; // 最多5个英雄 + + // 查找对应的卡片 + Canvas canvas = FindObjectOfType(); + if (canvas == null) return; + + Transform heroPanel = canvas.transform.Find("BottomUI/HeroCardsPanel"); + if (heroPanel == null) return; + + string cardName = $"HeroCard{spawnedHeroCount + 1}"; + Transform cardObj = heroPanel.Find(cardName); + if (cardObj == null) return; + + HeroCardUI heroCardUI = cardObj.GetComponent(); + if (heroCardUI == null) return; + + // 获取英雄单位组件 + UnitBase unitBase = heroUnit.GetComponent(); + if (unitBase == null) return; + + // 加载对应的头像 + UnityEngine.Sprite icon = characterData != null ? characterData.cardIcon : null; + + // 绑定英雄到卡片 + heroCardUI.SetHero(unitBase, icon, spawnPos); + + spawnedHeroCount++; + + Debug.Log($"英雄 {heroUnit.name} 已绑定到 {cardName}"); } private CharacterData FindCharacterDataForPrefab(GameObject prefab) diff --git a/Assets/Script/BuffSystem.cs b/Assets/Script/BuffSystem.cs new file mode 100644 index 0000000..c41ebd0 --- /dev/null +++ b/Assets/Script/BuffSystem.cs @@ -0,0 +1,128 @@ +using UnityEngine; +using System.Collections.Generic; + +/// +/// 增益系统管理器(单例) +/// 管理全局增益效果的应用 +/// +public class BuffSystem : MonoBehaviour +{ + private static BuffSystem instance; + public static BuffSystem Instance + { + get + { + if (instance == null) + { + var go = new GameObject("BuffSystem"); + instance = go.AddComponent(); + DontDestroyOnLoad(go); + } + return instance; + } + } + + private void Awake() + { + if (instance != null && instance != this) + { + Destroy(gameObject); + return; + } + instance = this; + } + + /// + /// 应用群体治疗增益 + /// + public void ApplyGroupHeal(float healAmount) + { + var allies = FindObjectsOfType(); + int healedCount = 0; + + foreach (var unit in allies) + { + var team = unit.GetComponent(); + if (team != null && team.teamId == 0) // 友方 + { + var healthBar = unit.GetComponent(); + if (healthBar != null) + { + healthBar.Heal(healAmount); + healedCount++; + } + } + } + + Debug.Log($"群体治疗:治疗了 {healedCount} 个友方单位,每个恢复 {healAmount} 生命"); + } + + /// + /// 应用全局攻速增益 + /// + public void ApplyGlobalAttackSpeedBuff(float speedMultiplier) + { + var allies = FindObjectsOfType(); + int buffedCount = 0; + + foreach (var unit in allies) + { + var team = unit.GetComponent(); + if (team != null && team.teamId == 0) // 友方 + { + // 使用 UnitBase 的攻速倍增系统 + unit.MultiplyAttackSpeed(speedMultiplier, 3f); // 最高3倍攻速 + buffedCount++; + } + } + + Debug.Log($"全局攻速增益:{buffedCount} 个友方单位攻速提升 {(speedMultiplier - 1) * 100}%"); + } + + /// + /// 应用全局攻击力增益 + /// + public void ApplyGlobalAttackBuff(float attackMultiplier) + { + var allies = FindObjectsOfType(); + int buffedCount = 0; + + foreach (var unit in allies) + { + var team = unit.GetComponent(); + if (team != null && team.teamId == 0) // 友方 + { + unit.attackPower *= attackMultiplier; + buffedCount++; + } + } + + Debug.Log($"全局攻击增益:{buffedCount} 个友方单位攻击力提升 {(attackMultiplier - 1) * 100}%"); + } + + /// + /// 应用全局生命增益 + /// + public void ApplyGlobalHealthBuff(float healthMultiplier) + { + var allies = FindObjectsOfType(); + int buffedCount = 0; + + foreach (var unit in allies) + { + var team = unit.GetComponent(); + if (team != null && team.teamId == 0) // 友方 + { + var healthBar = unit.GetComponent(); + if (healthBar != null) + { + healthBar.maxHealth *= healthMultiplier; + healthBar.currentHealth *= healthMultiplier; + buffedCount++; + } + } + } + + Debug.Log($"全局生命增益:{buffedCount} 个友方单位生命值提升 {(healthMultiplier - 1) * 100}%"); + } +} diff --git a/Assets/Script/BuffSystem.cs.meta b/Assets/Script/BuffSystem.cs.meta new file mode 100644 index 0000000..477285d --- /dev/null +++ b/Assets/Script/BuffSystem.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: Wn1Nsi6vVSqvQWHedD3drHiFb9+XIk1gBBe1fzptN23mBWFQASgVetg= +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/Script/HeroCardUI.cs b/Assets/Script/HeroCardUI.cs new file mode 100644 index 0000000..0e1b7cd --- /dev/null +++ b/Assets/Script/HeroCardUI.cs @@ -0,0 +1,277 @@ +using UnityEngine; +using UnityEngine.UI; + +/// +/// 英雄卡片UI控制 +/// 显示英雄状态、血条、死亡倒计时、复活按钮 +/// +public class HeroCardUI : MonoBehaviour +{ + [Header("引用")] + public Image iconImage; // 英雄头像 + public Image hpFillImage; // 血条填充 + public GameObject deathPanel; // 死亡遮罩 + public Text reviveTimerText; // 复活倒计时文本 + public Button reviveButton; // 立即复活按钮(看广告) + public Text reviveCountText; // 剩余复活次数 + + [Header("绑定的英雄")] + public UnitBase heroUnit; // 关联的英雄单位 + private WorldHealthBar heroHealthBar; + private Vector3 heroSpawnPosition; // 英雄出生位置 + + [Header("复活设置")] + public float reviveTime = 20f; // 自动复活时间 + private float reviveTimer = 0f; + private bool isDead = false; + + [Header("广告复活次数")] + public int maxAdRevives = 2; // 每局最多2次 + private int remainingAdRevives = 2; + + private void Start() + { + // 初始化复活次数 + remainingAdRevives = maxAdRevives; + UpdateReviveCountUI(); + + // 绑定复活按钮 + if (reviveButton != null) + { + reviveButton.onClick.AddListener(OnReviveButtonClicked); + } + + // 默认隐藏死亡面板 + if (deathPanel != null) + { + deathPanel.SetActive(false); + } + } + + private void Update() + { + if (heroUnit == null || heroHealthBar == null) + { + return; + } + + // 更新血条 + UpdateHealthBar(); + + // 检查死亡状态 + if (heroHealthBar.IsDead && !isDead) + { + OnHeroDeath(); + } + + // 检查是否已复活(外部复活,例如通过其他系统) + if (isDead && !heroHealthBar.IsDead && heroUnit.gameObject.activeSelf) + { + // 已复活,重置UI状态 + isDead = false; + if (deathPanel != null) + { + deathPanel.SetActive(false); + } + } + + // 更新复活倒计时 + if (isDead) + { + UpdateReviveTimer(); + } + } + + /// + /// 设置英雄单位 + /// + public void SetHero(UnitBase unit, Sprite icon, Vector3 spawnPos) + { + heroUnit = unit; + heroSpawnPosition = spawnPos; + + if (unit != null) + { + heroHealthBar = unit.GetComponent(); + } + + // 设置头像 + if (iconImage != null && icon != null) + { + iconImage.sprite = icon; + } + + isDead = false; + if (deathPanel != null) + { + deathPanel.SetActive(false); + } + } + + /// + /// 更新血条显示 + /// + private void UpdateHealthBar() + { + if (hpFillImage != null && heroHealthBar != null) + { + float fillAmount = heroHealthBar.maxHealth > 0 + ? heroHealthBar.currentHealth / heroHealthBar.maxHealth + : 0f; + hpFillImage.fillAmount = fillAmount; + } + } + + /// + /// 英雄死亡 + /// + private void OnHeroDeath() + { + isDead = true; + reviveTimer = reviveTime; + + // 显示死亡面板 + if (deathPanel != null) + { + deathPanel.SetActive(true); + } + + // 更新复活按钮状态 + UpdateReviveButton(); + + // 阻止英雄单位被销毁(取消延迟销毁) + if (heroUnit != null) + { + // 取消所有Destroy调用 + CancelInvoke(); + } + + Debug.Log($"英雄 {heroUnit.name} 死亡,{reviveTime}秒后复活"); + } + + /// + /// 更新复活倒计时 + /// + private void UpdateReviveTimer() + { + reviveTimer -= Time.deltaTime; + + // 更新倒计时文本 + if (reviveTimerText != null) + { + reviveTimerText.text = Mathf.CeilToInt(reviveTimer).ToString() + "s"; + } + + // 时间到,自动复活 + if (reviveTimer <= 0f) + { + ReviveHero(); + } + } + + /// + /// 复活英雄 + /// + private void ReviveHero() + { + if (heroUnit == null || heroHealthBar == null) + { + return; + } + + // 重新激活GameObject(必须先激活,否则无法操作组件) + heroUnit.gameObject.SetActive(true); + + // 重新启用渲染器 + foreach (Renderer renderer in heroUnit.GetComponentsInChildren()) + { + renderer.enabled = true; + } + + // 移动到出生位置 + heroUnit.transform.position = heroSpawnPosition; + + // 重置 NavMeshAgent + var navAgent = heroUnit.GetComponent(); + if (navAgent != null) + { + if (!navAgent.isOnNavMesh) + { + navAgent.enabled = false; + navAgent.enabled = true; + } + } + + // 使用WorldHealthBar的Revive方法(会重置isDead并恢复生命) + heroHealthBar.Revive(heroHealthBar.maxHealth); + + // 重置UI状态 + isDead = false; + if (deathPanel != null) + { + deathPanel.SetActive(false); + } + + Debug.Log($"HeroCardUI: {heroUnit.name} 复活完成"); + } + + /// + /// 点击立即复活按钮(看广告) + /// + private void OnReviveButtonClicked() + { + if (remainingAdRevives <= 0) + { + Debug.LogWarning("本局广告复活次数已用完"); + return; + } + + if (!isDead) + { + return; + } + + // TODO: 播放广告 + Debug.Log("播放广告..."); + + // 扣除复活次数 + remainingAdRevives--; + UpdateReviveCountUI(); + + // 立即复活 + ReviveHero(); + } + + /// + /// 更新复活按钮状态 + /// + private void UpdateReviveButton() + { + if (reviveButton != null) + { + reviveButton.interactable = remainingAdRevives > 0; + } + } + + /// + /// 更新剩余复活次数UI + /// + private void UpdateReviveCountUI() + { + if (reviveCountText != null) + { + reviveCountText.text = $"复活 {remainingAdRevives}/{maxAdRevives}"; + } + + UpdateReviveButton(); + } + + /// + /// 重置复活次数(新局开始时调用) + /// + public void ResetReviveCount() + { + remainingAdRevives = maxAdRevives; + UpdateReviveCountUI(); + } +} diff --git a/Assets/Script/HeroCardUI.cs.meta b/Assets/Script/HeroCardUI.cs.meta new file mode 100644 index 0000000..805831f --- /dev/null +++ b/Assets/Script/HeroCardUI.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: CC8WvCKsUnnlPCDoUIf59xuzBq+KNhguoqxtL8geRNF9qVSfOPuGI/M= +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/Script/PlayerSkillSystem.cs b/Assets/Script/PlayerSkillSystem.cs new file mode 100644 index 0000000..8618a22 --- /dev/null +++ b/Assets/Script/PlayerSkillSystem.cs @@ -0,0 +1,160 @@ +using UnityEngine; +using UnityEngine.UI; + +/// +/// 玩家技能系统(召唤师技能) +/// 管理技能释放和冷却 +/// +public class PlayerSkillSystem : MonoBehaviour +{ + [Header("技能1:群体治疗")] + public Button skill1Button; + public Text skill1CooldownText; + public float skill1Cooldown = 20f; + public float skill1HealAmount = 100f; + private float skill1RemainingCooldown = 0f; + + [Header("技能2:全屏AOE")] + public Button skill2Button; + public Text skill2CooldownText; + public float skill2Cooldown = 20f; + public float skill2Damage = 80f; + private float skill2RemainingCooldown = 0f; + + private void Start() + { + // 绑定按钮点击事件 + if (skill1Button != null) + { + skill1Button.onClick.AddListener(UseSkill1); + } + + if (skill2Button != null) + { + skill2Button.onClick.AddListener(UseSkill2); + } + } + + private void Update() + { + // 更新技能1冷却 + if (skill1RemainingCooldown > 0) + { + skill1RemainingCooldown -= Time.deltaTime; + if (skill1Button != null) + { + skill1Button.interactable = false; + } + if (skill1CooldownText != null) + { + skill1CooldownText.text = Mathf.CeilToInt(skill1RemainingCooldown).ToString(); + skill1CooldownText.gameObject.SetActive(true); + } + } + else + { + if (skill1Button != null) + { + skill1Button.interactable = true; + } + if (skill1CooldownText != null) + { + skill1CooldownText.gameObject.SetActive(false); + } + } + + // 更新技能2冷却 + if (skill2RemainingCooldown > 0) + { + skill2RemainingCooldown -= Time.deltaTime; + if (skill2Button != null) + { + skill2Button.interactable = false; + } + if (skill2CooldownText != null) + { + skill2CooldownText.text = Mathf.CeilToInt(skill2RemainingCooldown).ToString(); + skill2CooldownText.gameObject.SetActive(true); + } + } + else + { + if (skill2Button != null) + { + skill2Button.interactable = true; + } + if (skill2CooldownText != null) + { + skill2CooldownText.gameObject.SetActive(false); + } + } + } + + /// + /// 使用技能1:群体治疗 + /// + public void UseSkill1() + { + if (skill1RemainingCooldown > 0) + { + return; + } + + Debug.Log($"释放技能1:群体治疗(恢复 {skill1HealAmount} 生命)"); + + // 对所有友方单位施加治疗 + BuffSystem.Instance.ApplyGroupHeal(skill1HealAmount); + + // 开始冷却 + skill1RemainingCooldown = skill1Cooldown; + + // TODO: 播放技能特效 + } + + /// + /// 使用技能2:全屏AOE伤害 + /// + public void UseSkill2() + { + if (skill2RemainingCooldown > 0) + { + return; + } + + Debug.Log($"释放技能2:全屏AOE(造成 {skill2Damage} 伤害)"); + + // 对所有敌方单位造成伤害 + var enemies = FindObjectsOfType(); + int hitCount = 0; + + foreach (var unit in enemies) + { + var team = unit.GetComponent(); + if (team != null && team.teamId == 1) // 敌方 + { + var healthBar = unit.GetComponent(); + if (healthBar != null && !healthBar.IsDead) + { + healthBar.TakeDamage(skill2Damage); + hitCount++; + } + } + } + + Debug.Log($"全屏AOE命中 {hitCount} 个敌人"); + + // 开始冷却 + skill2RemainingCooldown = skill2Cooldown; + + // TODO: 播放技能特效 + } + + /// + /// 重置所有技能冷却(测试用) + /// + public void ResetAllCooldowns() + { + skill1RemainingCooldown = 0f; + skill2RemainingCooldown = 0f; + } +} diff --git a/Assets/Script/PlayerSkillSystem.cs.meta b/Assets/Script/PlayerSkillSystem.cs.meta new file mode 100644 index 0000000..2fd42b8 --- /dev/null +++ b/Assets/Script/PlayerSkillSystem.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: DnxOsC3+USlAfozqhw2KS9twgYXev36I4wjcNFXBGbQ+9XinguDmaNo= +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/Script/UnitBase.cs b/Assets/Script/UnitBase.cs index 6440a02..9391678 100644 --- a/Assets/Script/UnitBase.cs +++ b/Assets/Script/UnitBase.cs @@ -1167,6 +1167,11 @@ public class UnitBase : MonoBehaviour if (navAgent.velocity.magnitude > 0.1f) { animator.SetInteger("speed", 1); + // 走路时始终保持正常速度,不受 AttackSpeedMultiplier 影响 + if (animator != null) + { + animator.speed = 1f; + } } else { diff --git a/Assets/Script/WorldHealthBar.cs b/Assets/Script/WorldHealthBar.cs index 4c5f712..7641bd4 100644 --- a/Assets/Script/WorldHealthBar.cs +++ b/Assets/Script/WorldHealthBar.cs @@ -46,6 +46,10 @@ public class WorldHealthBar : MonoBehaviour // 死亡时使用的浅蓝色粒子颜色。 public Color deathEffectColor = new Color(0.55f, 0.9f, 1f, 1f); + [Header("复活设置")] + [Tooltip("是否可复活(友方英雄)")] + public bool canRevive = false; + [Header("伤害数字")] public bool showDamageNumbers = true; [Min(0.1f)] public float damageNumberDuration = 0.8f; @@ -200,6 +204,27 @@ public class WorldHealthBar : MonoBehaviour } } + /// + /// 复活单位(用于友方英雄复活系统) + /// + public void Revive(float healthAmount) + { + if (!canRevive) + { + Debug.LogWarning($"{gameObject.name} 不可复活(canRevive=false)"); + return; + } + + // 重置死亡状态 + isDead = false; + + // 恢复生命值 + currentHealth = Mathf.Clamp(healthAmount, 0f, maxHealth); + UpdateFill(); + + Debug.Log($"{gameObject.name} 已复活,生命值: {currentHealth}/{maxHealth}"); + } + // 增加技能能量,并返回本次增加后是否达到满能量。 public bool AddEnergy(float amount) { @@ -254,7 +279,12 @@ public class WorldHealthBar : MonoBehaviour GameObject effect = CreateDeathEffect(); Destroy(effect, deathEffectDuration); - Destroy(gameObject, deathEffectDuration); + + // 如果可以复活(友方英雄),不销毁GameObject + if (!canRevive) + { + Destroy(gameObject, deathEffectDuration); + } } // 创建蓝色粒子爆散特效。 diff --git a/Assets/Settings/Level1-Waves.json b/Assets/Settings/Level1-Waves.json index 758fb10..5ebe669 100644 --- a/Assets/Settings/Level1-Waves.json +++ b/Assets/Settings/Level1-Waves.json @@ -4,26 +4,82 @@ "waves": [ { "waveIndex": 1, - "restBeforeWave": 2.0, - "spawnInterval": 1.1, + "restBeforeWave": 3.0, + "spawnInterval": 1.5, "enemyIds": ["castle_blue_guard_q"], - "counts": [2], - "spawnX": [-3.5, 3.5] + "counts": [3], + "spawnX": [-3.5, 0, 3.5] }, { "waveIndex": 2, - "restBeforeWave": 3.5, - "spawnInterval": 1.0, - "enemyIds": ["castle_blue_guard_q", "castle_archer"], - "counts": [2, 2], + "restBeforeWave": 5.0, + "spawnInterval": 1.3, + "enemyIds": ["castle_blue_guard_q"], + "counts": [4], "spawnX": [-4.5, -1.5, 1.5, 4.5] }, { "waveIndex": 3, - "restBeforeWave": 4.5, + "restBeforeWave": 5.0, + "spawnInterval": 1.2, + "enemyIds": ["castle_blue_guard_q", "castle_archer"], + "counts": [3, 2], + "spawnX": [-4.5, -1.5, 1.5, 4.5] + }, + { + "waveIndex": 4, + "restBeforeWave": 6.0, + "spawnInterval": 1.1, + "enemyIds": ["castle_blue_guard_q", "castle_archer"], + "counts": [4, 2], + "spawnX": [-4.5, -1.5, 1.5, 4.5] + }, + { + "waveIndex": 5, + "restBeforeWave": 6.0, + "spawnInterval": 1.0, + "enemyIds": ["castle_blue_guard_q", "castle_archer", "castle_gold_guard"], + "counts": [3, 2, 1], + "spawnX": [-4.5, -1.5, 1.5, 4.5] + }, + { + "waveIndex": 6, + "restBeforeWave": 7.0, + "spawnInterval": 1.0, + "enemyIds": ["castle_blue_guard_q", "castle_archer"], + "counts": [5, 3], + "spawnX": [-4.5, -1.5, 1.5, 4.5] + }, + { + "waveIndex": 7, + "restBeforeWave": 7.0, "spawnInterval": 0.9, "enemyIds": ["castle_blue_guard_q", "castle_archer", "castle_gold_guard"], - "counts": [2, 2, 1], + "counts": [4, 3, 1], + "spawnX": [-4.5, -1.5, 1.5, 4.5] + }, + { + "waveIndex": 8, + "restBeforeWave": 8.0, + "spawnInterval": 0.9, + "enemyIds": ["castle_blue_guard_q", "castle_archer", "castle_gold_guard"], + "counts": [5, 3, 2], + "spawnX": [-4.5, -1.5, 1.5, 4.5] + }, + { + "waveIndex": 9, + "restBeforeWave": 8.0, + "spawnInterval": 0.8, + "enemyIds": ["castle_blue_guard_q", "castle_archer", "castle_gold_guard", "蓝角蛮卒"], + "counts": [5, 4, 2, 1], + "spawnX": [-4.5, -1.5, 1.5, 4.5] + }, + { + "waveIndex": 10, + "restBeforeWave": 10.0, + "spawnInterval": 0.8, + "enemyIds": ["castle_blue_guard_q", "castle_archer", "castle_gold_guard", "蓝角蛮卒"], + "counts": [6, 4, 3, 2], "spawnX": [-4.5, -1.5, 1.5, 4.5] } ] diff --git a/CODELY.md b/CODELY.md index 02dfdbc..8c47b5f 100644 --- a/CODELY.md +++ b/CODELY.md @@ -101,6 +101,10 @@ - [2026-09-26 23:25:29] 2026-09-26 角色生成统一规则:波次小怪采用简洁Q版低模模型,与玩家收集型英雄区分;必须严格正面/A-Pose、头部独立于躯干且保留短脖子、头/躯干/双臂/双腿/双脚彼此分离、关节清晰以便Mixamo绑定;角色图片不生成武器,武器由Unity单独挂载;角色使用主体色+少量识别色并保持清晰辨识度,地面和背景低饱和低对比度。玩家可收集卡牌角色沿用同一套结构约束(正面/A-Pose、独立头颈、分离四肢、无内置武器、角色与环境有辨识度),但使用正常/英雄比例,不采用Q版比例。 - [2026-09-27 08:51:19] 2026-09-27 CharacterData 已规范为仅保存角色静态配置:characterId、characterName、description、cardIcon、unitPrefab、基础生命/攻击/移速和升级成长;已移除 manaCost、cooldownTime、productionInterval、buildingCost。新增 Assets/Resources/PlayerData.schema.md 说明 PlayerData.json 字段。PlayerDataManager 从本地 PlayerData.json 读取解锁角色、等级、星级和当前卡组,未来可替换为 Java 接口响应。第一章英雄基础数值已提高到明显强于普通小兵:人类士兵300/42、弓箭手220/55、盾卫700/30、法师240/100、精锐士兵520/78;小兵为城堡蓝卫Q170/22、城堡弓童150/28、城堡金盾卫360/36。编辑态编译通过。 - [2026-09-27 15:24:49] 2026-09-27 战斗平衡规则补充:角色命中获得的技能能量/技能点应按各自技能强度单独平衡,不应统一设置;第一版可先用近似基准值跑通玩法,后续专门再平衡。用户倾向卡牌英雄初始普攻速度彼此接近(类似 MOBA 英雄起始攻速),英雄差异主要由技能机制及其充能效率体现。 +- [2026-09-29 17:03:15] 英雄死亡复活系统已完成:友方英雄 WorldHealthBar.canRevive=true 防止销毁,HeroCardUI 显示20秒倒计时和广告复活按钮(2次/局),复活后满血回到出生位置 +- [2026-09-29 17:03:15] 召唤师技能系统已完成:技能1群体治疗(CD 20秒,回血100),技能2全屏AOE(CD 20秒,伤害80),UI显示冷却倒计时 +- [2026-09-29 17:03:15] 波次系统已扩展到10波,难度曲线:前3波热身,4-7波混合,8-10波精英,波次间隔5-10秒递增 +- [2026-09-29 17:03:15] 全局攻击力已降低40%(×0.6),战斗时间延长约1.6倍,平衡游戏节奏 ### Reference - [2026-09-09 12:23:17] 飞行物脚本 Projectile.cs 负责锁敌追踪、碰撞检测和伤害结算。箭矢预制体 ArrowProjectile_White.prefab 已配置 Projectile 组件和 CapsuleCollider(Is Trigger)。远程单位需在攻击动画松弦帧添加 OnAttackEffect Event,并在 UnitBase 中设置 attackType=RangedProjectile、projectilePrefab、projectileSpawnPoint。 diff --git a/ProjectSettings/ProjectSettings.asset b/ProjectSettings/ProjectSettings.asset index 1f34a0d..1e48040 100644 --- a/ProjectSettings/ProjectSettings.asset +++ b/ProjectSettings/ProjectSettings.asset @@ -91,7 +91,7 @@ PlayerSettings: androidPredictiveBackSupport: 1 defaultIsNativeResolution: 1 macRetinaSupport: 1 - runInBackground: 0 + runInBackground: 1 captureSingleScreen: 0 muteOtherAudioSources: 0 Prepare IOS For Recording: 0