hch
2025-09-01 5b8a8c82864d4ea7e2f93484bd26f293dd31979d
50 【主界面】核心主体 - 主线BOS界面
1 文件已重命名
5个文件已修改
2个文件已删除
7个文件已添加
570 ■■■■ 已修改文件
Main/Config/Configs/MainChapterConfig.cs 5 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
Main/Config/PartialConfigs/MainChapterConfig.cs 26 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
Main/Config/PartialConfigs/MainChapterConfig.cs.meta 11 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
Main/Core/NetworkPackage/DTCFile/ServerPack/HB1_Role/DTCB123_tagSCDropBootyInfo.cs 12 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
Main/Main.cs 1 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
Main/System/Boss.meta 8 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
Main/System/Boss/MainBossEnterWin.cs 66 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
Main/System/ItemTip/SmallTipWin.cs 42 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
Main/System/MainLevel/MainBossEnterWin.cs 185 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
Main/System/MainLevel/MainBossEnterWin.cs.meta 补丁 | 查看 | 原始文档 | blame | 历史
Main/System/MainLevel/MainLevelDropCell.cs 62 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
Main/System/MainLevel/MainLevelDropCell.cs.meta 11 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
Main/System/MainLevel/MainLevelManager.cs 21 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
Main/System/SkillUI/SkillWordCell.cs 109 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
Main/System/SkillUI/SkillWordCell.cs.meta 11 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
Main/Config/Configs/MainChapterConfig.cs
@@ -1,6 +1,6 @@
//--------------------------------------------------------
//    [Author]:           YYL
//    [  Date ]:           Thursday, August 14, 2025
//    [  Date ]:           2025年9月1日
//--------------------------------------------------------
using System.Collections.Generic;
@@ -21,6 +21,7 @@
    public string Level;
    public string MapBG;
    public int[][] DailyBootyUpperList;
    public string BG;
    public override int LoadKey(string _key)
    {
@@ -41,6 +42,8 @@
            MapBG = tables[3];
            DailyBootyUpperList = JsonMapper.ToObject<int[][]>(tables[4].Replace("(", "[").Replace(")", "]")); 
            BG = tables[5];
        }
        catch (Exception exception)
        {
Main/Config/PartialConfigs/MainChapterConfig.cs
New file
@@ -0,0 +1,26 @@
using System.Collections.Generic;
using System.Collections.Specialized;
public partial class MainChapterConfig : ConfigBase<int, MainChapterConfig>
{
    public static OrderedDictionary unLockedChapterDict = new OrderedDictionary();
    protected override void OnConfigParseCompleted()
    {
        for (int i = 0; i < DailyBootyUpperList.Length; i++)
        {
            int itemID = DailyBootyUpperList[i][0];
            if (!unLockedChapterDict.Contains(itemID))
            {
                unLockedChapterDict.Add(itemID, ChapterID);
            }
        }
    }
}
Main/Config/PartialConfigs/MainChapterConfig.cs.meta
New file
@@ -0,0 +1,11 @@
fileFormatVersion: 2
guid: e0fb13dc55216ce41ace6dda01db730a
MonoImporter:
  externalObjects: {}
  serializedVersion: 2
  defaultReferences: []
  executionOrder: 0
  icon: {instanceID: 0}
  userData:
  assetBundleName:
  assetBundleVariant:
Main/Core/NetworkPackage/DTCFile/ServerPack/HB1_Role/DTCB123_tagSCDropBootyInfo.cs
@@ -1,11 +1,15 @@
using UnityEngine;
using System.Collections;
using UnityEngine;
using System.Collections;
// B1 23 每日掉落战利品信息 #tagSCDropBootyInfo
public class DTCB123_tagSCDropBootyInfo : DtcBasic {
    public override void Done(GameNetPackBasic vNetPack) {
    public override void Done(GameNetPackBasic vNetPack)
    {
        base.Done(vNetPack);
        HB123_tagSCDropBootyInfo vNetData = vNetPack as HB123_tagSCDropBootyInfo;
        MainLevelManager.Instance.UpdateDayDropBooty(vNetData);
    }
}
Main/Main.cs
@@ -78,6 +78,7 @@
        managers.Add(InvestModel.Instance);
        managers.Add(BlessLVManager.Instance);
        managers.Add(AutoFightModel.Instance);
        managers.Add(MainLevelManager.Instance);
        foreach (var manager in managers)
        {
Main/System/Boss.meta
File was deleted
Main/System/Boss/MainBossEnterWin.cs
File was deleted
Main/System/ItemTip/SmallTipWin.cs
@@ -3,22 +3,31 @@
using UnityEngine.UI;
/// <summary>
/// 文本提示界面
/// 文本提示界面:外部传入文本内容和世界坐标系位置
/// </summary>
public class SmallTipWin : UIBase
{
    [SerializeField] RectTransform rectTransform;
    [SerializeField] RectTransform arrowImage;
    [SerializeField] RectTransform arrowUpImage;
    [SerializeField] Text descText;
    public static Vector3 worldPos; //世界坐标系位置
    public static string showText;
    public static bool isDownShow = false;  // 是否向下显示
    protected override void OnPreOpen()
    {
    {
        descText.text = showText;
        rectTransform.position = new Vector3(100, 100, 100);   //初始化时,屏幕范围外
        arrowImage.SetActive(!isDownShow);
        arrowUpImage.SetActive(isDownShow);
    }
    protected override void OnPreClose()
    {
        isDownShow = false;
    }
    
@@ -45,14 +54,23 @@
        float screenHeight = maxY - minY;
        Vector2 adjustedPos = new Vector2(worldPos.x, worldPos.y + screenHeight * 0.5f);
        Vector2 adjustedPos = new Vector2(worldPos.x, worldPos.y + (!isDownShow ? screenHeight * 0.5f : -screenHeight * 0.5f));
        Vector2 screenAdjustedPos = CameraManager.uiCamera.WorldToScreenPoint(adjustedPos);
        screenAdjustedPos.x = Mathf.Clamp(screenAdjustedPos.x, rectTransform.rect.width * 0.5f, Screen.width - rectTransform.rect.width * 0.5f);
        screenAdjustedPos.y = Mathf.Clamp(screenAdjustedPos.y, rectTransform.rect.height * 0.5f, Screen.height - rectTransform.rect.height * 0.5f - 15);
        adjustedPos = CameraManager.uiCamera.ScreenToWorldPoint(screenAdjustedPos);
        rectTransform.position = adjustedPos;
        rectTransform.localPosition = new Vector3(rectTransform.localPosition.x, rectTransform.localPosition.y + 15, rectTransform.localPosition.z);
        if (!isDownShow)
        {
            rectTransform.localPosition = new Vector3(rectTransform.localPosition.x, rectTransform.localPosition.y + 15, rectTransform.localPosition.z);
        }
        else
        {
            rectTransform.localPosition = new Vector3(rectTransform.localPosition.x, rectTransform.localPosition.y - 15, rectTransform.localPosition.z);
        }
        rectTransform.GetWorldCorners(corners);
        float minX = corners[0].x;
@@ -63,10 +81,20 @@
            if (corners[i].x < minX) minX = corners[i].x;
            if (corners[i].x > maxX) maxX = corners[i].x;
        }
        //显示arrowImage 的x轴上的位置,和worldPos同步,但不超过minX 和 maxX范围
        Vector3 arrowImagePosition = arrowImage.position;
        arrowImagePosition.x = Mathf.Clamp(worldPos.x, minX, maxX);
        arrowImage.position = arrowImagePosition;
        if (!isDownShow)
        {
            Vector3 arrowImagePosition = arrowImage.position;
            arrowImagePosition.x = Mathf.Clamp(worldPos.x, minX, maxX);
            arrowImage.position = arrowImagePosition;
        }
        else
        {
            Vector3 arrowUpImagePosition = arrowUpImage.position;
            arrowUpImagePosition.x = Mathf.Clamp(worldPos.x, minX, maxX);
            arrowUpImage.position = arrowUpImagePosition;
        }
    }
}
Main/System/MainLevel/MainBossEnterWin.cs
New file
@@ -0,0 +1,185 @@
//--------------------------------------------------------
//    [Author]:           玩个游戏
//    [  Date ]:           Tuesday, July 24, 2018
//--------------------------------------------------------
using System;
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
using UnityEngine.UI;
public class MainBossEnterWin : UIBase
{
    [SerializeField] Text fbNameText;
    [SerializeField] Button CloseBtn;
    [SerializeField] Text bossNameText;
    [SerializeField] Image bossBG;
    [SerializeField] SkillWordCell[] skillWordCells;
    [SerializeField] UIHeroController bossModel;
    [SerializeField] Text fightPowerText;
    [SerializeField] Button rankBtn;
    [SerializeField] ItemCell[] passAwards;
    [SerializeField] Button fightBtn;
    [SerializeField] ScrollerController dropItemScroller;
    protected override void InitComponent()
    {
        CloseBtn.AddListener(CloseWindow);
        rankBtn.AddListener(() =>
        {
            RankModel.Instance.ResetQueryParam();
            RankModel.Instance.QueryRankByPage(0, watchID: (int)PlayerDatas.Instance.baseData.PlayerID);
            var win = UIManager.Instance.OpenWindow<PlayerRankWin>();
            win.rankType = 0;
        });
        fightBtn.AddListener(FightBoss);
    }
    protected override void OnPreOpen()
    {
        PlayerDatas.Instance.playerDataRefreshEvent += PlayerDataRefresh;
        dropItemScroller.OnRefreshCell += OnRefreshCell;
        MainLevelManager.Instance.OnUpdateDayBooty += UpdateDayBooty;
        Display();
        CreateScroller();
    }
    protected override void OnPreClose()
    {
        PlayerDatas.Instance.playerDataRefreshEvent -= PlayerDataRefresh;
        dropItemScroller.OnRefreshCell -= OnRefreshCell;
        MainLevelManager.Instance.OnUpdateDayBooty -= UpdateDayBooty;
    }
    void Display()
    {
        var value = PlayerDatas.Instance.baseData.ExAttr2;
        var chapterID = value / 10000;
        var levelNum = value % 10000 / 100;
        var chapterConfig = MainChapterConfig.Get(chapterID);
        //【普通】关卡名字1-6
        fbNameText.text = Language.Get("mainui7", chapterConfig.Level, chapterConfig.ChapterName, chapterID, levelNum);
        var levelConfig = MainLevelConfig.GetMainLevelConfig(chapterID, levelNum);
        var lineUPID = levelConfig.BossLineupIDList[levelConfig.BossLineupIDList.Length - 1];
        var lineUPConfig = NPCLineupConfig.Get(lineUPID);
        var npcConfig = NPCConfig.Get(lineUPConfig.BossID);
        if (npcConfig == null)
        {
            Debug.LogErrorFormat("NPC未配置 : {0}", lineUPConfig.BossID);
            return;
        }
        bossNameText.text = npcConfig.NPCName;
        for (int i = 0; i < skillWordCells.Length; i++)
        {
            if (i < lineUPConfig.SkillIDExList.Length)
            {
                skillWordCells[i].SetActive(true);
                int skillID = lineUPConfig.SkillIDExList[i];
                skillWordCells[i].Init(skillID, () =>
                {
                    SmallTipWin.showText = SkillConfig.Get(skillID)?.Description;
                    SmallTipWin.worldPos = CameraManager.uiCamera.ScreenToWorldPoint(Input.mousePosition);
                    SmallTipWin.isDownShow = true;
                    UIManager.Instance.OpenWindow<SmallTipWin>();
                });
            }
            else
            {
                skillWordCells[i].SetActive(false);
            }
        }
        bossModel.Create(npcConfig.SkinID, npcConfig.ModelScale);
        fightPowerText.text = UIHelper.ReplaceLargeArtNum(levelConfig.FightPower);
        var canChallengeBoss = AutoFightModel.Instance.CanChallengeBoss();
        fightBtn.interactable = canChallengeBoss;
        fightBtn.SetColorful(null, canChallengeBoss);
        for (int i = 0; i < passAwards.Length; i++)
        {
            if (i < levelConfig.AwardItemList.Length)
            {
                passAwards[i].SetActive(true);
                int id = levelConfig.AwardItemList[i][0];
                passAwards[i].Init(new ItemCellModel(id, false, levelConfig.AwardItemList[i][1]));
                passAwards[i].button.AddListener(() =>
                {
                    ItemTipUtility.Show(id);
                });
            }
            else
            {
                passAwards[i].SetActive(false);
            }
        }
        bossBG.SetOrgSprite(chapterConfig.BG, "MainLevel");
    }
    void FightBoss()
    {
        if (AutoFightModel.Instance.CanChallengeBoss())
        {
            BattleManager.Instance.MainFightRequest(3);
        }
        CloseWindow();
    }
    void PlayerDataRefresh(PlayerDataType type)
    {
        switch (type)
        {
            case PlayerDataType.ExAttr1:
            case PlayerDataType.ExAttr2:
                var canChallengeBoss = AutoFightModel.Instance.CanChallengeBoss();
                fightBtn.interactable = canChallengeBoss;
                fightBtn.SetColorful(null, canChallengeBoss);
                break;
        }
    }
    void OnRefreshCell(ScrollerDataType type, CellView cell)
    {
        var _cell = cell as MainLevelDropCell;
        _cell.Display(cell.index);
    }
    void UpdateDayBooty()
    {
        dropItemScroller.m_Scorller.RefreshActiveCellViews();
    }
    void CreateScroller()
    {
        dropItemScroller.Refresh();
        foreach (DictionaryEntry item in MainChapterConfig.unLockedChapterDict)
        {
            dropItemScroller.AddCell(ScrollerDataType.Header, (int)item.Key);
        }
        dropItemScroller.Restart();
    }
}
Main/System/MainLevel/MainBossEnterWin.cs.meta
Main/System/MainLevel/MainLevelDropCell.cs
New file
@@ -0,0 +1,62 @@
//--------------------------------------------------------
//    [Author]:           玩个游戏
//    [  Date ]:           Tuesday, July 24, 2018
//--------------------------------------------------------
using System;
using System.Collections;
using UnityEngine;
using UnityEngine.UI;
public class MainLevelDropCell : CellView
{
    [SerializeField] Text dropValueText;
    [SerializeField] ItemCell dropItemCell;
    [SerializeField] Image lockImg;
    public void Display(int itemID)
    {
        var value = PlayerDatas.Instance.baseData.ExAttr2;
        var chapterID = value / 10000;
        var config = MainChapterConfig.Get(chapterID);
        var needChapterID = (int)MainChapterConfig.unLockedChapterDict[(object)itemID];
        bool isLock = (int)needChapterID > chapterID;
        dropItemCell.Init(new ItemCellModel(itemID, false, 0));
        dropItemCell.button.AddListener(()=>
        {
            ItemTipUtility.Show(itemID);
        });
        if (isLock)
        {
            lockImg.SetActive(true);
            dropValueText.text = UIHelper.AppendColor(TextColType.Red, needChapterID + "-" + "1" + Language.Get("FuncLimitOpen1"));
        }
        else
        {
            lockImg.SetActive(false);
            int maxValue = 0;
            for (int i = 0; i < config.DailyBootyUpperList.Length; i++)
            {
                if (config.DailyBootyUpperList[i][0] == itemID)
                {
                    maxValue = config.DailyBootyUpperList[i][1];
                    break;
                }
            }
            int curValue = 0;
            MainLevelManager.Instance.m_DailyBootyDict.TryGetValue(itemID, out curValue);
            dropValueText.text = UIHelper.AppendColor(curValue >= maxValue ? TextColType.Red : TextColType.Green,
            UIHelper.ReplaceLargeNum(curValue) + "/" + UIHelper.ReplaceLargeNum(maxValue));
        }
    }
}
Main/System/MainLevel/MainLevelDropCell.cs.meta
New file
@@ -0,0 +1,11 @@
fileFormatVersion: 2
guid: c1075011d33762b4aa8320a32ac2adda
MonoImporter:
  externalObjects: {}
  serializedVersion: 2
  defaultReferences: []
  executionOrder: 0
  icon: {instanceID: 0}
  userData:
  assetBundleName:
  assetBundleVariant:
Main/System/MainLevel/MainLevelManager.cs
@@ -1,21 +1,36 @@
using System.Collections.Generic;
using UnityEngine;
using LitJson;
using System;
public class MainLevelManager : GameSystemManager<MainLevelManager>
{
    public Dictionary<int, int> m_DailyBootyDict = new Dictionary<int, int>();
    public event Action OnUpdateDayBooty;
    public override void Init()
    {
        base.Init();
        DTC0102_tagCDBPlayer.beforePlayerDataInitializeEvent += OnBeforePlayerDataInitialize;
    }
    public override void Release()
    {
        base.Release();
        DTC0102_tagCDBPlayer.beforePlayerDataInitializeEvent -= OnBeforePlayerDataInitialize;
    }
    private void OnBeforePlayerDataInitialize()
    {
        m_DailyBootyDict.Clear();
    }
    public void UpdateDayDropBooty(HB123_tagSCDropBootyInfo netPack)
    {
        for (int i = 0; i < netPack.Count; i++)
        {
            m_DailyBootyDict[(int)netPack.DropBootyList[i].ItemID] = (int)netPack.DropBootyList[i].TodayDropCnt;
        }
        OnUpdateDayBooty?.Invoke();
    }
    
}
Main/System/SkillUI/SkillWordCell.cs
New file
@@ -0,0 +1,109 @@
using UnityEngine;
using UnityEngine.UI;
using UnityEngine.Events;
public class SkillWordCell : MonoBehaviour
{
    Image m_SkillIcon;
    Image skillIcon
    {
        get
        {
            if (m_SkillIcon == null)
            {
                m_SkillIcon = this.transform.GetComponent<Image>("Container_SkillCell/Img_Icon");
            }
            return m_SkillIcon;
        }
    }
    Button m_SkillBtn;
    Button skillBtn
    {
        get
        {
            if (m_SkillBtn == null)
            {
                m_SkillBtn = this.transform.GetComponent<Button>("Container_SkillCell");
            }
            return m_SkillBtn;
        }
    }
    Text m_SkillType;
    Text skillType
    {
        get
        {
            if (m_SkillType == null)
            {
                m_SkillType = this.transform.GetComponent<Text>("Container_SkillCell/name");
            }
            return m_SkillType;
        }
    }
    void Awake()
    {
        LoadPrefab();
    }
    public void Init(int skillID, UnityAction onclick = null, bool showType = false)
    {
        var config = SkillConfig.Get(skillID);
        if (config == null)
        {
            Debug.LogErrorFormat("技能未配置 : {0}", skillID);
            return;
        }
        skillIcon.SetOrgSprite(config.IconName, "SkillIcon");
#if UNITY_EDITOR
        if (string.IsNullOrEmpty(config.IconName))
        {
            //内网测试
            skillIcon.SetOrgSprite("skillicondefault", "SkillIcon");
        }
#endif
        skillBtn.AddListener(()=>
        {
            onclick?.Invoke();
        });
        skillType.text = config.SkillName;
    }
    GameObject cellContainer;
    protected void LoadPrefab()
    {
        if (cellContainer != null)
            return;
        var tmp = transform.Find("Container_SkillCell");
        if (tmp != null)
        {
            cellContainer = tmp.gameObject;
            return;
        }
        if (cellContainer == null)
        {
            cellContainer = UIUtility.CreateWidget("SkillWordCell", "Container_SkillCell");
            if (cellContainer != null)
            {
                cellContainer.transform.SetParentEx(this.transform, Vector3.zero, Quaternion.identity, Vector3.one);
                cellContainer.transform.SetAsFirstSibling();
            }
        }
        //缩放到和父rect一样大
        var scale = 1f;
        var rect = cellContainer.GetComponent<RectTransform>();
        var parentRect = transform.GetComponent<RectTransform>();
        scale = parentRect.sizeDelta.x / rect.sizeDelta.x;
        cellContainer.transform.localScale = new Vector3(scale, scale, scale);
    }
}
Main/System/SkillUI/SkillWordCell.cs.meta
New file
@@ -0,0 +1,11 @@
fileFormatVersion: 2
guid: 0b88e4b27913c8c4eb320aa57fb6a7b0
MonoImporter:
  externalObjects: {}
  serializedVersion: 2
  defaultReferences: []
  executionOrder: 0
  icon: {instanceID: 0}
  userData:
  assetBundleName:
  assetBundleVariant: