人物移动调整
This commit is contained in:
parent
70626ae741
commit
10c82703f4
@ -158,33 +158,28 @@ namespace Assets.Scenes.Ride.Scripts
|
||||
ticks++;
|
||||
Compute();//接受蓝牙设备数据计算
|
||||
//characterAnimator.SetBool("IsRide", false);//初始化动画状态
|
||||
if (totalDistance <= mapData.TotalDistance)
|
||||
{
|
||||
//数据处理
|
||||
nextlatlong = Along(totalDistance);//下一个坐标
|
||||
nextPos = map.GeoToWorldPosition(nextlatlong);//下一个点
|
||||
nextPos.y += 0.5f;//提高y轴让人物站在地图上面
|
||||
prePos = transform.localPosition;//当前点
|
||||
thisRotation = transform.localRotation;
|
||||
//动画控制
|
||||
if (distance > 0)
|
||||
{
|
||||
//characterAnimator.SetBool("IsRide", true);//开始移动动画
|
||||
|
||||
StartCoroutine(MoveTo());//移动
|
||||
//transform.localPosition = nextPos;
|
||||
}
|
||||
}
|
||||
else
|
||||
if (totalDistance > mapData.TotalDistance)
|
||||
{
|
||||
distance = totalDistance - mapData.TotalDistance;
|
||||
totalDistance = mapData.TotalDistance;
|
||||
//characterAnimator.SetBool("ReachEnd", true);//到达终点
|
||||
//Task.Run(() => { });//异步上传数据
|
||||
Upload();
|
||||
//mainController.isStart = false;
|
||||
isQuit = true;
|
||||
}
|
||||
}
|
||||
|
||||
//数据处理
|
||||
nextlatlong = Along(totalDistance);//下一个坐标
|
||||
nextPos = map.GeoToWorldPosition(nextlatlong);//下一个点
|
||||
nextPos.y += 0.5f;//提高y轴让人物站在地图上面
|
||||
prePos = transform.localPosition;//当前点
|
||||
thisRotation = transform.localRotation;
|
||||
//动画控制
|
||||
if (distance > 0)
|
||||
{
|
||||
//characterAnimator.SetBool("IsRide", true);//开始移动动画
|
||||
StartCoroutine(MoveTo());//移动
|
||||
}
|
||||
}
|
||||
}
|
||||
protected virtual void SendTcp()
|
||||
{
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user