diff --git a/Assets/Resources/Prefab/UI/Cards/CardListView.prefab b/Assets/Resources/Prefab/UI/Cards/CardListView.prefab index babfc6c3c2075f0d58ef072be12d7f051f120f0d..f4a47105c31076cdd3f21e7e5d7509b736c15f04 100644 --- a/Assets/Resources/Prefab/UI/Cards/CardListView.prefab +++ b/Assets/Resources/Prefab/UI/Cards/CardListView.prefab @@ -3863,9 +3863,9 @@ MonoBehaviour: scrollRect: {fileID: 2373949832944046736} top: 30 bottom: 30 - interval: 10 + interval: 6 elem: {fileID: -7887652861602639447, guid: 690fc32fa58083545a25ccbc922a4ea5, type: 3} - elemCount: 20 + elemCount: 10 --- !u!1 &2440221074765671710 GameObject: m_ObjectHideFlags: 0 diff --git a/Assets/Resources/Prefab/UI/Deck/DeckCardListView.prefab b/Assets/Resources/Prefab/UI/Deck/DeckCardListView.prefab index dad24a195e44850e5638250ed8101cee291848e2..7e4e157b29c078f0641ea557da691a48e8f1867a 100644 --- a/Assets/Resources/Prefab/UI/Deck/DeckCardListView.prefab +++ b/Assets/Resources/Prefab/UI/Deck/DeckCardListView.prefab @@ -298,7 +298,7 @@ MonoBehaviour: bottom: 30 interval: 10 elem: {fileID: -7887652861602639447, guid: 690fc32fa58083545a25ccbc922a4ea5, type: 3} - elemCount: 20 + elemCount: 6 --- !u!1 &1335748695387864072 GameObject: m_ObjectHideFlags: 0 diff --git a/Assets/Scripts/Logic/CardManager.cs b/Assets/Scripts/Logic/CardManager.cs index 0a72bc539c617860ab3c3faa09a066bc05179f41..1d8a34aec47f732a6ee15ba9ae84fc6a858f2d70 100644 --- a/Assets/Scripts/Logic/CardManager.cs +++ b/Assets/Scripts/Logic/CardManager.cs @@ -56,7 +56,7 @@ public class CardManager : SingletonMono if (!File.Exists(SeriesListPath)) { //尝试读取Resource包体自带 - TextAsset tx = Resources.Load("data/SeriesList.json"); + TextAsset tx = Resources.Load("data/SeriesList"); if (tx == null) return; else diff --git a/Assets/Scripts/Logic/Data/Card.cs b/Assets/Scripts/Logic/Data/Card.cs index a987effc8e48fc3c334f39831213f3662b5f8141..b2ba3b69fd0cfe5b37d67b8ea5ea7d85e1aa7da7 100644 --- a/Assets/Scripts/Logic/Data/Card.cs +++ b/Assets/Scripts/Logic/Data/Card.cs @@ -30,7 +30,7 @@ public class Card } get { - if(_img == null) + if (_img == null) { LoadImg(); } diff --git a/Assets/Scripts/Logic/Data/Series.cs b/Assets/Scripts/Logic/Data/Series.cs index e4296a50ce8281eee05da4f19eab00dbff50355f..06722946d3c89f3b6d2fd4a035bdb9762fee5295 100644 --- a/Assets/Scripts/Logic/Data/Series.cs +++ b/Assets/Scripts/Logic/Data/Series.cs @@ -102,7 +102,7 @@ public class Series if (!File.Exists(path)) { //尝试读取本地的 - TextAsset tx = Resources.Load($"data/{Name.Replace("/", "")}/Cards.json"); + TextAsset tx = Resources.Load($"data/{Name.Replace("/", "")}/Cards"); if (tx == null) return; else @@ -120,7 +120,7 @@ public class Series for (int i = 0; i < data.Count; i++) { Card card = new Card(data[i]); - card.CheckImgFile(); + //card.CheckImgFile(); AddCard(card); } } diff --git a/Assets/Scripts/Logic/DownloadData.cs b/Assets/Scripts/Logic/DownloadData.cs index 63aab222c354053ac2d8a0c22572dc7da4d8c05b..885af87ef8c9efca06aa671188dd2b6a970679f2 100644 --- a/Assets/Scripts/Logic/DownloadData.cs +++ b/Assets/Scripts/Logic/DownloadData.cs @@ -165,16 +165,20 @@ public class DownloadData : SingletonMono if (retry < 5) { Debug.Log($"重新尝试:{url} - 次数{retry}"); + webRequest.Dispose(); yield return StartCoroutine(DownloadText(url, success, fail, retry + 1)); } else + { fail?.Invoke(webRequest.error); + webRequest.Dispose(); + } yield break; } // 从网络请求中获取文本内容 string text = webRequest.downloadHandler.text; - + webRequest.Dispose(); success?.Invoke(text); diff --git a/Assets/Scripts/Logic/DownloadImage.cs b/Assets/Scripts/Logic/DownloadImage.cs index 719f8e3c97208f1d1018ab1623233dca8f504d21..4d657ea206fd7f012f22355f76e2ebb1b8c147b0 100644 --- a/Assets/Scripts/Logic/DownloadImage.cs +++ b/Assets/Scripts/Logic/DownloadImage.cs @@ -16,7 +16,7 @@ public class DownlaodImage : SingletonMono Queue DownloadQueue = new Queue(); bool downloading; - Texture2D RebirthBG; + static Texture2D RebirthBG; /// /// 获取一个图片 @@ -29,8 +29,8 @@ public class DownlaodImage : SingletonMono if (texture2D == null) { texture2D = (RebirthBG == null) ? LoadRebirthBG() : RebirthBG; - DownloadQueue.Enqueue(card); - if (!downloading) StartCoroutine(DownLoadQueue()); + //DownloadQueue.Enqueue(card); + //if (!downloading) StartCoroutine(DownLoadQueue()); } return texture2D; @@ -146,6 +146,7 @@ public class DownlaodImage : SingletonMono downloading = true; while (DownloadQueue.TryDequeue(out Card card)) { + //Logger.Log($"DownloadQueue:{DownloadQueue.Count}"); //尝试在Resource下加载 string path = ""; var resq = Resources.LoadAsync(path); @@ -161,6 +162,9 @@ public class DownlaodImage : SingletonMono else //没有则下载 yield return StartCoroutine(DownloadingImg(card)); + + yield return null; + } downloading = false; } @@ -182,10 +186,11 @@ public class DownlaodImage : SingletonMono Debug.Log($"重新尝试:{card.Num} - 次数{retry}"); yield return StartCoroutine(DownloadingImg(card, retry + 1)); } + webRequest.Dispose(); yield break; } byte[] bytes = webRequest.downloadHandler.data; - + webRequest.Dispose(); Texture2D texture = null; if (card.Type == CardType.Rebirth) {