更新拉取图片的缓存代码

This commit is contained in:
suntao committed 2021-05-08 14:38:23 +08:00
1 parent 696fd256a8
commit 6645310601
22 files changed
+149 -119

No files matched your search

@@ -34,17 +34,9 @@ public class RouteItem : MonoBehaviour, IPointerExitHandler, IPointerEnterHandle
left = transform.Find("Left");
row1 = left.Find("Main").Find("Row1");
row2 = left.Find("Main").Find("Row2");
if (App.propTextureCache["recordCache"].ContainsKey(result.Id))
{
transform.Find("CoverImage").GetComponent<RawImage>().texture = App.propTextureCache["recordCache"][result.Id];
}
else
{
Utils.DisplayImage(StartCoroutine, transform.Find("CoverImage").GetComponent<RawImage>(), result.RouteImage,(t)=>
{
App.propTextureCache["recordCache"].Add(result.Id, t);
});
}
Utils.DisplayImage(transform.Find("CoverImage").GetComponent<RawImage>(), result.RouteImage, true);
left.Find("Main").Find("Name").GetComponent<Text>().text = result.RouteName;
left.Find("Main").Find("Time").GetComponent<Text>().text = result.CreateTime.ToString("yyyy-MM-dd HH:mm:ss");
row1.Find("Time").GetComponent<Text>().text = $"<color={titleColor}>Riding time:</color>{result.TrainingTime}";