继续骑行海图初始位置,地图属性调整
This commit is contained in:
1 parent
724e43f392
commit
3757ae6e6c
10 files changed
+3279
-3274
No files matched your search
@@ -243,6 +243,9 @@ public class CyclingController : DeviceServiceMonoBase
|
||||
Quaternion neededRotation = Quaternion.LookRotation(s - e);
|
||||
player.transform.rotation = Quaternion.Euler(0, neededRotation.eulerAngles.y, 0);
|
||||
playerController.currentRotation = neededRotation;
|
||||
//初始化海拔图头像位置
|
||||
var index = GetCurrentIndex(recorderData.EndDistance);
|
||||
playerController.InitGraph(index);
|
||||
}
|
||||
SingleUIManager singleUIManager;
|
||||
public void AutoStart()
|
||||
@@ -284,6 +287,7 @@ public class CyclingController : DeviceServiceMonoBase
|
||||
var currentUser = currentOnlineUserList.Where(c => c.UserId == item.UserId).FirstOrDefault();
|
||||
var onlineDistance = onlineRider.EndDistance - onlineRider.PreDistance;
|
||||
var onlineTotalDistance = onlineRider.EndDistance;
|
||||
var index = GetCurrentIndex(onlineTotalDistance);
|
||||
|
||||
if (currentUser == null)
|
||||
{
|
||||
@@ -294,7 +298,8 @@ public class CyclingController : DeviceServiceMonoBase
|
||||
otherList.Add(onlinePlayerController);
|
||||
|
||||
onlinePlayerController.UserId = onlineRider.UserId;
|
||||
onlinePlayerController.SetDataSource(onlineTotalDistance, onlineDistance, onlineRider.NickName, onlineRider.WeightKg);
|
||||
|
||||
onlinePlayerController.SetDataSource(onlineTotalDistance, onlineDistance, onlineRider.NickName, onlineRider.WeightKg, index);
|
||||
onlinePlayerController.SetHead(onlineRider.WxHeadImg);
|
||||
//小地图人物
|
||||
GameObject miniPlayer = (GameObject)Instantiate(miniMapPlayerPrefab, transform);
|
||||
@@ -304,11 +309,10 @@ public class CyclingController : DeviceServiceMonoBase
|
||||
if(messageIndex > 0)
|
||||
EventQueueSystem.QueueEvent(new JoinMessageEvent(onlineRider.NickName, onlineRider.WxHeadImg));
|
||||
|
||||
|
||||
}
|
||||
else
|
||||
{
|
||||
currentUser.SetDataSource(onlineTotalDistance, onlineDistance, onlineRider.NickName, onlineRider.WeightKg);
|
||||
currentUser.SetDataSource(onlineTotalDistance, onlineDistance, onlineRider.NickName, onlineRider.WeightKg, index);
|
||||
}
|
||||
}
|
||||
if(onlineRiders.Count > 0)
|
||||
@@ -539,6 +543,25 @@ public class CyclingController : DeviceServiceMonoBase
|
||||
{
|
||||
return coordiantes;
|
||||
}
|
||||
|
||||
public int GetCurrentIndex(double endDistance)
|
||||
{
|
||||
int index = 0;
|
||||
var pointList = mapData.List;
|
||||
double sumDistance = 0;
|
||||
|
||||
for (int i = 0; i < pointList.Count; i++)
|
||||
{
|
||||
sumDistance += pointList[i].Distance;
|
||||
if (endDistance * 1000 <= sumDistance)
|
||||
{
|
||||
index = i;
|
||||
break;
|
||||
}
|
||||
}
|
||||
index = endDistance >= mapData.TotalDistance ? index + 1 : index;
|
||||
return index;
|
||||
}
|
||||
public Vector2d Along(double endDistance)
|
||||
{
|
||||
if (mapData != null)
|
||||
|
||||
Reference in new issue
Block a user