loading调整&骑行动画&角度手势方向调整

This commit is contained in:
lishuo committed 2022-01-06 10:58:52 +08:00
1 parent ba36014712
commit 0628bd3716
10 files changed
+331 -299

No files matched your search

@@ -141,15 +141,15 @@ namespace Assets.Scenes.Ride.Scripts
var list = mapApi.GetRouteRanking(route.Id, "1", 0, 10000, "");
if (list.result)
{
if (list.data.list.Count > RankingPageSize)
{
var ViewAll = panel.transform.Find("ViewAll").gameObject;
ViewAll.SetActive(true);
UIManager.AddEvent(ViewAll, UnityEngine.EventSystems.EventTriggerType.PointerClick, b =>
{
Application.OpenURL($"{App.CurrentUser.WebHost}Routes/{cyclingController.mapRoute.Id}?Token={App.CurrentUser.cookie}");
});
}
//if (list.data.list.Count > RankingPageSize)
//{
// var ViewAll = panel.transform.Find("ViewAll").gameObject;
// ViewAll.SetActive(true);
// UIManager.AddEvent(ViewAll, UnityEngine.EventSystems.EventTriggerType.PointerClick, b =>
// {
// Application.OpenURL($"{App.CurrentUser.WebHost}Routes/{cyclingController.mapRoute.Id}?Token={App.CurrentUser.cookie}");
// });
//}
CreateRankingList(list.data.list);
AddProcess(10);
}
@@ -162,6 +162,7 @@ namespace Assets.Scenes.Ride.Scripts
#if UNITY_IOS || UNITY_ANDROID
var prefab = Resources.Load<GameObject>("UI/Prefab/Ride/Mobile/RankingItem");
var myprefab = Resources.Load<GameObject>("UI/Prefab/Ride/Mobile/MySelfRankingItem");
var viewAllbtn = Resources.Load<GameObject>("UI/Prefab/Ride/Mobile/ViewAll");
#else
var prefab = Resources.Load<GameObject>("UI/Prefab/Ride/RankingItem");
var myprefab = Resources.Load<GameObject>("UI/Prefab/Ride/MySelfRankingItem");
@@ -186,17 +187,35 @@ namespace Assets.Scenes.Ride.Scripts
}
//如果有自己的记录显示自己的排名
var myself = list.Where(c => c.MySelf).FirstOrDefault();
if (myself != null)
GameObject myselfObj = (GameObject)Instantiate(myprefab, parent);
var myselfItemScript = myselfObj.GetComponent<RankingItemScript>();
if (myself == null)
{
GameObject newObj = (GameObject)Instantiate(myprefab, parent);
var selectPlayerItemScript = newObj.GetComponent<RankingItemScript>();
selectPlayerItemScript.SetRanking(myself.RowNumber.ToString());
selectPlayerItemScript.SetName(myself.NickName);
selectPlayerItemScript.SetTimer(myself.IsDNF ? "DNF" : myself.TotalTime);
selectPlayerItemScript.SetHead(myself.WxHeadImg);
myselfItemScript.SetRanking("??");
myselfItemScript.SetName(App.CurrentUser.Nickname);
myselfItemScript.SetTimer("??:??:??");
myselfItemScript.SetHead(App.CurrentUser.WxHeadImg);
var texture = cyclingController.GetCountryImageByCode(App.CurrentUser.Country);
myselfItemScript.SetCountry(texture);
}
else
{
myselfItemScript.SetRanking(myself.RowNumber.ToString());
myselfItemScript.SetName(myself.NickName);
myselfItemScript.SetTimer(myself.IsDNF ? "DNF" : myself.TotalTime);
myselfItemScript.SetHead(myself.WxHeadImg);
var texture = cyclingController.GetCountryImageByCode(myself.CountryCode);
selectPlayerItemScript.SetCountry(texture);
myselfItemScript.SetCountry(texture);
}
}
//显示查询全部按钮
if (list.Count > 0)
{
GameObject ViewAll = (GameObject)Instantiate(viewAllbtn, parent);
UIManager.AddEvent(ViewAll, UnityEngine.EventSystems.EventTriggerType.PointerClick, b =>
{
Application.OpenURL($"{App.CurrentUser.WebHost}Routes/{cyclingController.mapRoute.Id}?Token={App.CurrentUser.cookie}");
});
}
}
}
}