骑行界面&赛事界面调整&设备断开功能
This commit is contained in:
1 parent
467a6f3810
commit
99081519bb
43 files changed
+3658
-697
No files matched your search
@@ -115,7 +115,9 @@ namespace Assets.Scenes.Ride.Scripts
|
||||
InitData();//初始
|
||||
RenderChart();//渲染海拔图
|
||||
}
|
||||
|
||||
Text totalDistanceCompetition { get; set; }
|
||||
GameObject distanceIconCompetition { get; set; }
|
||||
GameObject totalDistanceIcon { get; set; }
|
||||
private void InitGameObject()
|
||||
{
|
||||
#region 控件获取与事件绑定
|
||||
@@ -130,6 +132,8 @@ namespace Assets.Scenes.Ride.Scripts
|
||||
ditance = uipanel.transform.Find("ComputerPanel/Distance").GetComponent<Text>();
|
||||
titlePanel = uipanel.transform.Find("TitlePanel").gameObject;
|
||||
totalDistance = uipanel.transform.Find("TitlePanel/TotalDistance").GetComponent<Text>();
|
||||
totalDistanceIcon = uipanel.transform.Find("TitlePanel/DistanceIcon").gameObject;
|
||||
|
||||
candance = uipanel.transform.Find("PowerPanel/Cadance").GetComponent<Text>();
|
||||
heartRate = uipanel.transform.Find("PowerPanel/Hrv").GetComponent<Text>();
|
||||
nextSlopePanel = uipanel.transform.Find("NextSlopePanel").gameObject;
|
||||
@@ -137,6 +141,11 @@ namespace Assets.Scenes.Ride.Scripts
|
||||
nextSlopeText = uipanel.transform.Find("NextSlopePanel/NextSlopeText").GetComponent<Text>();
|
||||
nextSlopeDistanceText = uipanel.transform.Find("NextSlopePanel/NextSlopeDistance").GetComponent<Text>();
|
||||
currentSlopeText = uipanel.transform.Find("CurrentSlopePanel/CurrentSlopeText").GetComponent<Text>();
|
||||
#if UNITY_IOS || UNITY_ANDROID
|
||||
totalDistanceCompetition = uipanel.transform.Find("TitlePanel/TotalDistanceCompetition").GetComponent<Text>();
|
||||
distanceIconCompetition = uipanel.transform.Find("TitlePanel/DistanceIconCompetition").gameObject;
|
||||
nextSlopeText = uipanel.transform.Find("CurrentSlopePanel/NextSlopeText").GetComponent<Text>();
|
||||
#endif
|
||||
currentSlopeDistanceText = uipanel.transform.Find("CurrentSlopePanel/CurrentSlopeDistance").GetComponent<Text>();
|
||||
currentSlopeToatalDistanceText = uipanel.transform.Find("CurrentSlopePanel/TotalSlopeDistance").GetComponent<Text>();
|
||||
currentSlopeProcess = uipanel.transform.Find("CurrentSlopePanel/Process").GetComponent<Image>();
|
||||
@@ -226,7 +235,7 @@ namespace Assets.Scenes.Ride.Scripts
|
||||
UIManager.AddEvent(singleButton.gameObject, UnityEngine.EventSystems.EventTriggerType.PointerExit, OnPointExit);
|
||||
UIManager.AddEvent(shadowButton.gameObject, UnityEngine.EventSystems.EventTriggerType.PointerExit, OnPointExit);
|
||||
|
||||
#endregion
|
||||
#endregion
|
||||
}
|
||||
protected virtual void Update()
|
||||
{
|
||||
@@ -273,6 +282,7 @@ namespace Assets.Scenes.Ride.Scripts
|
||||
//开发者视角调整
|
||||
cameraSlider = uipanel.transform.Find("CameraSlider").GetComponent<Slider>();
|
||||
Text CameraText = uipanel.transform.Find("CameraSlider/Text").GetComponent<Text>();
|
||||
#if !(UNITY_IOS || UNITY_ANDROID)
|
||||
string[] phoneList = new string[] { "18120141032", "15651831367", "18120141031", "15261826280", "18662240319" };
|
||||
if (phoneList.Contains(App.CurrentUser.Phone))
|
||||
{
|
||||
@@ -285,9 +295,24 @@ namespace Assets.Scenes.Ride.Scripts
|
||||
CameraText.text = f.ToString("f0");
|
||||
});
|
||||
}
|
||||
#endif
|
||||
//路书基本信息绑定
|
||||
mapName.text = routeInstance.Name;
|
||||
totalDistance.text = Math.Round(mainController.GetMapData().TotalDistance, 1).ToString() + "KM";//总里程
|
||||
|
||||
#if UNITY_IOS || UNITY_ANDROID
|
||||
totalDistanceCompetition.text = Math.Round(mainController.GetMapData().TotalDistance, 1).ToString() + "KM";//总里程
|
||||
var watchList = mainController.GetWatcherList();
|
||||
if (mainController.competitionId > 0)
|
||||
{
|
||||
var showLeft = watchList.Count > 0;
|
||||
distanceIconCompetition.SetActive(!showLeft);
|
||||
totalDistanceCompetition.gameObject.SetActive(!showLeft);
|
||||
totalDistance.gameObject.SetActive(showLeft);
|
||||
totalDistanceIcon.gameObject.SetActive(showLeft);
|
||||
}
|
||||
#endif
|
||||
|
||||
Utils.DisplayImage(altitudeGraph, route.RouteInstance.AltitudeGraph);//渲染海拔图
|
||||
//影子骑行按钮控制
|
||||
if (mainController.mapRouteRankingList == null || mainController.mapRouteRankingList.Count == 0)
|
||||
|
||||
@@ -76,7 +76,7 @@ namespace Assets.Scenes.Ride.Scripts
|
||||
slope.text = Math.Round(route.AverageGrade, 2).ToString() + "%";
|
||||
rideNum.text = route.TheHeat.ToString();
|
||||
distance.text = route.Distance.ToString("f1") + "KM";
|
||||
mapDescText.text = route.Dec;
|
||||
mapDescText.text = GetMaxString(route.Dec, 255);
|
||||
mapId.text = route.Id.ToString();
|
||||
var userList = ConfigHelper.mapApi.GetOnlineUserInfo(new int[] { route.UserId }).data;
|
||||
if (userList.Count > 0)
|
||||
|
||||
@@ -29,7 +29,7 @@ namespace Assets.Scenes.Ride.Scripts
|
||||
#endif
|
||||
Title = transform.Find("Title").GetComponent<Text>();
|
||||
OnlineUserNum = transform.Find("NearByView/OnlineUserNum").GetComponent<Text>();
|
||||
pageSize = 5;//开启无线下拉
|
||||
pageSize = 7;//开启无线下拉
|
||||
}
|
||||
protected override void CreateList()
|
||||
{
|
||||
|
||||
@@ -96,7 +96,17 @@ namespace Assets.Scenes.Ride.Scripts
|
||||
{
|
||||
if (infoPanel == null)
|
||||
{
|
||||
if(mainController.cyclingModel == CyclingModel.Competition)
|
||||
#if UNITY_IOS || UNITY_ANDROID
|
||||
if (mainController.cyclingModel == CyclingModel.Competition)
|
||||
{
|
||||
infoPanel = Instantiate(Resources.Load<GameObject>("UI/Prefab/Ride/Mobile/OnlineRaceInfoPanel"), uiObject);
|
||||
}
|
||||
else
|
||||
{
|
||||
infoPanel = Instantiate(Resources.Load<GameObject>("UI/Prefab/Ride/Mobile/OnlineInfoPanel"), uiObject);
|
||||
}
|
||||
#else
|
||||
if (mainController.cyclingModel == CyclingModel.Competition)
|
||||
{
|
||||
infoPanel = Instantiate(Resources.Load<GameObject>("UI/Prefab/Ride/OnlineRaceInfoPanel"), uiObject);
|
||||
}
|
||||
@@ -104,6 +114,7 @@ namespace Assets.Scenes.Ride.Scripts
|
||||
{
|
||||
infoPanel = Instantiate(Resources.Load<GameObject>("UI/Prefab/Ride/OnlineInfoPanel"), uiObject);
|
||||
}
|
||||
#endif
|
||||
}
|
||||
var headPos = infoPanel.transform.Find("Head").position;
|
||||
var infoPos = playerScreenPos + new Vector3(150f, 60f, 0f);
|
||||
|
||||
@@ -72,7 +72,11 @@ namespace Assets.Scenes.Ride.Scripts
|
||||
{
|
||||
if (infoPanel == null)
|
||||
{
|
||||
#if UNITY_IOS || UNITY_ANDROID
|
||||
infoPanel = Instantiate(Resources.Load<GameObject>("UI/Prefab/Ride/Mobile/OnlineInfoPanel"), uiObject);
|
||||
#else
|
||||
infoPanel = Instantiate(Resources.Load<GameObject>("UI/Prefab/Ride/OnlineInfoPanel"), uiObject);
|
||||
#endif
|
||||
}
|
||||
var headPos = infoPanel.transform.Find("Head").position;
|
||||
var infoPos = playerScreenPos + new Vector3(150f, 60f, 0f);
|
||||
|
||||
@@ -92,6 +92,9 @@ namespace Assets.Scenes.Ride.Scripts
|
||||
gameObjects.Add(transform.Find("Panel/Player3").gameObject);
|
||||
gameObjects.Add(transform.Find("Panel/Player4").gameObject);
|
||||
gameObjects.Add(transform.Find("Panel/Player5").gameObject);
|
||||
#if UNITY_IOS || UNITY_ANDROID
|
||||
gameObjects.Add(transform.Find("Panel/Player6").gameObject);
|
||||
#endif
|
||||
//功体比默认条件
|
||||
//var currentUserWkg = Math.Round((App.CurrentUser.FTP / App.CurrentUser.Weight),2);
|
||||
//_startValue = currentUserWkg - 0.5<0?0 : currentUserWkg - 0.5;
|
||||
|
||||
Reference in new issue
Block a user