hch
6 天以前 b19666d8acba43e715688da14fe19f029050e588
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,8 +307,18 @@
    protected override void SetRootNodePosition()
    {
        battleRootNode.imgBackground.rectTransform.anchoredPosition = battleRootNode.bgPos1.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;
    }
    }
    
    //暂停的原因有很多,需要检查各种状态