yyl
2025-11-20 9e89e605d5429babb4b33df2e47ea86dff9d2ba7
Main/System/MainLevel/MainBossEnterWin.cs
@@ -22,7 +22,9 @@
    [SerializeField] Button rankBtn;
    [SerializeField] ItemCell[] passAwards;
    [SerializeField] Button fightBtn;
    [SerializeField] Image fightIcon;
    [SerializeField] ScrollerController dropItemScroller;
    [SerializeField] Button heroRoadBtn;
    protected override void InitComponent()
@@ -38,6 +40,11 @@
        });
        fightBtn.AddListener(FightBoss);
        heroRoadBtn.AddListener(() =>
        {
            UIManager.Instance.OpenWindow<DayMissionBaseWin>(2);
        });
    }
    protected override void OnPreOpen()
@@ -105,9 +112,10 @@
        fightPowerText.text = UIHelper.ReplaceLargeArtNum(levelConfig.FightPower);
        var canChallengeBoss = AutoFightModel.Instance.CanChallengeBoss();
        var canChallengeBoss = MainLevelManager.Instance.CanChallengeBoss();
        fightBtn.SetInteractable(canChallengeBoss);
        fightIcon.SetActive(canChallengeBoss);
        for (int i = 0; i < passAwards.Length; i++)
        {
@@ -127,17 +135,17 @@
            }
        }
        bossBG.SetOrgSprite(chapterConfig.BG, "MainLevel");
        heroRoadBtn.SetActive(FuncOpen.Instance.IsFuncOpen((int)FuncOpenEnum.DayMission));
    }
    void FightBoss()
    {
        if (AutoFightModel.Instance.CanChallengeBoss())
        if (MainLevelManager.Instance.CanChallengeBoss())
        {
            var pack = new CB410_tagCMTurnFight();
            pack.MapID = 2;
            GameNetSystem.Instance.SendInfo(pack);
            BattleManager.Instance.SendTurnFight(2);
            BattleManager.Instance.storyBattleField.CleanBattle();
            AutoFightModel.Instance.isPause = true;
        }
        CloseWindow();
@@ -150,10 +158,10 @@
        {
            case PlayerDataType.ExAttr1:
            case PlayerDataType.ExAttr2:
                var canChallengeBoss = AutoFightModel.Instance.CanChallengeBoss();
                var canChallengeBoss = MainLevelManager.Instance.CanChallengeBoss();
                fightBtn.interactable = canChallengeBoss;
                fightBtn.SetColorful(null, canChallengeBoss);
                fightBtn.SetInteractable(canChallengeBoss);
                fightIcon.SetActive(canChallengeBoss);
                break;
        }