伴侣骑行继续骑
This commit is contained in:
parent
8e88b4adba
commit
50b46c5b76
@ -25,5 +25,7 @@ namespace Assets.Scripts.Apis.Models
|
||||
public string NickName { get; set; }
|
||||
|
||||
public double WeightKg { get; set; }
|
||||
public double Weight { get; set; }
|
||||
public double BikeWeight { get; set; }
|
||||
}
|
||||
}
|
||||
|
||||
@ -55,6 +55,15 @@ namespace Assets.Scenes.Ride.Scripts.Model.CyclingModels
|
||||
//AntModelId = antModelId
|
||||
};
|
||||
|
||||
if (param != null)
|
||||
{
|
||||
recorderData.ContinueIndex = param.ContinueIndex??0;
|
||||
recorderData.ContinueMark = param.ContinueMark;
|
||||
recorderData.EndDistance = param.EndDistance;
|
||||
recorderData.PreDistance = param.EndDistance;
|
||||
recorderData.CurrentRouteStartDistance = param.EndDistance;
|
||||
}
|
||||
|
||||
//recorderData = recorderData1;
|
||||
this.IsRecord = true;
|
||||
//riders = riders1;
|
||||
|
||||
@ -365,7 +365,7 @@ namespace Assets.Scenes.Ride.Scripts
|
||||
|
||||
#region UI行为
|
||||
|
||||
protected virtual void MoveGraphHead()
|
||||
protected virtual void MoveGraphHead(bool init = false)
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
@ -80,17 +80,6 @@ public class CyclingController : DeviceServiceMonoBase
|
||||
//获取路书信息
|
||||
mapApi = ConfigHelper.mapApi;
|
||||
routeId = App.RouteIdParam > 0? App.RouteIdParam : 2633;
|
||||
//mapRoute = mapApi.GetById(routeId).data;
|
||||
//miniMap = transform.Find("MiniMap").gameObject;//小地图
|
||||
//var panel = Instantiate(Resources.Load<GameObject>("UI/Prefab/Ride/Panel"), UIObject.transform);
|
||||
|
||||
//resultPanel = transform.Find("UI/Panel/ResultPanel").gameObject;
|
||||
|
||||
////获取海拔图UI对象
|
||||
//var graphObject = transform.Find("UI/Panel/GraphChart");
|
||||
//chartDataSourceScript = graphObject.GetComponent<ChartDataSourceScript>();
|
||||
//graph = graphObject.GetComponent<GraphChartBase>();
|
||||
|
||||
competitionId = App.CompetionId;
|
||||
App.CompetionId = 0;//清空比赛参数
|
||||
Resources.UnloadUnusedAssets();
|
||||
@ -98,7 +87,6 @@ public class CyclingController : DeviceServiceMonoBase
|
||||
|
||||
void OnDestroy()
|
||||
{
|
||||
//App.TextureCache.Clear();
|
||||
Resources.UnloadUnusedAssets();
|
||||
}
|
||||
Transform target;
|
||||
@ -328,19 +316,8 @@ public class CyclingController : DeviceServiceMonoBase
|
||||
App.routeResult = null;
|
||||
|
||||
#endregion
|
||||
////异步请求mapbox画出当前路书路线图
|
||||
//loadingController.DrawMapRouteAsync(mapRoute.Id);
|
||||
//loadingController.AddProcess(10);
|
||||
//计算上次骑行距离调整地图中心点
|
||||
double endDistance = selectParamModel.EndDistance;
|
||||
coordiantes = Along(endDistance);
|
||||
////查询排行榜
|
||||
//var list = mapApi.GetRouteRanking(App.RouteIdParam, "1", 0, 10, "");
|
||||
//if (list.result)
|
||||
//{
|
||||
// loadingController.CreateRankingList(list.data.list);
|
||||
// loadingController.AddProcess(10);
|
||||
//}
|
||||
var shaowList = mapApi.GetShadowList(App.RouteIdParam, "", 0, 10);
|
||||
if (shaowList.result)
|
||||
{
|
||||
@ -488,7 +465,7 @@ public class CyclingController : DeviceServiceMonoBase
|
||||
//初始化海拔图头像位置
|
||||
var index = GetCurrentIndex(recorderData.EndDistance);
|
||||
InitGraph(index);
|
||||
//playerController.InitGraph(index);
|
||||
playerController.CurrentIndex = index;
|
||||
}
|
||||
public void InitGraph(int index)
|
||||
{
|
||||
@ -499,9 +476,9 @@ public class CyclingController : DeviceServiceMonoBase
|
||||
public void GameStart()
|
||||
{
|
||||
var check = CheckAnt();
|
||||
//#if UNITY_EDITOR
|
||||
// check = true;
|
||||
//#endif
|
||||
#if UNITY_EDITOR
|
||||
check = true;
|
||||
#endif
|
||||
if (check)
|
||||
{
|
||||
singleUIManager.StartRide();
|
||||
|
||||
@ -236,7 +236,7 @@ namespace Assets.Scenes.Ride.Scripts
|
||||
lineRender.numCornerVertices = 10;
|
||||
}
|
||||
|
||||
protected override void MoveGraphHead()
|
||||
protected override void MoveGraphHead(bool init=false)
|
||||
{
|
||||
if (mainController.cyclingModel == CyclingModel.Competition)
|
||||
{
|
||||
|
||||
@ -36,6 +36,13 @@ namespace Assets.Scenes.Ride.Scripts
|
||||
//创建UI
|
||||
uiObject = uipanel.transform.Find("ArrowList");
|
||||
arrowImage = Instantiate(Resources.Load<Image>("UI/Prefab/Ride/ReviewArrow"), uiObject);
|
||||
//初始化位置
|
||||
Compute();
|
||||
var initPos = map.GeoToWorldPosition(currentlatlong);
|
||||
initPos.y += 1.35f;//提高y轴让人物站在地图上面
|
||||
transform.localPosition = initPos;
|
||||
CurrentIndex = mainController.GetCurrentIndex(totalDistance);
|
||||
MoveGraphHead(true);
|
||||
}
|
||||
|
||||
double diff = 0;
|
||||
@ -157,7 +164,7 @@ namespace Assets.Scenes.Ride.Scripts
|
||||
}
|
||||
}
|
||||
|
||||
protected override void MoveGraphHead()
|
||||
protected override void MoveGraphHead(bool init = false)
|
||||
{
|
||||
var itemIndex = chartDataSourceScript.GetViewIndex(CurrentIndex);
|
||||
var m = graph.DataSource.GetPoint("Player 2", itemIndex);
|
||||
@ -176,7 +183,8 @@ namespace Assets.Scenes.Ride.Scripts
|
||||
head = headPanel.GetComponentInChildren<RawImage>();
|
||||
head.texture = _reviewItemScript.GetHead();
|
||||
}
|
||||
headPanel.transform.DOMove(new Vector3(itemPosition.x, itemPosition.y, 0), 1);
|
||||
var duration = init ? 0 : 1;
|
||||
headPanel.transform.DOMove(new Vector3(itemPosition.x, itemPosition.y, 0), duration);
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -43,6 +43,7 @@ namespace Assets.Scenes.Ride.Scripts
|
||||
trail.enabled = false;
|
||||
|
||||
headPanel = uipanel.transform.Find("GraphChart/HeadPanel").gameObject;
|
||||
MoveGraphHead(true);
|
||||
}
|
||||
TargetData targetData;
|
||||
/// <summary>
|
||||
@ -134,7 +135,7 @@ namespace Assets.Scenes.Ride.Scripts
|
||||
// chartDataSourceScript.InitHorizontalScrolling(index);
|
||||
//}
|
||||
//移动海拔图头像
|
||||
protected override void MoveGraphHead()
|
||||
protected override void MoveGraphHead(bool init = false)
|
||||
{
|
||||
Vector3 oldPos = headPanel.transform.position;
|
||||
int nextIndex = CurrentIndex;
|
||||
@ -154,7 +155,8 @@ namespace Assets.Scenes.Ride.Scripts
|
||||
{
|
||||
graph.HorizontalScrolling += offset;
|
||||
}
|
||||
headPanel.transform.DOMove(new Vector3(oldPos.x, nextPosition.y, 0), 1);
|
||||
var duration = init ? 0 : 1;
|
||||
headPanel.transform.DOMove(new Vector3(oldPos.x, nextPosition.y, 0), duration);
|
||||
}
|
||||
else
|
||||
{
|
||||
|
||||
@ -58,7 +58,6 @@ namespace Assets.Scenes.Ride.Scripts
|
||||
break;
|
||||
case Model.CyclingModel.Review:
|
||||
singleArea.SetActive(false);
|
||||
//InitReview();
|
||||
break;
|
||||
}
|
||||
}
|
||||
@ -101,12 +100,12 @@ namespace Assets.Scenes.Ride.Scripts
|
||||
otherPlayerObj.transform.position = cyclingController.map.GeoToWorldPosition(cyclingController.Along(0));
|
||||
var otherPlayerController = otherPlayerObj.GetComponent<OtherPlayerController>();
|
||||
otherList.Add(otherPlayerController);
|
||||
otherPlayerController.record = item.record;
|
||||
|
||||
otherPlayerController.Weight = cyclingController.selectPlayerDic[item.UserId].Weight;
|
||||
otherPlayerController.BikeWeight = cyclingController.selectPlayerDic[item.UserId].BikeWeight;
|
||||
|
||||
otherPlayerController.record = item.record;
|
||||
otherPlayerController.Weight = item.Weight;
|
||||
otherPlayerController.BikeWeight = item.BikeWeight;
|
||||
otherPlayerController.SetController(reviewItemScript);
|
||||
|
||||
GameObject miniPlayer = (GameObject)Instantiate(miniMapPlayer, transform.parent.parent.parent);
|
||||
var miniController = miniPlayer.GetComponent<MiniMapPlayerController>();
|
||||
miniController.SetController(otherPlayerController);
|
||||
|
||||
@ -2,6 +2,7 @@
|
||||
using DG.Tweening;
|
||||
using Assets.Scenes.Ride.Scripts.Model;
|
||||
using UnityEngine.EventSystems;
|
||||
using Assets.Scripts;
|
||||
|
||||
namespace Assets.Scenes.Ride.Scripts
|
||||
{
|
||||
@ -29,13 +30,16 @@ namespace Assets.Scenes.Ride.Scripts
|
||||
if (mainController.routeResult != null)
|
||||
{
|
||||
#region 注释伴侣骑行的重骑和继续骑行的逻辑
|
||||
//if (mainController.routeResult.Mode == CyclingModel.Review.ToString())
|
||||
//{
|
||||
// mainController.SetCyclingModel(CyclingModel.Review);
|
||||
// selectPanel.SetActive(false);
|
||||
// var reviewFactory = reviewPanel.transform.GetComponent<ReviewFactory>();
|
||||
// reviewFactory.Refresh();
|
||||
//}
|
||||
if (mainController.routeResult.Mode == CyclingModel.Review.ToString())
|
||||
{
|
||||
mainController.SetCyclingModel(CyclingModel.Review);
|
||||
selectPanel.SetActive(false);
|
||||
//查询选中人员的骑行记录
|
||||
var rankingList = ConfigHelper.mapApi.GetRecordFileFromServer(mainController.routeResult.ContinueCyclingParam.RankingsId);
|
||||
var reviewFactory = reviewPanel.transform.GetComponent<ReviewFactory>();
|
||||
reviewFactory.Refresh();
|
||||
reviewFactory.SetReview(rankingList);
|
||||
}
|
||||
#endregion
|
||||
if (mainController.routeResult.Mode == CyclingModel.Single.ToString())
|
||||
{
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user