lcy
2026-03-17 01a6a9d95daa7d650f29b867baa437b8b1e38697
Main/System/PhantasmPavilion/PhantasmPavilionManager.Redpoint.cs
@@ -73,13 +73,22 @@
                continue;
            int unlockWay = GetUnlockWay(type, id);
            int unlockValue = GetUnlockValue(type, id);
            if (unlockWay != 3)
            if (unlockWay != 3 && unlockWay != 4)
                continue;
            bool hasNewHero = HasNewHero(type, unlockValue);
            if (hasNewHero)
            if (unlockWay == 3)
            {
                tabRedPointDict[redType].state = RedPointState.Simple;
                bool hasNewHero = HasNewHero(type, unlockValue);
                if (hasNewHero)
                {
                    tabRedPointDict[redType].state = RedPointState.Simple;
                }
            }
            else if (unlockWay == 4)
            {
                if (HasNewSkin(type, unlockValue))
                    tabRedPointDict[redType].state = RedPointState.Simple;
            }
        }
    }
@@ -102,15 +111,21 @@
        }
        int unlockWay = GetUnlockWay(type, id);
        if (unlockWay != 3)
        if (unlockWay != 3 && unlockWay != 4)
            return;
        int unlockValue = GetUnlockValue(type, id);
        bool hasNewHero = HasNewHero(type, unlockValue);
        if (hasNewHero)
        if (unlockWay == 3)
        {
            imgRed.SetActive(true);
            if (HasNewHero(type, unlockValue))
                imgRed.SetActive(true);
        }
        else if (unlockWay == 4)
        {
            if (HasNewSkin(type, unlockValue))
                imgRed.SetActive(true);
        }
    }
    readonly int funcId = 3;//内政
    //内政没开不刷红点
@@ -165,21 +180,42 @@
        }
    }
    public List<int> newHeroIDModelList = new List<int>();
    public List<int> newHeroIDFaceList = new List<int>();
    public void AddNewHero(int heroID)
    public List<int> newSkinIDModelList = new List<int>();
    public List<int> newSkinIDFaceList = new List<int>();
    string modelSkinKey { get { return StringUtility.Concat("PhantasmPavilion_Redponit_ModelSkin_", PlayerDatas.Instance.PlayerId.ToString()); } }
    string faceSkinKey { get { return StringUtility.Concat("PhantasmPavilion_Redponit_FaceSkin_", PlayerDatas.Instance.PlayerId.ToString()); } }
    public void AddNewSkin(int skinID)
    {
        AddNewHero(newHeroIDModelList, heroID);
        AddNewHero(newHeroIDFaceList, heroID);
        AddNew(newSkinIDModelList, skinID);
        AddNew(newSkinIDFaceList, skinID);
    }
    void AddNewHero(List<int> list, int heroID)
    // 抽象添加逻辑
    void AddNew(List<int> list, int id)
    {
        if (list.Contains(heroID))
        if (list.Contains(id))
            return;
        list.Add(heroID);
        list.Add(id);
        SaveLocal();
        UpdateRedPoint();
    }
    public bool HasNewSkin(PhantasmPavilionType type, int skinID)
    {
        switch (type)
        {
            case PhantasmPavilionType.Model: return newSkinIDModelList.Contains(skinID);
            case PhantasmPavilionType.Face: return newSkinIDFaceList.Contains(skinID);
            default: return false;
        }
    }
    public List<int> newHeroIDModelList = new List<int>();
    public List<int> newHeroIDFaceList = new List<int>();
    public void AddNewHero(int heroID)
    {
        AddNew(newHeroIDModelList, heroID);
        AddNew(newHeroIDFaceList, heroID);
    }
    public void RemoveAllNewHeroByTabType(PhantasmPavilionType type, int tabType = 0)
@@ -212,31 +248,29 @@
            return;
        int unlockWay = GetUnlockWay(type, id);
        int unlockValue = GetUnlockValue(type, id);
        if (unlockWay != 3)
            return;
        if (unlockWay != 3 && unlockWay != 4) return;
        switch (type)
        {
            case PhantasmPavilionType.Model:
                RemoveNewHero(newHeroIDModelList, unlockValue, isSave);
                if (unlockWay == 3) RemoveNew(newHeroIDModelList, unlockValue, isSave);
                else if (unlockWay == 4) RemoveNew(newSkinIDModelList, unlockValue, isSave); // 皮肤
                break;
            case PhantasmPavilionType.Face:
                RemoveNewHero(newHeroIDFaceList, unlockValue, isSave);
                if (unlockWay == 3) RemoveNew(newHeroIDFaceList, unlockValue, isSave);
                else if (unlockWay == 4) RemoveNew(newSkinIDFaceList, unlockValue, isSave); // 皮肤
                break;
        }
    }
    void RemoveNewHero(List<int> list, int heroID, bool isSave = true)
    void RemoveNew(List<int> list, int id, bool isSave = true)
    {
        if (!list.Contains(heroID))
            return;
        list.Remove(heroID);
        if (isSave)
        {
            SaveLocal();
        }
        if (!list.Contains(id)) return;
        list.Remove(id);
        if (isSave) SaveLocal();
        UpdateRedPoint();
    }
    public bool HasNewHero(PhantasmPavilionType type, int heroID)
    {
@@ -258,11 +292,36 @@
    {
        LocalSave.SetIntArray(modelkey, newHeroIDModelList.ToArray());
        LocalSave.SetIntArray(facekey, newHeroIDFaceList.ToArray());
        LocalSave.SetIntArray(modelSkinKey, newSkinIDModelList.ToArray());
        LocalSave.SetIntArray(faceSkinKey, newSkinIDFaceList.ToArray());
    }
    public void LoadLocal()
    {
        LoadLocalModel();
        LoadLocalFace();
        LoadLocalSkin();
    }
    void LoadLocalSkin()
    {
        if (LocalSave.HasKey(modelSkinKey))
        {
            int[] arr = LocalSave.GetIntArray(modelSkinKey);
            newSkinIDModelList = arr.IsNullOrEmpty() ? new List<int>() : arr.ToList();
        }
        else
        {
            newSkinIDModelList = new List<int>();
        }
        if (LocalSave.HasKey(faceSkinKey))
        {
            int[] arr = LocalSave.GetIntArray(faceSkinKey);
            newSkinIDFaceList = arr.IsNullOrEmpty() ? new List<int>() : arr.ToList();
        }else
        {
            newSkinIDFaceList = new List<int>();
        }
    }
    void LoadLocalModel()