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

@@ -151,19 +151,23 @@ namespace Assets.Scenes.Ride.Scripts
{
characterAnimator.SetFloat("Speed", (float)speed);
characterAnimator.SetFloat("Slope", (float)currentSlope);
if (currentSlope > 5)
{
characterAnimator.speed = 0.2f;
}
else
if (currentSlope > 6)
{
characterAnimator.speed = 0.45f;
}
if (totalDistance >= mapData.TotalDistance)
{
characterAnimator.SetBool("ReachEnd", true);//到达终点
else
{
characterAnimator.speed = 0.65f;
}
if (speed > 40)
{
characterAnimator.speed = 0.75f;
}
//if (totalDistance >= mapData.TotalDistance)
//{
// characterAnimator.SetBool("ReachEnd", true);//到达终点
//}
}
Compute();//接受蓝牙设备数据计算
//开始骑行
@@ -274,7 +274,7 @@ public class CyclingController : DeviceServiceMonoBase
{
RotateLock = false;
DOTween.Kill(target);
target.transform.Rotate(new Vector3(0, 1, 0), r.deltaRotation);
target.transform.Rotate(new Vector3(0, -1, 0), r.deltaRotation);
}
};
@@ -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}");
});
}
}
}
}
@@ -61,7 +61,7 @@ namespace Assets.Scenes.Ride.Scripts
weight = App.CurrentUser.Weight;
bicycleWeight = App.CurrentUser.BicycleWeight;
#if UNITY_EDITOR
power = 1443;
power = 330;
#endif
mainController.TrackResistance(currentSlope * App.RideSetting.Sensitivity / 100);
}