From b19666d8acba43e715688da14fe19f029050e588 Mon Sep 17 00:00:00 2001
From: hch <305670599@qq.com>
Date: 星期五, 24 十月 2025 16:40:26 +0800
Subject: [PATCH] Merge branch 'master' of http://mobile.secondworld.net.cn:10010/r/Project_SG_scripts
---
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