From 22362d43bbd9fbd67d08150d741fb479b05261ba Mon Sep 17 00:00:00 2001
From: hch <305670599@qq.com>
Date: 星期一, 24 十一月 2025 12:14:11 +0800
Subject: [PATCH] 328 【主界面】坐骑系统  幻化 去掉活动激活的坐骑幻化 缺物品

---
 Main/System/Horse/HorseSkinCell.cs            |    7 ---
 Main/System/Horse/HorseManager.cs             |   84 ++++++++++++++++++++----------------------
 Main/Config/PartialConfigs/HorseSkinConfig.cs |   11 +----
 Main/System/Horse/HorseSkinWin.cs             |    8 +--
 4 files changed, 45 insertions(+), 65 deletions(-)

diff --git a/Main/Config/PartialConfigs/HorseSkinConfig.cs b/Main/Config/PartialConfigs/HorseSkinConfig.cs
index 1566e4d..216784e 100644
--- a/Main/Config/PartialConfigs/HorseSkinConfig.cs
+++ b/Main/Config/PartialConfigs/HorseSkinConfig.cs
@@ -1,18 +1,11 @@
 using System.Collections.Generic;
 public partial class HorseSkinConfig : ConfigBase<int, HorseSkinConfig>
 {
-    public static List<int> rankLVList = new List<int>();  //鍗囬樁瑙i攣
     public static List<int> itemsList = new List<int>(); //鐨偆閬撳叿瑙i攣/鍗囨槦
     protected override void OnConfigParseCompleted()
     {
-        if (UnlockWay == 1)
-        {
-            if (UnlockValue != 0 && !rankLVList.Contains(UnlockValue))
-            {
-                rankLVList.Add(UnlockValue);
-            }
-        }
-        else if (UnlockWay == 2)
+
+        if (UnlockWay == 2)
         {
             if (UnlockValue != 0 && !itemsList.Contains(UnlockValue))
             {
diff --git a/Main/System/Horse/HorseManager.cs b/Main/System/Horse/HorseManager.cs
index 7993500..59fa1a7 100644
--- a/Main/System/Horse/HorseManager.cs
+++ b/Main/System/Horse/HorseManager.cs
@@ -11,7 +11,6 @@
     public int exp;    //褰撳墠闃剁瓑绾х粡楠岋紝姣忕骇浠�0寮�濮�
     public event Action OnHorseUpdateEvent;
 
-    public int lastClassLV;  //鐨偆鐣岄潰鐐瑰嚮鍚庣孩鐐瑰埛鏂�
 
     Dictionary<int, HorseSkin> skinDic = new Dictionary<int, HorseSkin>();
     public event Action OnSkinUpdateEvent;
@@ -67,7 +66,6 @@
         horseLV = 0;
         exp = 0;
         skinDic.Clear();
-        lastClassLV = 0;
     }
 
     void OnPlayerLoginOk()
@@ -131,10 +129,6 @@
             UIManager.Instance.OpenWindow<HorseSuccessWin>();
         }
 
-        if (!DTC0403_tagPlayerLoginLoadOK.finishedLogin)
-        {
-            lastClassLV = classLV;
-        }
     }
 
 
@@ -189,7 +183,7 @@
     }
 
     //鐨偆绾㈢偣
-    public void UpdateSkinRedpoint()
+    void UpdateSkinRedpoint()
     {
         skinRedpoint.state = RedPointState.None;
         if (!FuncOpen.Instance.IsFuncOpen((int)FuncOpenEnum.Horse))
@@ -202,22 +196,10 @@
             return;
         }
 
-        //鍗囬樁瑙i攣绾㈢偣
-        foreach (var lv in HorseSkinConfig.rankLVList)
-        {
-            if (classLV >= lv && lastClassLV < lv)
-            {
-                skinRedpoint.state = RedPointState.Simple;
-                return;
-            }
-        }
 
-        //鍗囨槦瑙i攣绾㈢偣
+        //鍗囨槦/瑙i攣绾㈢偣
         foreach (var skin in HorseSkinConfig.GetValues())
         {
-            if (skin.UnlockWay != 2)
-                continue;
-
             if (IsSkinActive(skin.SkinID))
             {
                 if (skin.StarMax > 0)
@@ -234,13 +216,25 @@
             }
             else
             {
-                //鐨偆瑙i攣绾㈢偣
-                int itemID = skin.UnlockValue;
-                var count = PackManager.Instance.GetItemCountByID(PackType.Item, itemID);
-                if (count >= skin.UnlockNeedCnt)
+
+                if (skin.UnlockWay == 1)
                 {
-                    skinRedpoint.state = RedPointState.Simple;
-                    return;
+                    if (classLV >= skin.UnlockValue &&  skin.UnlockValue > 0)
+                    {
+                        skinRedpoint.state = RedPointState.Simple;
+                        return;
+                    }
+                }
+                else
+                {
+                    //鐨偆瑙i攣绾㈢偣
+                    int itemID = skin.UnlockValue;
+                    var count = PackManager.Instance.GetItemCountByID(PackType.Item, itemID);
+                    if (count >= skin.UnlockNeedCnt)
+                    {
+                        skinRedpoint.state = RedPointState.Simple;
+                        return;
+                    }
                 }
             }
 
@@ -260,27 +254,18 @@
                 return true;
             }
         }
