From 02d1a98d6a500d41754346cb5f3a1f3c61e0b125 Mon Sep 17 00:00:00 2001
From: yyl <yyl>
Date: 星期五, 24 十月 2025 16:27:15 +0800
Subject: [PATCH] 125 战斗 闪避特效 + 背景图 + 宽比>1.9的偏移

---
 Main/System/Battle/BattleField/StoryBattleField.cs |   37 ++++++++++++++++++++++++++++++-------
 1 files changed, 30 insertions(+), 7 deletions(-)

diff --git a/Main/System/Battle/BattleField/StoryBattleField.cs b/Main/System/Battle/BattleField/StoryBattleField.cs
index 9b6c5fe..e95ae50 100644
--- a/Main/System/Battle/BattleField/StoryBattleField.cs
+++ b/Main/System/Battle/BattleField/StoryBattleField.cs
@@ -38,6 +38,14 @@
     public override void Init(int MapID, int FuncLineID, JsonData _extendData,
         List<TeamBase> _redTeamList, List<TeamBase> _blueTeamList, byte turnMax)
     {
+        chapter = FuncLineID / 10000;
+        wave = MapID == 1 ? FuncLineID % 100 : 1;//绗嚑娉㈡��
+        level = (FuncLineID % 10000) / 100;
+
+        extendData = _extendData;
+        chapterConfig = MainChapterConfig.Get(chapter);
+        levelConfig = MainLevelConfig.Get(level);
+        
         base.Init(MapID, FuncLineID, extendData, _redTeamList, _blueTeamList, turnMax);
 
         if (null == _blueTeamList || _blueTeamList.Count == 0)
@@ -51,15 +59,20 @@
 
         // LoadBattleMode();
 
-        chapter = FuncLineID / 10000;
-        wave = MapID == 1 ? FuncLineID % 100 : 1;//绗嚑娉㈡��
-        level = (FuncLineID % 10000) / 100;
 
-        extendData = _extendData;
-        chapterConfig = MainChapterConfig.Get(chapter);
-        levelConfig = MainLevelConfig.Get(level);
+
+
 
         TeamManager.Instance.OnTeamChange += OnTeamChange;
+    }
+
+    protected override void LoadMap(int mapID)
+    {
+        if (chapterConfig != null)
+        {
+            Texture texture = ResManager.Instance.LoadAsset<Texture>("Texture/FullScreenBg", chapterConfig.BG);
+            battleRootNode.SetBackground(texture);
+        }
     }
 
     public override void Release()
@@ -294,7 +307,17 @@
     protected override void SetRootNodePosition()
     {
         battleRootNode.imgBackground.rectTransform.anchoredPosition = battleRootNode.bgPos1.anchoredPosition;
-        battleRootNode.battleNode.anchoredPosition = battleRootNode.battleNodePos1.anchoredPosition;
+
+        float screenRatio = (float)Screen.height / (float)Screen.width;
+
+		if (screenRatio > 1.9f)
+		{
+            battleRootNode.battleNode.anchoredPosition = battleRootNode.battleNodePos1.anchoredPosition + new Vector2(0, 60f);
+		}
+		else
+        {
+            battleRootNode.battleNode.anchoredPosition = battleRootNode.battleNodePos1.anchoredPosition;
+        }
     }
     
 

--
Gitblit v1.8.0