瀏覽代碼

修改bug

lzx 3 天之前
父節點
當前提交
7001f99350
共有 2 個文件被更改,包括 13 次插入14 次删除
  1. 12 13
      Assets/Scripts/Core/AssetLoadTool/ReferenceCollector.cs
  2. 1 1
      Assets/Scripts/GameLogic/Hero/FaBaoInfo.cs

+ 12 - 13
Assets/Scripts/Core/AssetLoadTool/ReferenceCollector.cs

@@ -154,22 +154,21 @@ namespace Fort23.Mono
             {
                 return null;
             }
-            
-        
-            if (typeof(T).IsGenericType && typeof(T).GetGenericTypeDefinition() == typeof(List<>))
+
+
+            if (typeof(T).IsGenericType && typeof(T).GetGenericTypeDefinition() == typeof(List<>) &&
+                dictGo.GetType().IsGenericType && dictGo.GetType().GetGenericTypeDefinition() == typeof(List<> ))
             {
-          
-                if (dictGo is IEnumerable<object> enumerable)
+                Type elementType = typeof(T).GetGenericArguments()[0];
+
+                Type listType = typeof(List<>).MakeGenericType(elementType);
+                var list = Activator.CreateInstance(listType);
+                foreach (var item in dictGo as List<object>)
                 {
-                 
-                    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;
+                    listType.GetMethod("Add").Invoke(list, new[] { item });
                 }
+
+                return list as T;
             }
 
             return dictGo as T;

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

@@ -97,7 +97,7 @@ namespace GameLogic.Hero
             for (var i = 0; i < FabaoConfig.ShuxingIDs.Length; i++)
             {
                 float attribute = GetAttriBute(FabaoConfig.ShuxingIDs[i]);
-                long value = (long)(attribute * FabaoConfig.ShuxingPara[0] * 0.01f);
+                long value = (long)(attribute * FabaoConfig.ShuxingPara[i] * 0.01f);
                 attriButedIC.Add(FabaoConfig.ShuxingIDs[i], value);
             }