ant+和http组件bug修复

This commit is contained in:
lishuo committed 2021-04-30 17:25:28 +08:00
1 parent f7b33bf491
commit 48c5b161b1
29 files changed
+3526 -2755

No files matched your search

@@ -67,11 +67,25 @@ namespace Assets.Scenes.Ride.Scripts
public void SetHeadImage(string url)
{
Head = transform.Find("Head").GetComponent<RawImage>();
Utils.DisplayImage(StartCoroutine, Head, url);
if (App.TextureCache.ContainsKey(url))
{
Head.texture = App.TextureCache[url];
}
else
{
Utils.DisplayImageAysnc(StartCoroutine, Head, url, ImageCallBack);
}
var rect = ((RectTransform)Head.transform).rect;
Material material = Instantiate(Resources.Load<Material>("UI/Material/RoundedCornersTextureMaterial"));
material.SetVector(Shader.PropertyToID("_WidthHeightRadius"), new Vector4(rect.width, rect.height, rect.height, 0));
Head.material = material;
}
private void ImageCallBack(string url)
{
if (!App.TextureCache.ContainsKey(url))
App.TextureCache.Add(url, Head.texture);
}
}
}