-        var skinConfig = HorseSkinConfig.Get(id);
-        if (skinConfig.UnlockWay == 1)
+        var config = HorseSkinConfig.Get(id);
+        if (config.UnlockWay == 1 && config.UnlockValue == 0)
         {
-            return classLV >= skinConfig.UnlockValue;
+            return true;
         }
+
         return false;
     }
 
     public bool IsShowTheHorseRedImg(int skinID)
     {
         var skin = HorseSkinConfig.Get(skinID);
-        int lv = skin.UnlockWay == 1 ? skin.UnlockValue : 0;
-        //鍗囬樁瑙i攣绾㈢偣
-        if (classLV >= lv && lastClassLV < lv)
-        {
-            return true;
-        }
-
-        //鍗囨槦瑙i攣绾㈢偣
-        if (skin.UnlockWay != 2)
-            return false;
 
         if (IsSkinActive(skin.SkinID))
         {
@@ -297,13 +282,24 @@
         }
         else
         {
-            //鐨偆瑙i攣绾㈢偣
-            int itemID = skin.UnlockValue;
-            var count = PackManager.Instance.GetItemCountByID(PackType.Item, itemID);
-            if (count >= skin.UnlockNeedCnt)
+
+            if (skin.UnlockWay == 1)
             {
-                return true;
+                if (classLV >= skin.UnlockValue && skin.UnlockValue > 0)
+                {
+                    return true;
+                }
             }
+            else
+            {
+                //鐨偆瑙i攣绾㈢偣
+                int itemID = skin.UnlockValue;
+                var count = PackManager.Instance.GetItemCountByID(PackType.Item, itemID);
+                if (count >= skin.UnlockNeedCnt)
+                {
+                    return true;
+                }
+            }            
         }
         return false;
     }
diff --git a/Main/System/Horse/HorseSkinCell.cs b/Main/System/Horse/HorseSkinCell.cs
index 197c979..013193b 100644
--- a/Main/System/Horse/HorseSkinCell.cs
+++ b/Main/System/Horse/HorseSkinCell.cs
@@ -25,13 +25,6 @@
     {
         HorseManager.Instance.selectSkinID = skinID;
 
-        var skinConfig = HorseSkinConfig.Get(skinID);
-        if (skinConfig.UnlockWay == 1 && HorseManager.Instance.lastClassLV != HorseManager.Instance.classLV)
-        {
-            HorseManager.Instance.lastClassLV = HorseManager.Instance.classLV;
-            HorseManager.Instance.UpdateSkinRedpoint();
-        }
-
     }
 
     public void Display(int _skinID)
diff --git a/Main/System/Horse/HorseSkinWin.cs b/Main/System/Horse/HorseSkinWin.cs
index 9bf1e74..eafa6ce 100644
--- a/Main/System/Horse/HorseSkinWin.cs
+++ b/Main/System/Horse/HorseSkinWin.cs
@@ -51,8 +51,6 @@
 
     protected override void OnPreClose()
     {
-        HorseManager.Instance.lastClassLV = HorseManager.Instance.classLV;
-        HorseManager.Instance.UpdateSkinRedpoint();
         HorseManager.Instance.OnSkinUpdateEvent -= OnSkinUpdateEvent;
         HorseManager.Instance.OnSelectEvent -= OnSelectEvent;
         scroller.OnRefreshCell -= OnRefreshCell;
@@ -103,7 +101,7 @@
 
         bool isActive = HorseManager.Instance.IsSkinActive(HorseManager.Instance.selectSkinID);
         var skinData = HorseManager.Instance.GetSkinData(HorseManager.Instance.selectSkinID);
-        if (skinConfig.StarMax > 0 && skinData.Star > 0)
+        if (skinConfig.StarMax > 0 && skinData != null && skinData.Star > 0)
         {
             horseName.text = skinConfig.Name + "+" + skinData.Star;
         }
@@ -154,13 +152,13 @@
         else
         {
             changeOPObj.SetActive(false);
+            unlockBtn.SetActive(true);
             if (skinConfig.UnlockWay == 1)
             {
-                unlockBtn.SetActive(false);
+                unlockCostText.SetActive(false);
             }
             else
             {
-                unlockBtn.SetActive(true);
                 unlockCostText.SetActive(true);
                 unlockCostText.text = UIHelper.ShowUseItem(PackType.Item, skinConfig.UnlockValue, skinConfig.UnlockNeedCnt);
                 unlockItemImg.SetItemSprite(skinConfig.UnlockValue);

--
Gitblit v1.8.0