loading页面不显示loading序列帧
This commit is contained in:
1 parent
fc55360be0
commit
67abc1ef63
8 files changed
+47
-22
No files matched your search
@@ -252,8 +252,7 @@ namespace Assets.Scenes.Ride.Scripts
|
||||
}
|
||||
AddProcess(20);
|
||||
#endregion
|
||||
|
||||
StartCoroutine(HiddenLoading());
|
||||
//StartCoroutine(HiddenLoading());
|
||||
}
|
||||
private int maxShowCout = 9;
|
||||
private void ShowPlayers(List<CompetitionPlayer> list)
|
||||
|
||||
@@ -47,7 +47,7 @@ namespace Assets.Scenes.Ride.Scripts
|
||||
{
|
||||
App.TextureCache.Clear();
|
||||
mapApi = new MapApi();
|
||||
ShowLoading();
|
||||
//ShowLoading();
|
||||
}
|
||||
|
||||
protected virtual void Update()
|
||||
@@ -144,18 +144,18 @@ namespace Assets.Scenes.Ride.Scripts
|
||||
Utils.DisplayImageAysnc(StartCoroutine, mapRouteImage, url, DowloadCallBack);
|
||||
}
|
||||
}
|
||||
protected void DowloadCallBack(string url)
|
||||
protected void DowloadCallBack(string url,RawImage rawImage)
|
||||
{
|
||||
if (!App.TextureCache.ContainsKey(url))
|
||||
{
|
||||
App.TextureCache.Add(url, mapRouteImage.texture);
|
||||
App.TextureCache.Add(url, rawImage?.texture);
|
||||
}
|
||||
else
|
||||
{
|
||||
App.TextureCache[url] = mapRouteImage.texture;
|
||||
App.TextureCache[url] = rawImage?.texture;
|
||||
}
|
||||
var canvasGroup = mapRouteImage.GetComponent<CanvasGroup>();
|
||||
canvasGroup.DOFade(1, 1);
|
||||
var canvasGroup = rawImage.GetComponent<CanvasGroup>();
|
||||
canvasGroup?.DOFade(1, 1);
|
||||
}
|
||||
//设定当前loading进度
|
||||
public virtual void AddProcess(float v)
|
||||
|
||||
@@ -314,7 +314,8 @@ namespace Assets.Scenes.Ride.Scripts
|
||||
//影子骑行按钮控制
|
||||
if (mainController.mapRouteRankingList == null || mainController.mapRouteRankingList.Count == 0)
|
||||
{
|
||||
shadowButton.image.sprite = Resources.Load<Sprite>("Images/Ride/Shadow Mode_no");
|
||||
var lang = App.GetLocalLanguage();
|
||||
shadowButton.image.sprite = lang == "zh"? Resources.Load<Sprite>("Images/Ride/Shadow Mode_no"): Resources.Load<Sprite>("Images/Ride/Shadow Mode_no");
|
||||
shadowButton.enabled = false;
|
||||
shadowButton.interactable = false;
|
||||
}
|
||||
|
||||
@@ -532,7 +532,7 @@ public class CyclingController : DeviceServiceMonoBase
|
||||
}
|
||||
private IEnumerator Init()
|
||||
{
|
||||
yield return new WaitForSeconds(1);
|
||||
yield return null; //new WaitForSeconds(1);
|
||||
mapRoute = mapApi.GetById(routeId).data;
|
||||
loadingController.Init();//初始化loading页面
|
||||
loadingController.AddProcess(10);
|
||||
|
||||
@@ -127,7 +127,8 @@ namespace Assets.Scenes.Ride.Scripts
|
||||
Utils.DisplayImage(head, userList[0].HeadImage);//头像
|
||||
country.texture = cyclingController.GetCountryImageByCode(route.CountryCode);//上传者国家
|
||||
mapCountry.texture = cyclingController.GetCountryImageByName(userList[0].Country);//路书国家
|
||||
Utils.DisplayImage(altitudeGraph, route.AltitudeGraph);//海拔图
|
||||
//Utils.DisplayImage(altitudeGraph, route.AltitudeGraph);//海拔图
|
||||
Utils.DisplayImageAysnc(StartCoroutine, altitudeGraph, route.AltitudeGraph, DowloadCallBack);
|
||||
}
|
||||
#endregion
|
||||
//异步请求mapbox画出当前路书路线图
|
||||
@@ -140,7 +141,7 @@ namespace Assets.Scenes.Ride.Scripts
|
||||
CreateRankingList(list.data.list);
|
||||
AddProcess(10);
|
||||
}
|
||||
StartCoroutine(HiddenLoading());
|
||||
//StartCoroutine(HiddenLoading());
|
||||
}
|
||||
|
||||
//创建排行榜
|
||||
|
||||
@@ -369,7 +369,7 @@ namespace Assets.Scripts
|
||||
|
||||
}
|
||||
|
||||
public static void DisplayImageAysnc(StartCoroutine startCoroutine, RawImage img, string url,Action<string> action)
|
||||
public static void DisplayImageAysnc(StartCoroutine startCoroutine, RawImage img, string url,Action<string,RawImage> action)
|
||||
{
|
||||
startCoroutine(DownloadImageCallBack(img, url, action));
|
||||
}
|
||||
@@ -411,7 +411,7 @@ namespace Assets.Scripts
|
||||
_t.name = MediaUrl;
|
||||
return _t;
|
||||
}
|
||||
static IEnumerator DownloadImageCallBack(RawImage img, string MediaUrl,Action<string> action)
|
||||
static IEnumerator DownloadImageCallBack(RawImage img, string MediaUrl,Action<string,RawImage> action)
|
||||
{
|
||||
UnityWebRequest request = UnityWebRequest.Get(MediaUrl);
|
||||
yield return request.SendWebRequest();
|
||||
@@ -421,7 +421,7 @@ namespace Assets.Scripts
|
||||
{
|
||||
var data = request.downloadHandler.data;
|
||||
img.texture = Utils.GetDownloadTexture(MediaUrl, data);
|
||||
action.Invoke(MediaUrl);
|
||||
action.Invoke(MediaUrl, img);
|
||||
}
|
||||
}
|
||||
/*显示网络图片*/
|
||||
|
||||
Reference in new issue
Block a user