Browse Source

修改bug

lzx 3 days ago
parent
commit
172a071da9

+ 18 - 0
Assets/Scripts/Core/AssetLoadTool/ReferenceCollector.cs

@@ -2,6 +2,7 @@
 using System;
 using System.Collections;
 using System.Collections.Generic;
+using System.Linq;
 using UnityEngine;
 //Object并非C#基础中的Object,而是 UnityEngine.Object
 using Object = UnityEngine.Object;
@@ -153,6 +154,23 @@ namespace Fort23.Mono
             {
                 return null;
             }
+            
+        
+            if (typeof(T).IsGenericType && typeof(T).GetGenericTypeDefinition() == typeof(List<>))
+            {
+          
+                if (dictGo is IEnumerable<object> enumerable)
+                {
+                 
+                    Type elementType = typeof(T).GetGenericArguments()[0];
+              
+                    var method = typeof(Enumerable).GetMethod(nameof(Enumerable.OfType)).MakeGenericMethod(elementType);
+                    var result = method.Invoke(null, new[] { enumerable });
+                
+                    var toListMethod = typeof(Enumerable).GetMethod(nameof(Enumerable.ToList)).MakeGenericMethod(elementType);
+                    return toListMethod.Invoke(null, new[] { result }) as T;
+                }
+            }
 
             return dictGo as T;
         }

+ 6 - 1
Assets/Scripts/Core/Editor/FortRectTransformInspector.cs

@@ -318,7 +318,12 @@ public class FortRectTransformInspector : UnityEditor.Editor
                     }
                     else
                     {
-                        AllTypeDictionary.Add(keyValuePair.key, "List<object>");
+                        Object o = keyValuePair.gameObject;
+                        if (keyValuePair.ListCollectorDatas.Count > 0)
+                        {
+                            o = keyValuePair.ListCollectorDatas[0].gameObject;
+                        }
+                        AllTypeDictionary.Add(keyValuePair.key, $"List<{o.GetType().Name}>");
                     }
                 }
                 catch (Exception e)

+ 4 - 4
Assets/Scripts/GameLogic/Hero/FaBaoInfo.cs

@@ -96,7 +96,7 @@ namespace GameLogic.Hero
             //计算加得属性
             for (var i = 0; i < FabaoConfig.ShuxingIDs.Length; i++)
             {
-                long attribute = GetAttriBute(FabaoConfig.ShuxingIDs[i]);
+                float attribute = GetAttriBute(FabaoConfig.ShuxingIDs[i]);
                 long value = (long)(attribute * FabaoConfig.ShuxingPara[0] * 0.01f);
                 attriButedIC.Add(FabaoConfig.ShuxingIDs[i], value);
             }
@@ -104,16 +104,16 @@ namespace GameLogic.Hero
             qiangDu = (long)(FabaoPowerupConfig.Power * SkillConfig.power * 0.01f);
         }
 
-        private long GetAttriBute(int type)
+        private float GetAttriBute(int type)
         {
             switch (type)
             {
                 case 1:
                     return FabaoPowerupConfig.HP;
                 case 2:
-                    return FabaoPowerupConfig.HP;
+                    return FabaoPowerupConfig.DEF;
                 case 3:
-                    return FabaoPowerupConfig.HP;
+                    return FabaoPowerupConfig.ATK;
             }
 
             return 0;

+ 3 - 3
Assets/Scripts/GameUI/UI/CombatPanel/SkillWidgetData.cs

@@ -63,13 +63,13 @@ namespace Fort23.Mono
 	      return _Text_SkillType;
 	     }
 	   }
-	  private List<object> _StarRoot;
-	  public List<object> StarRoot
+	  private List<MyImage> _StarRoot;
+	  public List<MyImage> StarRoot
 	   {
 	   get{
 	      if (_StarRoot == null)
 	       {
-	         _StarRoot  = GetUIUnit<List<object>>("StarRoot"); 
+	         _StarRoot  = GetUIUnit<List<MyImage>>("StarRoot"); 
 	       }
 	      return _StarRoot;
 	     }

+ 3 - 3
Assets/Scripts/GameUI/UI/GongFaUpgradePanel/GongFaUpgradeInfoWidgetData.cs

@@ -8,13 +8,13 @@ namespace Fort23.Mono
 	public partial class GongFaUpgradeInfoWidget 
 	{
 	  #region 自定义数据 
-	  private List<object> _StarRoot;
-	  public List<object> StarRoot
+	  private List<MyImage> _StarRoot;
+	  public List<MyImage> StarRoot
 	   {
 	   get{
 	      if (_StarRoot == null)
 	       {
-	         _StarRoot  = GetUIUnit<List<object>>("StarRoot"); 
+	         _StarRoot  = GetUIUnit<List<MyImage>>("StarRoot"); 
 	       }
 	      return _StarRoot;
 	     }