小地图进度微调,人物脚本调整
This commit is contained in:
1 parent
8ca32cd1ae
commit
2b4b2c4f70
15 files changed
+3626
-3085
No files matched your search
@@ -22,7 +22,7 @@ namespace Assets.Scenes.Ride.Scripts
|
||||
[SerializeField]
|
||||
Animator characterAnimator;
|
||||
|
||||
AbstractMap map;
|
||||
protected AbstractMap map;
|
||||
//AbstractMap map;
|
||||
|
||||
#region 动画控制参数
|
||||
@@ -105,7 +105,7 @@ namespace Assets.Scenes.Ride.Scripts
|
||||
timer -= Time.deltaTime;
|
||||
if (timer <= 0)//定时器 一秒执行一次
|
||||
{
|
||||
SendTcp();
|
||||
BeforeRun();
|
||||
Run();
|
||||
timer = 1.0f;
|
||||
}
|
||||
@@ -126,12 +126,12 @@ namespace Assets.Scenes.Ride.Scripts
|
||||
}
|
||||
|
||||
//开始骑行
|
||||
if (mainController.isStart)
|
||||
if (GetStart())
|
||||
{
|
||||
//计算累计爬升
|
||||
if (index > 0)
|
||||
{
|
||||
totalClimb = 0;
|
||||
//计算累计爬升
|
||||
for (int i = 1; i <= index; i++)
|
||||
{
|
||||
var diff = mapData.List[i].Elevation - mapData.List[i - 1].Elevation;
|
||||
@@ -155,17 +155,23 @@ namespace Assets.Scenes.Ride.Scripts
|
||||
//数据处理
|
||||
|
||||
nextPos = map.GeoToWorldPosition(currentlatlong);//下一个点
|
||||
nextPos.y += 1.15f;//提高y轴让人物站在地图上面
|
||||
nextPos.y += 1.35f;//提高y轴让人物站在地图上面
|
||||
prePos = transform.localPosition;//当前点
|
||||
thisRotation = transform.localRotation;
|
||||
//移动动画控制
|
||||
if (distance > 0)
|
||||
//if (distance > 0)
|
||||
{
|
||||
Debug.Log("164"+totalDistance.ToString());
|
||||
StartCoroutine(MoveTo());//移动
|
||||
}
|
||||
}
|
||||
}
|
||||
protected virtual void SendTcp()
|
||||
//游戏开始开关
|
||||
protected virtual bool GetStart()
|
||||
{
|
||||
return mainController.isStart;
|
||||
}
|
||||
protected virtual void BeforeRun()
|
||||
{
|
||||
|
||||
}
|
||||
@@ -225,8 +231,6 @@ namespace Assets.Scenes.Ride.Scripts
|
||||
nextSlopeDistance = sumDistance - totalDistance * 1000;
|
||||
NextSlopeTotalDistance = pointList[nextIndex].Distance;
|
||||
currentSlopeDistance = CurrentDistance-( totalDistance * 1000 - (sumDistance - pointList[index].Distance));
|
||||
//人物初始化角度控制
|
||||
|
||||
}
|
||||
public double PreElevation;
|
||||
public double PreSlope;
|
||||
|
||||
Reference in new issue
Block a user