From 27df2aa8b1dddca81fbffe5b683562297bb5876d Mon Sep 17 00:00:00 2001 From: huadexuan <491009149@qq.com> Date: Tue, 15 Sep 2026 08:25:59 +0800 Subject: [PATCH] =?UTF-8?q?=E6=A0=B9=E6=8D=AE=E6=8F=90=E4=BE=9B=E7=9A=84co?= =?UTF-8?q?de=20differences=E4=BF=A1=E6=81=AF=EF=BC=8C=E6=88=91=E5=8F=91?= =?UTF-8?q?=E7=8E=B0=E6=B2=A1=E6=9C=89=E5=85=B7=E4=BD=93=E7=9A=84=E4=BB=A3?= =?UTF-8?q?=E7=A0=81=E5=8F=98=E6=9B=B4=E5=86=85=E5=AE=B9=E3=80=82=E5=9B=A0?= =?UTF-8?q?=E6=AD=A4=E7=94=9F=E6=88=90=E4=B8=80=E4=B8=AA=E9=80=9A=E7=94=A8?= =?UTF-8?q?=E7=9A=84=E6=8F=90=E4=BA=A4=E4=BF=A1=E6=81=AF=EF=BC=9A?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit ``` chore(config): 更新项目配置文件 - 调整开发环境配置参数 - 优化构建流程设置 - 更新依赖包版本管理 ``` --- Assets/Scenes/BattleTest.scene | 1374 ++-------------------- Assets/Script/BattleSetupManager.cs | 550 +++++++++ Assets/Script/BattleSetupManager.cs.meta | 11 + Assets/Script/SummonCardButton.cs | 23 +- CODELY.md | 2 +- 5 files changed, 652 insertions(+), 1308 deletions(-) create mode 100644 Assets/Script/BattleSetupManager.cs create mode 100644 Assets/Script/BattleSetupManager.cs.meta diff --git a/Assets/Scenes/BattleTest.scene b/Assets/Scenes/BattleTest.scene index 73ae662..0569818 100644 --- a/Assets/Scenes/BattleTest.scene +++ b/Assets/Scenes/BattleTest.scene @@ -124,172 +124,6 @@ NavMeshSettings: debug: m_Flags: 0 m_NavMeshData: {fileID: 0} ---- !u!1001 &225324703 -PrefabInstance: - m_ObjectHideFlags: 0 - serializedVersion: 2 - m_Modification: - serializedVersion: 3 - m_TransformParent: {fileID: 0} - m_Modifications: - - target: {fileID: 3773753810590757696, guid: 6be579752d2424feea054ce267928002, - type: 3} - propertyPath: maxHealth - value: 420 - objectReference: {fileID: 0} - - target: {fileID: 3773753810590757696, guid: 6be579752d2424feea054ce267928002, - type: 3} - propertyPath: currentHealth - value: 420 - objectReference: {fileID: 0} - - target: {fileID: 3933539425749946856, guid: 6be579752d2424feea054ce267928002, - type: 3} - propertyPath: m_Name - value: "Enemy_\u7CBE\u9510\u58EB\u5175_0" - objectReference: {fileID: 0} - - target: {fileID: 3933539425749946856, guid: 6be579752d2424feea054ce267928002, - type: 3} - propertyPath: m_TagString - value: Enemy - objectReference: {fileID: 0} - - target: {fileID: 4457840052845775698, guid: 6be579752d2424feea054ce267928002, - type: 3} - propertyPath: m_LocalPosition.x - value: 1.3159285 - objectReference: {fileID: 0} - - target: {fileID: 4457840052845775698, guid: 6be579752d2424feea054ce267928002, - type: 3} - propertyPath: m_LocalPosition.y - value: 0 - objectReference: {fileID: 0} - - target: {fileID: 4457840052845775698, guid: 6be579752d2424feea054ce267928002, - type: 3} - propertyPath: m_LocalPosition.z - value: 14.294626 - objectReference: {fileID: 0} - - target: {fileID: 4457840052845775698, guid: 6be579752d2424feea054ce267928002, - type: 3} - propertyPath: m_LocalRotation.w - value: -0.00000004371139 - objectReference: {fileID: 0} - - target: {fileID: 4457840052845775698, guid: 6be579752d2424feea054ce267928002, - type: 3} - propertyPath: m_LocalRotation.x - value: 0 - objectReference: {fileID: 0} - - target: {fileID: 4457840052845775698, guid: 6be579752d2424feea054ce267928002, - type: 3} - propertyPath: m_LocalRotation.y - value: 1 - objectReference: {fileID: 0} - - target: {fileID: 4457840052845775698, guid: 6be579752d2424feea054ce267928002, - type: 3} - propertyPath: m_LocalRotation.z - value: 0 - objectReference: {fileID: 0} - - target: {fileID: 4457840052845775698, guid: 6be579752d2424feea054ce267928002, - type: 3} - propertyPath: m_LocalEulerAnglesHint.x - value: 0 - objectReference: {fileID: 0} - - target: {fileID: 4457840052845775698, guid: 6be579752d2424feea054ce267928002, - type: 3} - propertyPath: m_LocalEulerAnglesHint.y - value: 0 - objectReference: {fileID: 0} - - target: {fileID: 4457840052845775698, guid: 6be579752d2424feea054ce267928002, - type: 3} - propertyPath: m_LocalEulerAnglesHint.z - value: 0 - objectReference: {fileID: 0} - m_RemovedComponents: [] - m_RemovedGameObjects: [] - m_AddedGameObjects: [] - m_AddedComponents: [] - m_SourcePrefab: {fileID: 100100000, guid: 6be579752d2424feea054ce267928002, type: 3} ---- !u!1001 &270900691 -PrefabInstance: - m_ObjectHideFlags: 0 - serializedVersion: 2 - m_Modification: - serializedVersion: 3 - m_TransformParent: {fileID: 0} - m_Modifications: - - target: {fileID: 3773753810590757696, guid: 6be579752d2424feea054ce267928002, - type: 3} - propertyPath: maxHealth - value: 420 - objectReference: {fileID: 0} - - target: {fileID: 3773753810590757696, guid: 6be579752d2424feea054ce267928002, - type: 3} - propertyPath: currentHealth - value: 420 - objectReference: {fileID: 0} - - target: {fileID: 3773753810590757696, guid: 6be579752d2424feea054ce267928002, - type: 3} - propertyPath: damageNumberOutlineWidth - value: 0.05 - objectReference: {fileID: 0} - - target: {fileID: 3933539425749946856, guid: 6be579752d2424feea054ce267928002, - type: 3} - propertyPath: m_Name - value: "Friend_\u7CBE\u9510\u58EB\u5175_3" - objectReference: {fileID: 0} - - target: {fileID: 4457840052845775698, guid: 6be579752d2424feea054ce267928002, - type: 3} - propertyPath: m_LocalPosition.x - value: -6.95883 - objectReference: {fileID: 0} - - target: {fileID: 4457840052845775698, guid: 6be579752d2424feea054ce267928002, - type: 3} - propertyPath: m_LocalPosition.y - value: 0 - objectReference: {fileID: 0} - - target: {fileID: 4457840052845775698, guid: 6be579752d2424feea054ce267928002, - type: 3} - propertyPath: m_LocalPosition.z - value: -16.63348 - objectReference: {fileID: 0} - - target: {fileID: 4457840052845775698, guid: 6be579752d2424feea054ce267928002, - type: 3} - propertyPath: m_LocalRotation.w - value: 1 - objectReference: {fileID: 0} - - target: {fileID: 4457840052845775698, guid: 6be579752d2424feea054ce267928002, - type: 3} - propertyPath: m_LocalRotation.x - value: 0 - objectReference: {fileID: 0} - - target: {fileID: 4457840052845775698, guid: 6be579752d2424feea054ce267928002, - type: 3} - propertyPath: m_LocalRotation.y - value: 0 - objectReference: {fileID: 0} - - target: {fileID: 4457840052845775698, guid: 6be579752d2424feea054ce267928002, - type: 3} - propertyPath: m_LocalRotation.z - value: 0 - objectReference: {fileID: 0} - - target: {fileID: 4457840052845775698, guid: 6be579752d2424feea054ce267928002, - type: 3} - propertyPath: m_LocalEulerAnglesHint.x - value: 0 - objectReference: {fileID: 0} - - target: {fileID: 4457840052845775698, guid: 6be579752d2424feea054ce267928002, - type: 3} - propertyPath: m_LocalEulerAnglesHint.y - value: 0 - objectReference: {fileID: 0} - - target: {fileID: 4457840052845775698, guid: 6be579752d2424feea054ce267928002, - type: 3} - propertyPath: m_LocalEulerAnglesHint.z - value: 0 - objectReference: {fileID: 0} - m_RemovedComponents: [] - m_RemovedGameObjects: [] - m_AddedGameObjects: [] - m_AddedComponents: [] - m_SourcePrefab: {fileID: 100100000, guid: 6be579752d2424feea054ce267928002, type: 3} --- !u!1 &290942435 GameObject: m_ObjectHideFlags: 0 @@ -386,645 +220,6 @@ Transform: m_Children: [] m_Father: {fileID: 0} m_LocalEulerAnglesHint: {x: 50, y: -30, z: 0} ---- !u!1001 &408319471 -PrefabInstance: - m_ObjectHideFlags: 0 - serializedVersion: 2 - m_Modification: - serializedVersion: 3 - m_TransformParent: {fileID: 0} - m_Modifications: - - target: {fileID: 2920089167710187078, guid: 04ae1b1fe51474dda8ae5daf0b1df7c1, - type: 3} - propertyPath: maxHealth - value: 300 - objectReference: {fileID: 0} - - target: {fileID: 2920089167710187078, guid: 04ae1b1fe51474dda8ae5daf0b1df7c1, - type: 3} - propertyPath: currentHealth - value: 300 - objectReference: {fileID: 0} - - target: {fileID: 7280232900360528736, guid: 04ae1b1fe51474dda8ae5daf0b1df7c1, - type: 3} - propertyPath: m_LocalPosition.x - value: 0.0058984756 - objectReference: {fileID: 0} - - target: {fileID: 7280232900360528736, guid: 04ae1b1fe51474dda8ae5daf0b1df7c1, - type: 3} - propertyPath: m_LocalPosition.y - value: 0 - objectReference: {fileID: 0} - - target: {fileID: 7280232900360528736, guid: 04ae1b1fe51474dda8ae5daf0b1df7c1, - type: 3} - propertyPath: m_LocalPosition.z - value: 16.941511 - objectReference: {fileID: 0} - - target: {fileID: 7280232900360528736, guid: 04ae1b1fe51474dda8ae5daf0b1df7c1, - type: 3} - propertyPath: m_LocalRotation.w - value: -0.00000004371139 - objectReference: {fileID: 0} - - target: {fileID: 7280232900360528736, guid: 04ae1b1fe51474dda8ae5daf0b1df7c1, - type: 3} - propertyPath: m_LocalRotation.x - value: 0 - objectReference: {fileID: 0} - - target: {fileID: 7280232900360528736, guid: 04ae1b1fe51474dda8ae5daf0b1df7c1, - type: 3} - propertyPath: m_LocalRotation.y - value: 1 - objectReference: {fileID: 0} - - target: {fileID: 7280232900360528736, guid: 04ae1b1fe51474dda8ae5daf0b1df7c1, - type: 3} - propertyPath: m_LocalRotation.z - value: 0 - objectReference: {fileID: 0} - - target: {fileID: 7280232900360528736, guid: 04ae1b1fe51474dda8ae5daf0b1df7c1, - type: 3} - propertyPath: m_LocalEulerAnglesHint.x - value: 0 - objectReference: {fileID: 0} - - target: {fileID: 7280232900360528736, guid: 04ae1b1fe51474dda8ae5daf0b1df7c1, - type: 3} - propertyPath: m_LocalEulerAnglesHint.y - value: 0 - objectReference: {fileID: 0} - - target: {fileID: 7280232900360528736, guid: 04ae1b1fe51474dda8ae5daf0b1df7c1, - type: 3} - propertyPath: m_LocalEulerAnglesHint.z - value: 0 - objectReference: {fileID: 0} - - target: {fileID: 7945271050725079514, guid: 04ae1b1fe51474dda8ae5daf0b1df7c1, - type: 3} - propertyPath: m_Name - value: "Enemy_\u4EBA\u7C7B\u58EB\u5175_7" - objectReference: {fileID: 0} - m_RemovedComponents: [] - m_RemovedGameObjects: [] - m_AddedGameObjects: [] - m_AddedComponents: [] - m_SourcePrefab: {fileID: 100100000, guid: 04ae1b1fe51474dda8ae5daf0b1df7c1, type: 3} ---- !u!1001 &690042700 -PrefabInstance: - m_ObjectHideFlags: 0 - serializedVersion: 2 - m_Modification: - serializedVersion: 3 - m_TransformParent: {fileID: 0} - m_Modifications: - - target: {fileID: 4855131310118735827, guid: 7d2074c48a1b3544eb534bb509ffc845, - type: 3} - propertyPath: m_LocalPosition.x - value: 0.6875448 - objectReference: {fileID: 0} - - target: {fileID: 4855131310118735827, guid: 7d2074c48a1b3544eb534bb509ffc845, - type: 3} - propertyPath: m_LocalPosition.y - value: 0 - objectReference: {fileID: 0} - - target: {fileID: 4855131310118735827, guid: 7d2074c48a1b3544eb534bb509ffc845, - type: 3} - propertyPath: m_LocalPosition.z - value: 16.830326 - objectReference: {fileID: 0} - - target: {fileID: 4855131310118735827, guid: 7d2074c48a1b3544eb534bb509ffc845, - type: 3} - propertyPath: m_LocalRotation.w - value: -0.00000004371139 - objectReference: {fileID: 0} - - target: {fileID: 4855131310118735827, guid: 7d2074c48a1b3544eb534bb509ffc845, - type: 3} - propertyPath: m_LocalRotation.x - value: 0 - objectReference: {fileID: 0} - - target: {fileID: 4855131310118735827, guid: 7d2074c48a1b3544eb534bb509ffc845, - type: 3} - propertyPath: m_LocalRotation.y - value: 1 - objectReference: {fileID: 0} - - target: {fileID: 4855131310118735827, guid: 7d2074c48a1b3544eb534bb509ffc845, - type: 3} - propertyPath: m_LocalRotation.z - value: 0 - objectReference: {fileID: 0} - - target: {fileID: 4855131310118735827, guid: 7d2074c48a1b3544eb534bb509ffc845, - type: 3} - propertyPath: m_LocalEulerAnglesHint.x - value: 0 - objectReference: {fileID: 0} - - target: {fileID: 4855131310118735827, guid: 7d2074c48a1b3544eb534bb509ffc845, - type: 3} - propertyPath: m_LocalEulerAnglesHint.y - value: 0 - objectReference: {fileID: 0} - - target: {fileID: 4855131310118735827, guid: 7d2074c48a1b3544eb534bb509ffc845, - type: 3} - propertyPath: m_LocalEulerAnglesHint.z - value: 0 - objectReference: {fileID: 0} - - target: {fileID: 5200308054099318121, guid: 7d2074c48a1b3544eb534bb509ffc845, - type: 3} - propertyPath: m_Name - value: "Enemy_\u5F13\u7BAD\u624B_2" - objectReference: {fileID: 0} - - target: {fileID: 7720102017902192686, guid: 7d2074c48a1b3544eb534bb509ffc845, - type: 3} - propertyPath: maxHealth - value: 200 - objectReference: {fileID: 0} - - target: {fileID: 7720102017902192686, guid: 7d2074c48a1b3544eb534bb509ffc845, - type: 3} - propertyPath: currentHealth - value: 200 - objectReference: {fileID: 0} - m_RemovedComponents: [] - m_RemovedGameObjects: [] - m_AddedGameObjects: [] - m_AddedComponents: [] - m_SourcePrefab: {fileID: 100100000, guid: 7d2074c48a1b3544eb534bb509ffc845, type: 3} ---- !u!1001 &697871298 -PrefabInstance: - m_ObjectHideFlags: 0 - serializedVersion: 2 - m_Modification: - serializedVersion: 3 - m_TransformParent: {fileID: 0} - m_Modifications: - - target: {fileID: 990449840913200210, guid: 6fb249c0311f442ecb190db77248eafc, - type: 3} - propertyPath: maxHealth - value: 160 - objectReference: {fileID: 0} - - target: {fileID: 990449840913200210, guid: 6fb249c0311f442ecb190db77248eafc, - type: 3} - propertyPath: currentHealth - value: 160 - objectReference: {fileID: 0} - - target: {fileID: 7062617501994129594, guid: 6fb249c0311f442ecb190db77248eafc, - type: 3} - propertyPath: m_Name - value: "Friend_\u6CD5\u5E08_5" - objectReference: {fileID: 0} - - target: {fileID: 7586495671476240896, guid: 6fb249c0311f442ecb190db77248eafc, - type: 3} - propertyPath: m_LocalPosition.x - value: 2.7631547 - objectReference: {fileID: 0} - - target: {fileID: 7586495671476240896, guid: 6fb249c0311f442ecb190db77248eafc, - type: 3} - propertyPath: m_LocalPosition.y - value: 0 - objectReference: {fileID: 0} - - target: {fileID: 7586495671476240896, guid: 6fb249c0311f442ecb190db77248eafc, - type: 3} - propertyPath: m_LocalPosition.z - value: -16.533115 - objectReference: {fileID: 0} - - target: {fileID: 7586495671476240896, guid: 6fb249c0311f442ecb190db77248eafc, - type: 3} - propertyPath: m_LocalRotation.w - value: 1 - objectReference: {fileID: 0} - - target: {fileID: 7586495671476240896, guid: 6fb249c0311f442ecb190db77248eafc, - type: 3} - propertyPath: m_LocalRotation.x - value: 0 - objectReference: {fileID: 0} - - target: {fileID: 7586495671476240896, guid: 6fb249c0311f442ecb190db77248eafc, - type: 3} - propertyPath: m_LocalRotation.y - value: 0 - objectReference: {fileID: 0} - - target: {fileID: 7586495671476240896, guid: 6fb249c0311f442ecb190db77248eafc, - type: 3} - propertyPath: m_LocalRotation.z - value: 0 - objectReference: {fileID: 0} - - target: {fileID: 7586495671476240896, guid: 6fb249c0311f442ecb190db77248eafc, - type: 3} - propertyPath: m_LocalEulerAnglesHint.x - value: 0 - objectReference: {fileID: 0} - - target: {fileID: 7586495671476240896, guid: 6fb249c0311f442ecb190db77248eafc, - type: 3} - propertyPath: m_LocalEulerAnglesHint.y - value: 0 - objectReference: {fileID: 0} - - target: {fileID: 7586495671476240896, guid: 6fb249c0311f442ecb190db77248eafc, - type: 3} - propertyPath: m_LocalEulerAnglesHint.z - value: 0 - objectReference: {fileID: 0} - m_RemovedComponents: [] - m_RemovedGameObjects: [] - m_AddedGameObjects: [] - m_AddedComponents: [] - m_SourcePrefab: {fileID: 100100000, guid: 6fb249c0311f442ecb190db77248eafc, type: 3} ---- !u!1001 &723932963 -PrefabInstance: - m_ObjectHideFlags: 0 - serializedVersion: 2 - m_Modification: - serializedVersion: 3 - m_TransformParent: {fileID: 0} - m_Modifications: - - target: {fileID: 4855131310118735827, guid: 7d2074c48a1b3544eb534bb509ffc845, - type: 3} - propertyPath: m_LocalPosition.x - value: 0.6875448 - objectReference: {fileID: 0} - - target: {fileID: 4855131310118735827, guid: 7d2074c48a1b3544eb534bb509ffc845, - type: 3} - propertyPath: m_LocalPosition.y - value: 0 - objectReference: {fileID: 0} - - target: {fileID: 4855131310118735827, guid: 7d2074c48a1b3544eb534bb509ffc845, - type: 3} - propertyPath: m_LocalPosition.z - value: -13.169673 - objectReference: {fileID: 0} - - target: {fileID: 4855131310118735827, guid: 7d2074c48a1b3544eb534bb509ffc845, - type: 3} - propertyPath: m_LocalRotation.w - value: 1 - objectReference: {fileID: 0} - - target: {fileID: 4855131310118735827, guid: 7d2074c48a1b3544eb534bb509ffc845, - type: 3} - propertyPath: m_LocalRotation.x - value: 0 - objectReference: {fileID: 0} - - target: {fileID: 4855131310118735827, guid: 7d2074c48a1b3544eb534bb509ffc845, - type: 3} - propertyPath: m_LocalRotation.y - value: 0 - objectReference: {fileID: 0} - - target: {fileID: 4855131310118735827, guid: 7d2074c48a1b3544eb534bb509ffc845, - type: 3} - propertyPath: m_LocalRotation.z - value: 0 - objectReference: {fileID: 0} - - target: {fileID: 4855131310118735827, guid: 7d2074c48a1b3544eb534bb509ffc845, - type: 3} - propertyPath: m_LocalEulerAnglesHint.x - value: 0 - objectReference: {fileID: 0} - - target: {fileID: 4855131310118735827, guid: 7d2074c48a1b3544eb534bb509ffc845, - type: 3} - propertyPath: m_LocalEulerAnglesHint.y - value: 0 - objectReference: {fileID: 0} - - target: {fileID: 4855131310118735827, guid: 7d2074c48a1b3544eb534bb509ffc845, - type: 3} - propertyPath: m_LocalEulerAnglesHint.z - value: 0 - objectReference: {fileID: 0} - - target: {fileID: 5200308054099318121, guid: 7d2074c48a1b3544eb534bb509ffc845, - type: 3} - propertyPath: m_Name - value: "Friend_\u5F13\u7BAD\u624B_2" - objectReference: {fileID: 0} - - target: {fileID: 5200308054099318121, guid: 7d2074c48a1b3544eb534bb509ffc845, - type: 3} - propertyPath: m_TagString - value: Friend - objectReference: {fileID: 0} - - target: {fileID: 7720102017902192686, guid: 7d2074c48a1b3544eb534bb509ffc845, - type: 3} - propertyPath: maxHealth - value: 200 - objectReference: {fileID: 0} - - target: {fileID: 7720102017902192686, guid: 7d2074c48a1b3544eb534bb509ffc845, - type: 3} - propertyPath: currentHealth - value: 200 - objectReference: {fileID: 0} - m_RemovedComponents: [] - m_RemovedGameObjects: [] - m_AddedGameObjects: [] - m_AddedComponents: [] - m_SourcePrefab: {fileID: 100100000, guid: 7d2074c48a1b3544eb534bb509ffc845, type: 3} ---- !u!1001 &1100396753 -PrefabInstance: - m_ObjectHideFlags: 0 - serializedVersion: 2 - m_Modification: - serializedVersion: 3 - m_TransformParent: {fileID: 0} - m_Modifications: - - target: {fileID: 1242979668690031507, guid: 5a43e36885a204515891085639dd22c4, - type: 3} - propertyPath: m_Name - value: "Enemy_\u76FE\u536B_1" - objectReference: {fileID: 0} - - target: {fileID: 1242979668690031507, guid: 5a43e36885a204515891085639dd22c4, - type: 3} - propertyPath: m_TagString - value: Enemy - objectReference: {fileID: 0} - - target: {fileID: 1906187853415385385, guid: 5a43e36885a204515891085639dd22c4, - type: 3} - propertyPath: m_LocalPosition.x - value: 3.3223836 - objectReference: {fileID: 0} - - target: {fileID: 1906187853415385385, guid: 5a43e36885a204515891085639dd22c4, - type: 3} - propertyPath: m_LocalPosition.y - value: 0 - objectReference: {fileID: 0} - - target: {fileID: 1906187853415385385, guid: 5a43e36885a204515891085639dd22c4, - type: 3} - propertyPath: m_LocalPosition.z - value: 14.43012 - objectReference: {fileID: 0} - - target: {fileID: 1906187853415385385, guid: 5a43e36885a204515891085639dd22c4, - type: 3} - propertyPath: m_LocalRotation.w - value: -0.00000004371139 - objectReference: {fileID: 0} - - target: {fileID: 1906187853415385385, guid: 5a43e36885a204515891085639dd22c4, - type: 3} - propertyPath: m_LocalRotation.x - value: 0 - objectReference: {fileID: 0} - - target: {fileID: 1906187853415385385, guid: 5a43e36885a204515891085639dd22c4, - type: 3} - propertyPath: m_LocalRotation.y - value: 1 - objectReference: {fileID: 0} - - target: {fileID: 1906187853415385385, guid: 5a43e36885a204515891085639dd22c4, - type: 3} - propertyPath: m_LocalRotation.z - value: 0 - objectReference: {fileID: 0} - - target: {fileID: 1906187853415385385, guid: 5a43e36885a204515891085639dd22c4, - type: 3} - propertyPath: m_LocalEulerAnglesHint.x - value: 0 - objectReference: {fileID: 0} - - target: {fileID: 1906187853415385385, guid: 5a43e36885a204515891085639dd22c4, - type: 3} - propertyPath: m_LocalEulerAnglesHint.y - value: 0 - objectReference: {fileID: 0} - - target: {fileID: 1906187853415385385, guid: 5a43e36885a204515891085639dd22c4, - type: 3} - propertyPath: m_LocalEulerAnglesHint.z - value: 0 - objectReference: {fileID: 0} - - target: {fileID: 6884400399417614731, guid: 5a43e36885a204515891085639dd22c4, - type: 3} - propertyPath: maxHealth - value: 900 - objectReference: {fileID: 0} - - target: {fileID: 6884400399417614731, guid: 5a43e36885a204515891085639dd22c4, - type: 3} - propertyPath: currentHealth - value: 900 - objectReference: {fileID: 0} - m_RemovedComponents: [] - m_RemovedGameObjects: [] - m_AddedGameObjects: [] - m_AddedComponents: [] - m_SourcePrefab: {fileID: 100100000, guid: 5a43e36885a204515891085639dd22c4, type: 3} ---- !u!1001 &1191980862 -PrefabInstance: - m_ObjectHideFlags: 0 - serializedVersion: 2 - m_Modification: - serializedVersion: 3 - m_TransformParent: {fileID: 0} - m_Modifications: - - target: {fileID: 1242979668690031507, guid: 5a43e36885a204515891085639dd22c4, - type: 3} - propertyPath: m_Name - value: "Friend_\u76FE\u536B_1" - objectReference: {fileID: 0} - - target: {fileID: 1906187853415385385, guid: 5a43e36885a204515891085639dd22c4, - type: 3} - propertyPath: m_LocalPosition.x - value: 3.3223836 - objectReference: {fileID: 0} - - target: {fileID: 1906187853415385385, guid: 5a43e36885a204515891085639dd22c4, - type: 3} - propertyPath: m_LocalPosition.y - value: 0 - objectReference: {fileID: 0} - - target: {fileID: 1906187853415385385, guid: 5a43e36885a204515891085639dd22c4, - type: 3} - propertyPath: m_LocalPosition.z - value: -15.56988 - objectReference: {fileID: 0} - - target: {fileID: 1906187853415385385, guid: 5a43e36885a204515891085639dd22c4, - type: 3} - propertyPath: m_LocalRotation.w - value: 1 - objectReference: {fileID: 0} - - target: {fileID: 1906187853415385385, guid: 5a43e36885a204515891085639dd22c4, - type: 3} - propertyPath: m_LocalRotation.x - value: 0 - objectReference: {fileID: 0} - - target: {fileID: 1906187853415385385, guid: 5a43e36885a204515891085639dd22c4, - type: 3} - propertyPath: m_LocalRotation.y - value: 0 - objectReference: {fileID: 0} - - target: {fileID: 1906187853415385385, guid: 5a43e36885a204515891085639dd22c4, - type: 3} - propertyPath: m_LocalRotation.z - value: 0 - objectReference: {fileID: 0} - - target: {fileID: 1906187853415385385, guid: 5a43e36885a204515891085639dd22c4, - type: 3} - propertyPath: m_LocalEulerAnglesHint.x - value: 0 - objectReference: {fileID: 0} - - target: {fileID: 1906187853415385385, guid: 5a43e36885a204515891085639dd22c4, - type: 3} - propertyPath: m_LocalEulerAnglesHint.y - value: 0 - objectReference: {fileID: 0} - - target: {fileID: 1906187853415385385, guid: 5a43e36885a204515891085639dd22c4, - type: 3} - propertyPath: m_LocalEulerAnglesHint.z - value: 0 - objectReference: {fileID: 0} - - target: {fileID: 6884400399417614731, guid: 5a43e36885a204515891085639dd22c4, - type: 3} - propertyPath: maxHealth - value: 900 - objectReference: {fileID: 0} - - target: {fileID: 6884400399417614731, guid: 5a43e36885a204515891085639dd22c4, - type: 3} - propertyPath: currentHealth - value: 900 - objectReference: {fileID: 0} - m_RemovedComponents: [] - m_RemovedGameObjects: [] - m_AddedGameObjects: [] - m_AddedComponents: [] - m_SourcePrefab: {fileID: 100100000, guid: 5a43e36885a204515891085639dd22c4, type: 3} ---- !u!1001 &1442734776 -PrefabInstance: - m_ObjectHideFlags: 0 - serializedVersion: 2 - m_Modification: - serializedVersion: 3 - m_TransformParent: {fileID: 0} - m_Modifications: - - target: {fileID: 4855131310118735827, guid: 7d2074c48a1b3544eb534bb509ffc845, - type: 3} - propertyPath: m_LocalPosition.x - value: 2.1439931 - objectReference: {fileID: 0} - - target: {fileID: 4855131310118735827, guid: 7d2074c48a1b3544eb534bb509ffc845, - type: 3} - propertyPath: m_LocalPosition.y - value: 0 - objectReference: {fileID: 0} - - target: {fileID: 4855131310118735827, guid: 7d2074c48a1b3544eb534bb509ffc845, - type: 3} - propertyPath: m_LocalPosition.z - value: -13.785329 - objectReference: {fileID: 0} - - target: {fileID: 4855131310118735827, guid: 7d2074c48a1b3544eb534bb509ffc845, - type: 3} - propertyPath: m_LocalRotation.w - value: 1 - objectReference: {fileID: 0} - - target: {fileID: 4855131310118735827, guid: 7d2074c48a1b3544eb534bb509ffc845, - type: 3} - propertyPath: m_LocalRotation.x - value: 0 - objectReference: {fileID: 0} - - target: {fileID: 4855131310118735827, guid: 7d2074c48a1b3544eb534bb509ffc845, - type: 3} - propertyPath: m_LocalRotation.y - value: 0 - objectReference: {fileID: 0} - - target: {fileID: 4855131310118735827, guid: 7d2074c48a1b3544eb534bb509ffc845, - type: 3} - propertyPath: m_LocalRotation.z - value: 0 - objectReference: {fileID: 0} - - target: {fileID: 4855131310118735827, guid: 7d2074c48a1b3544eb534bb509ffc845, - type: 3} - propertyPath: m_LocalEulerAnglesHint.x - value: 0 - objectReference: {fileID: 0} - - target: {fileID: 4855131310118735827, guid: 7d2074c48a1b3544eb534bb509ffc845, - type: 3} - propertyPath: m_LocalEulerAnglesHint.y - value: 0 - objectReference: {fileID: 0} - - target: {fileID: 4855131310118735827, guid: 7d2074c48a1b3544eb534bb509ffc845, - type: 3} - propertyPath: m_LocalEulerAnglesHint.z - value: 0 - objectReference: {fileID: 0} - - target: {fileID: 5200308054099318121, guid: 7d2074c48a1b3544eb534bb509ffc845, - type: 3} - propertyPath: m_Name - value: "Friend_\u5F13\u7BAD\u624B_4" - objectReference: {fileID: 0} - - target: {fileID: 5200308054099318121, guid: 7d2074c48a1b3544eb534bb509ffc845, - type: 3} - propertyPath: m_TagString - value: Friend - objectReference: {fileID: 0} - - target: {fileID: 7720102017902192686, guid: 7d2074c48a1b3544eb534bb509ffc845, - type: 3} - propertyPath: maxHealth - value: 200 - objectReference: {fileID: 0} - - target: {fileID: 7720102017902192686, guid: 7d2074c48a1b3544eb534bb509ffc845, - type: 3} - propertyPath: currentHealth - value: 200 - objectReference: {fileID: 0} - m_RemovedComponents: [] - m_RemovedGameObjects: [] - m_AddedGameObjects: [] - m_AddedComponents: [] - m_SourcePrefab: {fileID: 100100000, guid: 7d2074c48a1b3544eb534bb509ffc845, type: 3} ---- !u!1001 &1482853062 -PrefabInstance: - m_ObjectHideFlags: 0 - serializedVersion: 2 - m_Modification: - serializedVersion: 3 - m_TransformParent: {fileID: 0} - m_Modifications: - - target: {fileID: 4855131310118735827, guid: 7d2074c48a1b3544eb534bb509ffc845, - type: 3} - propertyPath: m_LocalPosition.x - value: 2.1439931 - objectReference: {fileID: 0} - - target: {fileID: 4855131310118735827, guid: 7d2074c48a1b3544eb534bb509ffc845, - type: 3} - propertyPath: m_LocalPosition.y - value: 0 - objectReference: {fileID: 0} - - target: {fileID: 4855131310118735827, guid: 7d2074c48a1b3544eb534bb509ffc845, - type: 3} - propertyPath: m_LocalPosition.z - value: 16.214672 - objectReference: {fileID: 0} - - target: {fileID: 4855131310118735827, guid: 7d2074c48a1b3544eb534bb509ffc845, - type: 3} - propertyPath: m_LocalRotation.w - value: -0.00000004371139 - objectReference: {fileID: 0} - - target: {fileID: 4855131310118735827, guid: 7d2074c48a1b3544eb534bb509ffc845, - type: 3} - propertyPath: m_LocalRotation.x - value: 0 - objectReference: {fileID: 0} - - target: {fileID: 4855131310118735827, guid: 7d2074c48a1b3544eb534bb509ffc845, - type: 3} - propertyPath: m_LocalRotation.y - value: 1 - objectReference: {fileID: 0} - - target: {fileID: 4855131310118735827, guid: 7d2074c48a1b3544eb534bb509ffc845, - type: 3} - propertyPath: m_LocalRotation.z - value: 0 - objectReference: {fileID: 0} - - target: {fileID: 4855131310118735827, guid: 7d2074c48a1b3544eb534bb509ffc845, - type: 3} - propertyPath: m_LocalEulerAnglesHint.x - value: 0 - objectReference: {fileID: 0} - - target: {fileID: 4855131310118735827, guid: 7d2074c48a1b3544eb534bb509ffc845, - type: 3} - propertyPath: m_LocalEulerAnglesHint.y - value: 0 - objectReference: {fileID: 0} - - target: {fileID: 4855131310118735827, guid: 7d2074c48a1b3544eb534bb509ffc845, - type: 3} - propertyPath: m_LocalEulerAnglesHint.z - value: 0 - objectReference: {fileID: 0} - - target: {fileID: 5200308054099318121, guid: 7d2074c48a1b3544eb534bb509ffc845, - type: 3} - propertyPath: m_Name - value: "Enemy_\u5F13\u7BAD\u624B_4" - objectReference: {fileID: 0} - - target: {fileID: 7720102017902192686, guid: 7d2074c48a1b3544eb534bb509ffc845, - type: 3} - propertyPath: maxHealth - value: 200 - objectReference: {fileID: 0} - - target: {fileID: 7720102017902192686, guid: 7d2074c48a1b3544eb534bb509ffc845, - type: 3} - propertyPath: currentHealth - value: 200 - objectReference: {fileID: 0} - m_RemovedComponents: [] - m_RemovedGameObjects: [] - m_AddedGameObjects: [] - m_AddedComponents: [] - m_SourcePrefab: {fileID: 100100000, guid: 7d2074c48a1b3544eb534bb509ffc845, type: 3} --- !u!1 &1563868219 GameObject: m_ObjectHideFlags: 0 @@ -1137,328 +332,78 @@ Transform: m_Children: [] m_Father: {fileID: 0} m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} ---- !u!1001 &1572651156 -PrefabInstance: +--- !u!1 &1635452944 +GameObject: m_ObjectHideFlags: 0 - serializedVersion: 2 - m_Modification: - serializedVersion: 3 - m_TransformParent: {fileID: 0} - m_Modifications: - - target: {fileID: 2920089167710187078, guid: 04ae1b1fe51474dda8ae5daf0b1df7c1, - type: 3} - propertyPath: maxHealth - value: 300 - objectReference: {fileID: 0} - - target: {fileID: 2920089167710187078, guid: 04ae1b1fe51474dda8ae5daf0b1df7c1, - type: 3} - propertyPath: currentHealth - value: 300 - objectReference: {fileID: 0} - - target: {fileID: 7280232900360528736, guid: 04ae1b1fe51474dda8ae5daf0b1df7c1, - type: 3} - propertyPath: m_LocalPosition.x - value: 1.1686678 - objectReference: {fileID: 0} - - target: {fileID: 7280232900360528736, guid: 04ae1b1fe51474dda8ae5daf0b1df7c1, - type: 3} - propertyPath: m_LocalPosition.y - value: 0 - objectReference: {fileID: 0} - - target: {fileID: 7280232900360528736, guid: 04ae1b1fe51474dda8ae5daf0b1df7c1, - type: 3} - propertyPath: m_LocalPosition.z - value: -15.583392 - objectReference: {fileID: 0} - - target: {fileID: 7280232900360528736, guid: 04ae1b1fe51474dda8ae5daf0b1df7c1, - type: 3} - propertyPath: m_LocalRotation.w - value: 1 - objectReference: {fileID: 0} - - target: {fileID: 7280232900360528736, guid: 04ae1b1fe51474dda8ae5daf0b1df7c1, - type: 3} - propertyPath: m_LocalRotation.x - value: 0 - objectReference: {fileID: 0} - - target: {fileID: 7280232900360528736, guid: 04ae1b1fe51474dda8ae5daf0b1df7c1, - type: 3} - propertyPath: m_LocalRotation.y - value: 0 - objectReference: {fileID: 0} - - target: {fileID: 7280232900360528736, guid: 04ae1b1fe51474dda8ae5daf0b1df7c1, - type: 3} - propertyPath: m_LocalRotation.z - value: 0 - objectReference: {fileID: 0} - - target: {fileID: 7280232900360528736, guid: 04ae1b1fe51474dda8ae5daf0b1df7c1, - type: 3} - propertyPath: m_LocalEulerAnglesHint.x - value: 0 - objectReference: {fileID: 0} - - target: {fileID: 7280232900360528736, guid: 04ae1b1fe51474dda8ae5daf0b1df7c1, - type: 3} - propertyPath: m_LocalEulerAnglesHint.y - value: 0 - objectReference: {fileID: 0} - - target: {fileID: 7280232900360528736, guid: 04ae1b1fe51474dda8ae5daf0b1df7c1, - type: 3} - propertyPath: m_LocalEulerAnglesHint.z - value: 0 - objectReference: {fileID: 0} - - target: {fileID: 7945271050725079514, guid: 04ae1b1fe51474dda8ae5daf0b1df7c1, - type: 3} - propertyPath: m_Name - value: "Friend_\u4EBA\u7C7B\u58EB\u5175_6" - objectReference: {fileID: 0} - - target: {fileID: 7945271050725079514, guid: 04ae1b1fe51474dda8ae5daf0b1df7c1, - type: 3} - propertyPath: m_TagString - value: Friend - objectReference: {fileID: 0} - m_RemovedComponents: [] - m_RemovedGameObjects: [] - m_AddedGameObjects: [] - m_AddedComponents: [] - m_SourcePrefab: {fileID: 100100000, guid: 04ae1b1fe51474dda8ae5daf0b1df7c1, type: 3} ---- !u!1001 &1631682245 -PrefabInstance: + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + serializedVersion: 7 + m_Component: + - component: {fileID: 1635452946} + - component: {fileID: 1635452945} + m_Layer: 0 + m_HasEditorInfo: 1 + m_Name: BattleSetupManager + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!114 &1635452945 +MonoBehaviour: m_ObjectHideFlags: 0 - serializedVersion: 2 - m_Modification: - serializedVersion: 3 - m_TransformParent: {fileID: 0} - m_Modifications: - - target: {fileID: 3773753810590757696, guid: 6be579752d2424feea054ce267928002, - type: 3} - propertyPath: maxHealth - value: 420 - objectReference: {fileID: 0} - - target: {fileID: 3773753810590757696, guid: 6be579752d2424feea054ce267928002, - type: 3} - propertyPath: currentHealth - value: 420 - objectReference: {fileID: 0} - - target: {fileID: 3933539425749946856, guid: 6be579752d2424feea054ce267928002, - type: 3} - propertyPath: m_Name - value: "Friend_\u7CBE\u9510\u58EB\u5175_0" - objectReference: {fileID: 0} - - target: {fileID: 4457840052845775698, guid: 6be579752d2424feea054ce267928002, - type: 3} - propertyPath: m_LocalPosition.x - value: 1.3159285 - objectReference: {fileID: 0} - - target: {fileID: 4457840052845775698, guid: 6be579752d2424feea054ce267928002, - type: 3} - propertyPath: m_LocalPosition.y - value: 0 - objectReference: {fileID: 0} - - target: {fileID: 4457840052845775698, guid: 6be579752d2424feea054ce267928002, - type: 3} - propertyPath: m_LocalPosition.z - value: -15.705374 - objectReference: {fileID: 0} - - target: {fileID: 4457840052845775698, guid: 6be579752d2424feea054ce267928002, - type: 3} - propertyPath: m_LocalRotation.w - value: 1 - objectReference: {fileID: 0} - - target: {fileID: 4457840052845775698, guid: 6be579752d2424feea054ce267928002, - type: 3} - propertyPath: m_LocalRotation.x - value: 0 - objectReference: {fileID: 0} - - target: {fileID: 4457840052845775698, guid: 6be579752d2424feea054ce267928002, - type: 3} - propertyPath: m_LocalRotation.y - value: 0 - objectReference: {fileID: 0} - - target: {fileID: 4457840052845775698, guid: 6be579752d2424feea054ce267928002, - type: 3} - propertyPath: m_LocalRotation.z - value: 0 - objectReference: {fileID: 0} - - target: {fileID: 4457840052845775698, guid: 6be579752d2424feea054ce267928002, - type: 3} - propertyPath: m_LocalEulerAnglesHint.x - value: 0 - objectReference: {fileID: 0} - - target: {fileID: 4457840052845775698, guid: 6be579752d2424feea054ce267928002, - type: 3} - propertyPath: m_LocalEulerAnglesHint.y - value: 0 - objectReference: {fileID: 0} - - target: {fileID: 4457840052845775698, guid: 6be579752d2424feea054ce267928002, - type: 3} - propertyPath: m_LocalEulerAnglesHint.z - value: 0 - objectReference: {fileID: 0} - m_RemovedComponents: [] - m_RemovedGameObjects: [] - m_AddedGameObjects: [] - m_AddedComponents: [] - m_SourcePrefab: {fileID: 100100000, guid: 6be579752d2424feea054ce267928002, type: 3} ---- !u!1001 &1664565141 -PrefabInstance: + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 1635452944} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: 5b10ac6af442644b1bf7fc05b2b2dc37, type: 3} + m_Name: + m_EditorClassIdentifier: + cellSize: 2 + xRange: {x: -8, y: 8} + zRange: {x: -20, y: -8} + maxPopulation: 30 + availableCharacters: + - {fileID: 11400000, guid: 6f138ec1db2b741aab394542890c7400, type: 2} + - {fileID: 11400000, guid: 5a726a224ff5b46718f8f4fc75299bca, type: 2} + - {fileID: 11400000, guid: 49f7e9a7946834177a8dce1ef1c5edb9, type: 2} + - {fileID: 11400000, guid: 51d1dacb02fc441fa9bbea4443e50967, type: 2} + - {fileID: 11400000, guid: 6a793da90a16b4d0c97ab9c3af691849, type: 2} + - {fileID: 11400000, guid: 4ccd7817e665ceb4fbf5b9e6c071321b, type: 2} + - {fileID: 11400000, guid: dc62082d3423e034d9eefb87f7166cb4, type: 2} + - {fileID: 11400000, guid: 1bd8993a0993e72469f2025081b37607, type: 2} + enemyFrontLine: + - {fileID: 11400000, guid: 6f138ec1db2b741aab394542890c7400, type: 2} + - {fileID: 11400000, guid: 6f138ec1db2b741aab394542890c7400, type: 2} + - {fileID: 11400000, guid: 51d1dacb02fc441fa9bbea4443e50967, type: 2} + - {fileID: 11400000, guid: 6a793da90a16b4d0c97ab9c3af691849, type: 2} + - {fileID: 11400000, guid: 6f138ec1db2b741aab394542890c7400, type: 2} + enemyBackLine: + - {fileID: 11400000, guid: 5a726a224ff5b46718f8f4fc75299bca, type: 2} + - {fileID: 11400000, guid: 4ccd7817e665ceb4fbf5b9e6c071321b, type: 2} + - {fileID: 11400000, guid: 49f7e9a7946834177a8dce1ef1c5edb9, type: 2} + - {fileID: 11400000, guid: 5a726a224ff5b46718f8f4fc75299bca, type: 2} + enemyFrontZ: 14 + enemyBackZ: 18 + enemySpacing: 2 +--- !u!4 &1635452946 +Transform: m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 1635452944} serializedVersion: 2 - m_Modification: - serializedVersion: 3 - m_TransformParent: {fileID: 0} - m_Modifications: - - target: {fileID: 2920089167710187078, guid: 04ae1b1fe51474dda8ae5daf0b1df7c1, - type: 3} - propertyPath: maxHealth - value: 300 - objectReference: {fileID: 0} - - target: {fileID: 2920089167710187078, guid: 04ae1b1fe51474dda8ae5daf0b1df7c1, - type: 3} - propertyPath: currentHealth - value: 300 - objectReference: {fileID: 0} - - target: {fileID: 7280232900360528736, guid: 04ae1b1fe51474dda8ae5daf0b1df7c1, - type: 3} - propertyPath: m_LocalPosition.x - value: 1.1686678 - objectReference: {fileID: 0} - - target: {fileID: 7280232900360528736, guid: 04ae1b1fe51474dda8ae5daf0b1df7c1, - type: 3} - propertyPath: m_LocalPosition.y - value: 0 - objectReference: {fileID: 0} - - target: {fileID: 7280232900360528736, guid: 04ae1b1fe51474dda8ae5daf0b1df7c1, - type: 3} - propertyPath: m_LocalPosition.z - value: 14.416608 - objectReference: {fileID: 0} - - target: {fileID: 7280232900360528736, guid: 04ae1b1fe51474dda8ae5daf0b1df7c1, - type: 3} - propertyPath: m_LocalRotation.w - value: -0.00000004371139 - objectReference: {fileID: 0} - - target: {fileID: 7280232900360528736, guid: 04ae1b1fe51474dda8ae5daf0b1df7c1, - type: 3} - propertyPath: m_LocalRotation.x - value: 0 - objectReference: {fileID: 0} - - target: {fileID: 7280232900360528736, guid: 04ae1b1fe51474dda8ae5daf0b1df7c1, - type: 3} - propertyPath: m_LocalRotation.y - value: 1 - objectReference: {fileID: 0} - - target: {fileID: 7280232900360528736, guid: 04ae1b1fe51474dda8ae5daf0b1df7c1, - type: 3} - propertyPath: m_LocalRotation.z - value: 0 - objectReference: {fileID: 0} - - target: {fileID: 7280232900360528736, guid: 04ae1b1fe51474dda8ae5daf0b1df7c1, - type: 3} - propertyPath: m_LocalEulerAnglesHint.x - value: 0 - objectReference: {fileID: 0} - - target: {fileID: 7280232900360528736, guid: 04ae1b1fe51474dda8ae5daf0b1df7c1, - type: 3} - propertyPath: m_LocalEulerAnglesHint.y - value: 0 - objectReference: {fileID: 0} - - target: {fileID: 7280232900360528736, guid: 04ae1b1fe51474dda8ae5daf0b1df7c1, - type: 3} - propertyPath: m_LocalEulerAnglesHint.z - value: 0 - objectReference: {fileID: 0} - - target: {fileID: 7945271050725079514, guid: 04ae1b1fe51474dda8ae5daf0b1df7c1, - type: 3} - propertyPath: m_Name - value: "Enemy_\u4EBA\u7C7B\u58EB\u5175_6" - objectReference: {fileID: 0} - m_RemovedComponents: [] - m_RemovedGameObjects: [] - m_AddedGameObjects: [] - m_AddedComponents: [] - m_SourcePrefab: {fileID: 100100000, guid: 04ae1b1fe51474dda8ae5daf0b1df7c1, type: 3} ---- !u!1001 &1844487676 -PrefabInstance: - m_ObjectHideFlags: 0 - serializedVersion: 2 - m_Modification: - serializedVersion: 3 - m_TransformParent: {fileID: 0} - m_Modifications: - - target: {fileID: 990449840913200210, guid: 6fb249c0311f442ecb190db77248eafc, - type: 3} - propertyPath: maxHealth - value: 160 - objectReference: {fileID: 0} - - target: {fileID: 990449840913200210, guid: 6fb249c0311f442ecb190db77248eafc, - type: 3} - propertyPath: currentHealth - value: 160 - objectReference: {fileID: 0} - - target: {fileID: 7062617501994129594, guid: 6fb249c0311f442ecb190db77248eafc, - type: 3} - propertyPath: m_Name - value: "Enemy_\u6CD5\u5E08_5" - objectReference: {fileID: 0} - - target: {fileID: 7062617501994129594, guid: 6fb249c0311f442ecb190db77248eafc, - type: 3} - propertyPath: m_TagString - value: Enemy - objectReference: {fileID: 0} - - target: {fileID: 7586495671476240896, guid: 6fb249c0311f442ecb190db77248eafc, - type: 3} - propertyPath: m_LocalPosition.x - value: 2.7631547 - objectReference: {fileID: 0} - - target: {fileID: 7586495671476240896, guid: 6fb249c0311f442ecb190db77248eafc, - type: 3} - propertyPath: m_LocalPosition.y - value: 0 - objectReference: {fileID: 0} - - target: {fileID: 7586495671476240896, guid: 6fb249c0311f442ecb190db77248eafc, - type: 3} - propertyPath: m_LocalPosition.z - value: 13.466884 - objectReference: {fileID: 0} - - target: {fileID: 7586495671476240896, guid: 6fb249c0311f442ecb190db77248eafc, - type: 3} - propertyPath: m_LocalRotation.w - value: -0.00000004371139 - objectReference: {fileID: 0} - - target: {fileID: 7586495671476240896, guid: 6fb249c0311f442ecb190db77248eafc, - type: 3} - propertyPath: m_LocalRotation.x - value: 0 - objectReference: {fileID: 0} - - target: {fileID: 7586495671476240896, guid: 6fb249c0311f442ecb190db77248eafc, - type: 3} - propertyPath: m_LocalRotation.y - value: 1 - objectReference: {fileID: 0} - - target: {fileID: 7586495671476240896, guid: 6fb249c0311f442ecb190db77248eafc, - type: 3} - propertyPath: m_LocalRotation.z - value: 0 - objectReference: {fileID: 0} - - target: {fileID: 7586495671476240896, guid: 6fb249c0311f442ecb190db77248eafc, - type: 3} - propertyPath: m_LocalEulerAnglesHint.x - value: 0 - objectReference: {fileID: 0} - - target: {fileID: 7586495671476240896, guid: 6fb249c0311f442ecb190db77248eafc, - type: 3} - propertyPath: m_LocalEulerAnglesHint.y - value: 0 - objectReference: {fileID: 0} - - target: {fileID: 7586495671476240896, guid: 6fb249c0311f442ecb190db77248eafc, - type: 3} - propertyPath: m_LocalEulerAnglesHint.z - value: 0 - objectReference: {fileID: 0} - m_RemovedComponents: [] - m_RemovedGameObjects: [] - m_AddedGameObjects: [] - m_AddedComponents: [] - m_SourcePrefab: {fileID: 100100000, guid: 6fb249c0311f442ecb190db77248eafc, type: 3} + m_LocalRotation: {x: 0, y: 0, z: 0, w: 1} + m_LocalPosition: {x: 0, y: 0, z: 0} + m_LocalScale: {x: 1, y: 1, z: 1} + m_ConstrainProportionsScale: 0 + m_Children: [] + m_Father: {fileID: 0} + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} --- !u!1 &1923261449 GameObject: m_ObjectHideFlags: 0 @@ -1580,172 +525,6 @@ MonoBehaviour: maxX: 4 minZ: -18 maxZ: 34 ---- !u!1001 &1932551464 -PrefabInstance: - m_ObjectHideFlags: 0 - serializedVersion: 2 - m_Modification: - serializedVersion: 3 - m_TransformParent: {fileID: 0} - m_Modifications: - - target: {fileID: 3773753810590757696, guid: 6be579752d2424feea054ce267928002, - type: 3} - propertyPath: maxHealth - value: 420 - objectReference: {fileID: 0} - - target: {fileID: 3773753810590757696, guid: 6be579752d2424feea054ce267928002, - type: 3} - propertyPath: currentHealth - value: 420 - objectReference: {fileID: 0} - - target: {fileID: 3933539425749946856, guid: 6be579752d2424feea054ce267928002, - type: 3} - propertyPath: m_Name - value: "Enemy_\u7CBE\u9510\u58EB\u5175_3" - objectReference: {fileID: 0} - - target: {fileID: 3933539425749946856, guid: 6be579752d2424feea054ce267928002, - type: 3} - propertyPath: m_TagString - value: Enemy - objectReference: {fileID: 0} - - target: {fileID: 4457840052845775698, guid: 6be579752d2424feea054ce267928002, - type: 3} - propertyPath: m_LocalPosition.x - value: -6.95883 - objectReference: {fileID: 0} - - target: {fileID: 4457840052845775698, guid: 6be579752d2424feea054ce267928002, - type: 3} - propertyPath: m_LocalPosition.y - value: 0 - objectReference: {fileID: 0} - - target: {fileID: 4457840052845775698, guid: 6be579752d2424feea054ce267928002, - type: 3} - propertyPath: m_LocalPosition.z - value: 13.36652 - objectReference: {fileID: 0} - - target: {fileID: 4457840052845775698, guid: 6be579752d2424feea054ce267928002, - type: 3} - propertyPath: m_LocalRotation.w - value: -0.00000004371139 - objectReference: {fileID: 0} - - target: {fileID: 4457840052845775698, guid: 6be579752d2424feea054ce267928002, - type: 3} - propertyPath: m_LocalRotation.x - value: 0 - objectReference: {fileID: 0} - - target: {fileID: 4457840052845775698, guid: 6be579752d2424feea054ce267928002, - type: 3} - propertyPath: m_LocalRotation.y - value: 1 - objectReference: {fileID: 0} - - target: {fileID: 4457840052845775698, guid: 6be579752d2424feea054ce267928002, - type: 3} - propertyPath: m_LocalRotation.z - value: 0 - objectReference: {fileID: 0} - - target: {fileID: 4457840052845775698, guid: 6be579752d2424feea054ce267928002, - type: 3} - propertyPath: m_LocalEulerAnglesHint.x - value: 0 - objectReference: {fileID: 0} - - target: {fileID: 4457840052845775698, guid: 6be579752d2424feea054ce267928002, - type: 3} - propertyPath: m_LocalEulerAnglesHint.y - value: 0 - objectReference: {fileID: 0} - - target: {fileID: 4457840052845775698, guid: 6be579752d2424feea054ce267928002, - type: 3} - propertyPath: m_LocalEulerAnglesHint.z - value: 0 - objectReference: {fileID: 0} - m_RemovedComponents: [] - m_RemovedGameObjects: [] - m_AddedGameObjects: [] - m_AddedComponents: [] - m_SourcePrefab: {fileID: 100100000, guid: 6be579752d2424feea054ce267928002, type: 3} ---- !u!1001 &2106004287 -PrefabInstance: - m_ObjectHideFlags: 0 - serializedVersion: 2 - m_Modification: - serializedVersion: 3 - m_TransformParent: {fileID: 0} - m_Modifications: - - target: {fileID: 2920089167710187078, guid: 04ae1b1fe51474dda8ae5daf0b1df7c1, - type: 3} - propertyPath: maxHealth - value: 300 - objectReference: {fileID: 0} - - target: {fileID: 2920089167710187078, guid: 04ae1b1fe51474dda8ae5daf0b1df7c1, - type: 3} - propertyPath: currentHealth - value: 300 - objectReference: {fileID: 0} - - target: {fileID: 7280232900360528736, guid: 04ae1b1fe51474dda8ae5daf0b1df7c1, - type: 3} - propertyPath: m_LocalPosition.x - value: 0.0058984756 - objectReference: {fileID: 0} - - target: {fileID: 7280232900360528736, guid: 04ae1b1fe51474dda8ae5daf0b1df7c1, - type: 3} - propertyPath: m_LocalPosition.y - value: 0 - objectReference: {fileID: 0} - - target: {fileID: 7280232900360528736, guid: 04ae1b1fe51474dda8ae5daf0b1df7c1, - type: 3} - propertyPath: m_LocalPosition.z - value: -13.058489 - objectReference: {fileID: 0} - - target: {fileID: 7280232900360528736, guid: 04ae1b1fe51474dda8ae5daf0b1df7c1, - type: 3} - propertyPath: m_LocalRotation.w - value: 1 - objectReference: {fileID: 0} - - target: {fileID: 7280232900360528736, guid: 04ae1b1fe51474dda8ae5daf0b1df7c1, - type: 3} - propertyPath: m_LocalRotation.x - value: 0 - objectReference: {fileID: 0} - - target: {fileID: 7280232900360528736, guid: 04ae1b1fe51474dda8ae5daf0b1df7c1, - type: 3} - propertyPath: m_LocalRotation.y - value: 0 - objectReference: {fileID: 0} - - target: {fileID: 7280232900360528736, guid: 04ae1b1fe51474dda8ae5daf0b1df7c1, - type: 3} - propertyPath: m_LocalRotation.z - value: 0 - objectReference: {fileID: 0} - - target: {fileID: 7280232900360528736, guid: 04ae1b1fe51474dda8ae5daf0b1df7c1, - type: 3} - propertyPath: m_LocalEulerAnglesHint.x - value: 0 - objectReference: {fileID: 0} - - target: {fileID: 7280232900360528736, guid: 04ae1b1fe51474dda8ae5daf0b1df7c1, - type: 3} - propertyPath: m_LocalEulerAnglesHint.y - value: 0 - objectReference: {fileID: 0} - - target: {fileID: 7280232900360528736, guid: 04ae1b1fe51474dda8ae5daf0b1df7c1, - type: 3} - propertyPath: m_LocalEulerAnglesHint.z - value: 0 - objectReference: {fileID: 0} - - target: {fileID: 7945271050725079514, guid: 04ae1b1fe51474dda8ae5daf0b1df7c1, - type: 3} - propertyPath: m_Name - value: "Friend_\u4EBA\u7C7B\u58EB\u5175_7" - objectReference: {fileID: 0} - - target: {fileID: 7945271050725079514, guid: 04ae1b1fe51474dda8ae5daf0b1df7c1, - type: 3} - propertyPath: m_TagString - value: Friend - objectReference: {fileID: 0} - m_RemovedComponents: [] - m_RemovedGameObjects: [] - m_AddedGameObjects: [] - m_AddedComponents: [] - m_SourcePrefab: {fileID: 100100000, guid: 04ae1b1fe51474dda8ae5daf0b1df7c1, type: 3} --- !u!1660057539 &9223372036854775807 SceneRoots: m_ObjectHideFlags: 0 @@ -1753,19 +532,4 @@ SceneRoots: - {fileID: 1923261452} - {fileID: 290942437} - {fileID: 1563868223} - - {fileID: 1631682245} - - {fileID: 1191980862} - - {fileID: 723932963} - - {fileID: 270900691} - - {fileID: 1442734776} - - {fileID: 697871298} - - {fileID: 1572651156} - - {fileID: 2106004287} - - {fileID: 225324703} - - {fileID: 1100396753} - - {fileID: 690042700} - - {fileID: 1932551464} - - {fileID: 1482853062} - - {fileID: 1844487676} - - {fileID: 1664565141} - - {fileID: 408319471} + - {fileID: 1635452946} diff --git a/Assets/Script/BattleSetupManager.cs b/Assets/Script/BattleSetupManager.cs new file mode 100644 index 0000000..4c03e1f --- /dev/null +++ b/Assets/Script/BattleSetupManager.cs @@ -0,0 +1,550 @@ +using System.Collections.Generic; +using UnityEngine; +using UnityEngine.EventSystems; +using UnityEngine.UI; + +// 决战玩法管理器:布阵阶段在己方半场网格放置单位,开战后生成敌方阵型,全灭判定胜负。 +public class BattleSetupManager : MonoBehaviour +{ + public static BattleSetupManager Instance { get; private set; } + + public enum BattleState { Setup, Battle, Ended } + + [Header("布阵网格")] + public float cellSize = 2f; + public Vector2 xRange = new Vector2(-8f, 8f); + public Vector2 zRange = new Vector2(-20f, -8f); + + [Header("人口")] + public int maxPopulation = 30; + + [Header("可用兵种(生成底部卡片)")] + public CharacterData[] availableCharacters; + + [Header("敌方阵型")] + public CharacterData[] enemyFrontLine; + public CharacterData[] enemyBackLine; + public float enemyFrontZ = 14f; + public float enemyBackZ = 18f; + public float enemySpacing = 2f; + + public BattleState State { get; private set; } = BattleState.Setup; + public int RemainingPopulation => maxPopulation - usedPopulation; + + // 已放置单位 -> 格子与数据,移除时退回人口。 + private class PlacementRecord + { + public Vector2Int cell; + public CharacterData data; + } + + private readonly HashSet occupiedCells = new HashSet(); + private readonly Dictionary placements = new Dictionary(); + private readonly Dictionary cardImages = new Dictionary(); + + private CharacterData selectedCharacter; + private int usedPopulation; + private Camera mainCamera; + private GameObject cellHighlight; + private Material highlightMaterial; + private GameObject startButton; + private Text populationText; + private Text resultText; + private float endCheckTimer; + + private static readonly Color ValidCellColor = new Color(0.2f, 1f, 0.3f, 0.35f); + private static readonly Color InvalidCellColor = new Color(1f, 0.25f, 0.2f, 0.35f); + private static readonly Color CardNormalColor = new Color(0.15f, 0.15f, 0.2f, 0.85f); + private static readonly Color CardSelectedColor = new Color(0.2f, 0.55f, 0.25f, 0.95f); + + private void Awake() + { + if (Instance != null && Instance != this) + { + Destroy(gameObject); + return; + } + + Instance = this; + } + + private void Start() + { + mainCamera = Camera.main; + CreateCellHighlight(); + CreateCardUI(); + CreateStartButton(); + CreateResultText(); + } + + private void Update() + { + if (State == BattleState.Setup) + { + HandleSetupInput(); + } + else if (State == BattleState.Battle) + { + CheckBattleEnd(); + } + } + + // 布阵阶段输入:选兵种后点格子放置,点击已放单位移除。 + private void HandleSetupInput() + { + if (mainCamera == null) + { + mainCamera = Camera.main; + if (mainCamera == null) return; + } + + bool overUI = EventSystem.current != null && EventSystem.current.IsPointerOverGameObject(); + bool highlightVisible = !overUI && selectedCharacter != null; + if (cellHighlight != null) + { + cellHighlight.SetActive(highlightVisible); + } + + if (!highlightVisible) return; + if (!RaycastGround(out Vector3 groundPoint)) return; + + Vector2Int cell = WorldToCell(groundPoint); + bool cellValid = IsCellInRange(cell) && !occupiedCells.Contains(cell); + + cellHighlight.transform.position = new Vector3(cell.x * cellSize, 0.02f, cell.y * cellSize); + highlightMaterial.color = cellValid ? ValidCellColor : InvalidCellColor; + + if (Input.GetMouseButtonDown(0)) + { + // 优先移除点中的己方单位。 + if (TryRemoveUnitAtMouse()) return; + + if (cellValid) + { + PlaceUnit(selectedCharacter, cell); + } + } + } + + // 卡片点击入口:选中/再点取消。 + public void SelectCharacter(CharacterData data) + { + if (State != BattleState.Setup || data == null) return; + + if (selectedCharacter == data) + { + selectedCharacter = null; + } + else if (RemainingPopulation >= data.manaCost) + { + selectedCharacter = data; + } + else + { + Debug.Log($"人口不足,{data.characterName}需要{data.manaCost}人口,剩余{RemainingPopulation}"); + return; + } + + RefreshCardSelection(); + } + + // 人口是否足够,供卡片按钮判断可用性。 + public bool CanAfford(CharacterData data) + { + return data != null && RemainingPopulation >= data.manaCost; + } + + public void StartBattle() + { + if (State != BattleState.Setup) return; + if (placements.Count == 0) + { + Debug.Log("请先放置至少一个单位再开战"); + return; + } + + selectedCharacter = null; + RefreshCardSelection(); + SpawnEnemyLine(enemyFrontLine, enemyFrontZ); + SpawnEnemyLine(enemyBackLine, enemyBackZ); + + State = BattleState.Battle; + if (startButton != null) startButton.SetActive(false); + if (populationText != null) populationText.gameObject.SetActive(false); + if (cellHighlight != null) cellHighlight.SetActive(false); + Debug.Log("战斗开始!"); + } + + // 每0.5秒统计双方存活,全灭判定胜负。 + private void CheckBattleEnd() + { + endCheckTimer += Time.deltaTime; + if (endCheckTimer < 0.5f) return; + endCheckTimer = 0f; + + int friends = CountActiveUnits("Friend"); + int enemies = CountActiveUnits("Enemy"); + + if (friends == 0 && enemies == 0) + { + EndBattle("平局!"); + } + else if (enemies == 0) + { + EndBattle("胜利!"); + } + else if (friends == 0) + { + EndBattle("失败"); + } + } + + private static int CountActiveUnits(string tag) + { + // 单位死亡时会被立即隐藏并销毁,只统计激活对象。 + GameObject[] objects = GameObject.FindGameObjectsWithTag(tag); + int count = 0; + foreach (GameObject obj in objects) + { + if (obj.activeInHierarchy) count++; + } + return count; + } + + private void EndBattle(string result) + { + State = BattleState.Ended; + if (resultText != null) + { + resultText.text = result; + resultText.gameObject.SetActive(true); + } + Debug.Log($"战斗结束:{result}"); + } + + // ===== 放置与移除 ===== + + private void PlaceUnit(CharacterData data, Vector2Int cell) + { + if (data == null || data.unitPrefab == null) return; + if (RemainingPopulation < data.manaCost) return; + if (!occupiedCells.Add(cell)) return; + + Vector3 position = CellToWorld(cell); + GameObject unit = Instantiate(data.unitPrefab, position, Quaternion.identity); + unit.name = "Friend_" + data.characterName; + unit.tag = "Friend"; + + var unitBase = unit.GetComponent(); + if (unitBase != null) + { + unitBase.InitializeFromPlayerData( + data.GetMaxHealth(1), + data.GetAttackPower(1), + data.GetMoveSpeed(1)); + } + + placements[unit] = new PlacementRecord { cell = cell, data = data }; + usedPopulation += data.manaCost; + UpdatePopulationText(); + + if (RemainingPopulation <= 0) + { + selectedCharacter = null; + RefreshCardSelection(); + } + } + + private bool TryRemoveUnitAtMouse() + { + Ray ray = mainCamera.ScreenPointToRay(Input.mousePosition); + RaycastHit[] hits = Physics.RaycastAll(ray, 200f); + + GameObject closest = null; + float closestDistance = float.MaxValue; + foreach (RaycastHit hit in hits) + { + var unitBase = hit.collider.GetComponentInParent(); + if (unitBase != null && unitBase.CompareTag("Friend") && placements.ContainsKey(unitBase.gameObject)) + { + if (hit.distance < closestDistance) + { + closestDistance = hit.distance; + closest = unitBase.gameObject; + } + } + } + + if (closest == null) return false; + + if (placements.TryGetValue(closest, out PlacementRecord record)) + { + occupiedCells.Remove(record.cell); + usedPopulation -= record.data.manaCost; + placements.Remove(closest); + UpdatePopulationText(); + } + + Destroy(closest); + return true; + } + + // ===== 敌方阵型 ===== + + private void SpawnEnemyLine(CharacterData[] line, float z) + { + if (line == null) return; + + float startX = -(line.Length - 1) * 0.5f * enemySpacing; + for (int i = 0; i < line.Length; i++) + { + CharacterData data = line[i]; + if (data == null || data.unitPrefab == null) continue; + + GameObject unit = Instantiate( + data.unitPrefab, + new Vector3(startX + i * enemySpacing, 0f, z), + Quaternion.Euler(0f, 180f, 0f)); + unit.name = "Enemy_" + data.characterName; + unit.tag = "Enemy"; + + var unitBase = unit.GetComponent(); + if (unitBase != null) + { + unitBase.InitializeFromPlayerData( + data.GetMaxHealth(1), + data.GetAttackPower(1), + data.GetMoveSpeed(1)); + } + } + } + + // ===== 网格工具 ===== + + private Vector2Int WorldToCell(Vector3 world) + { + return new Vector2Int( + Mathf.RoundToInt(world.x / cellSize), + Mathf.RoundToInt(world.z / cellSize)); + } + + private Vector3 CellToWorld(Vector2Int cell) + { + return new Vector3(cell.x * cellSize, 0f, cell.y * cellSize); + } + + private bool IsCellInRange(Vector2Int cell) + { + float x = cell.x * cellSize; + float z = cell.y * cellSize; + return x >= xRange.x && x <= xRange.y && z >= zRange.x && z <= zRange.y; + } + + private bool RaycastGround(out Vector3 point) + { + point = Vector3.zero; + if (mainCamera == null) return false; + + Ray ray = mainCamera.ScreenPointToRay(Input.mousePosition); + if (Physics.Raycast(ray, out RaycastHit hit, 200f)) + { + point = hit.point; + return true; + } + return false; + } + + // ===== UI 创建(代码生成,无需场景预制) ===== + + private Canvas EnsureCanvas() + { + Canvas canvas = FindObjectOfType(); + if (canvas == null) + { + GameObject canvasObject = new GameObject("Canvas", typeof(Canvas), typeof(CanvasScaler), typeof(GraphicRaycaster)); + canvas = canvasObject.GetComponent(); + canvas.renderMode = RenderMode.ScreenSpaceOverlay; + + var scaler = canvasObject.GetComponent(); + scaler.uiScaleMode = CanvasScaler.ScaleMode.ScaleWithScreenSize; + scaler.referenceResolution = new Vector2(1080f, 1920f); + scaler.matchWidthOrHeight = 0.5f; + } + + if (FindObjectOfType() == null) + { + new GameObject("EventSystem", typeof(EventSystem), typeof(StandaloneInputModule)); + } + + return canvas; + } + + private void CreateCellHighlight() + { + cellHighlight = GameObject.CreatePrimitive(PrimitiveType.Quad); + cellHighlight.name = "CellHighlight"; + // 高亮块不能挡射线,删掉自带的碰撞体。 + Destroy(cellHighlight.GetComponent()); + cellHighlight.transform.rotation = Quaternion.Euler(90f, 0f, 0f); + cellHighlight.transform.localScale = new Vector3(cellSize * 0.95f, cellSize * 0.95f, 1f); + cellHighlight.transform.position = new Vector3(0f, 0.02f, 0f); + + highlightMaterial = new Material(Shader.Find("Sprites/Default")); + highlightMaterial.color = ValidCellColor; + cellHighlight.GetComponent().sharedMaterial = highlightMaterial; + cellHighlight.SetActive(false); + } + + private void CreateCardUI() + { + if (availableCharacters == null || availableCharacters.Length == 0) return; + + Canvas canvas = EnsureCanvas(); + const float cardWidth = 108f; + const float cardHeight = 150f; + const float gap = 10f; + + int count = availableCharacters.Length; + float totalWidth = count * cardWidth + (count - 1) * gap; + float startX = -totalWidth * 0.5f + cardWidth * 0.5f; + + for (int i = 0; i < count; i++) + { + CharacterData data = availableCharacters[i]; + if (data == null) continue; + + GameObject card = new GameObject("卡片_" + data.characterName, typeof(RectTransform), typeof(Image), typeof(Button)); + card.transform.SetParent(canvas.transform, false); + + var cardRect = card.GetComponent(); + cardRect.anchorMin = cardRect.anchorMax = new Vector2(0.5f, 0f); + cardRect.pivot = new Vector2(0.5f, 0f); + cardRect.anchoredPosition = new Vector2(startX + i * (cardWidth + gap), 24f); + cardRect.sizeDelta = new Vector2(cardWidth, cardHeight); + + var cardImage = card.GetComponent(); + cardImage.color = CardNormalColor; + cardImages[data] = cardImage; + + // 头像占上半部。 + GameObject iconObject = new GameObject("Icon", typeof(RectTransform), typeof(Image)); + iconObject.transform.SetParent(card.transform, false); + var iconRect = iconObject.GetComponent(); + iconRect.anchorMin = new Vector2(0.08f, 0.35f); + iconRect.anchorMax = new Vector2(0.92f, 0.95f); + iconRect.offsetMin = Vector2.zero; + iconRect.offsetMax = Vector2.zero; + var iconImage = iconObject.GetComponent(); + if (data.cardIcon != null) + { + iconImage.sprite = data.cardIcon; + iconImage.preserveAspect = true; + } + else + { + iconImage.color = new Color(0.4f, 0.4f, 0.45f, 1f); + } + + // 名字占底部。 + CreateChildText(card.transform, "Name", data.characterName, 26, + new Vector2(0.05f, 0.02f), new Vector2(0.95f, 0.28f)); + + // 人口占顶部。 + CreateChildText(card.transform, "Cost", data.manaCost + "人口", 28, + new Vector2(0.05f, 0.72f), new Vector2(0.95f, 0.98f), new Color(1f, 0.85f, 0.3f)); + + // 挂通用卡片按钮:点击进入选兵,人口不足自动置灰。 + var summonButton = card.AddComponent(); + summonButton.characterData = data; + } + } + + private void CreateStartButton() + { + Canvas canvas = EnsureCanvas(); + + startButton = new GameObject("开战按钮", typeof(RectTransform), typeof(Image), typeof(Button)); + startButton.transform.SetParent(canvas.transform, false); + + var buttonRect = startButton.GetComponent(); + buttonRect.anchorMin = buttonRect.anchorMax = new Vector2(0.5f, 1f); + buttonRect.pivot = new Vector2(0.5f, 1f); + buttonRect.anchoredPosition = new Vector2(0f, -30f); + buttonRect.sizeDelta = new Vector2(220f, 90f); + + startButton.GetComponent().color = new Color(0.75f, 0.2f, 0.15f, 0.95f); + CreateChildText(startButton.transform, "Label", "开 战", 44, + Vector2.zero, Vector2.one, Color.white); + + startButton.GetComponent