diff --git a/Assets/Scripts/UI/Prefab/Panel/NewRouteDetailController.cs b/Assets/Scripts/UI/Prefab/Panel/NewRouteDetailController.cs index 25e33874..0c08a6c5 100644 --- a/Assets/Scripts/UI/Prefab/Panel/NewRouteDetailController.cs +++ b/Assets/Scripts/UI/Prefab/Panel/NewRouteDetailController.cs @@ -13,6 +13,7 @@ public class NewRouteDetailController : PFUIPanel { // Start is called before the first frame update Dictionary caches; + Dictionary cacheByte; GameObject map; ScrollRect scroll; Dictionary FavDict; @@ -26,6 +27,7 @@ public class NewRouteDetailController : PFUIPanel {true,Resources.Load("Images/NewDesign/icon_heji_like") }, }; caches = new Dictionary(); + cacheByte = new Dictionary(); scroll = transform.Find("Container/Right/Scroll View").GetComponent(); UIManager.AddEvent(scroll.gameObject, UnityEngine.EventSystems.EventTriggerType.EndDrag, OnEndDrag); #if UNITY_ANDROID || UNITY_IOS @@ -38,6 +40,7 @@ public class NewRouteDetailController : PFUIPanel protected override void OnDestroy() { caches = null; + cacheByte = null; Resources.UnloadUnusedAssets(); GC.Collect(); Debug.Log("list empty"); @@ -150,6 +153,15 @@ public class NewRouteDetailController : PFUIPanel Utils.DisplayImageTempDict(left.Find("Icon").GetComponent(), area.CoverImage, caches , b => { + if (b != null) + { + cacheByte.Add(area.CoverImage, b); + } + else if(cacheByte.ContainsKey(area.CoverImage)) + { + b = cacheByte[area.CoverImage]; + } + #if UNITY_EDITOR var _t = new Texture2D(4, 4, TextureFormat.DXT5, false); #else diff --git a/Assets/Scripts/Utils/Utils.cs b/Assets/Scripts/Utils/Utils.cs index ef372826..ae36ea94 100644 --- a/Assets/Scripts/Utils/Utils.cs +++ b/Assets/Scripts/Utils/Utils.cs @@ -404,6 +404,10 @@ namespace Assets.Scripts { img.GetComponent().ShowImageWithTexture(texture); } + if (callback != null) + { + callback.Invoke(null); + } return; } }