新版骑行页面前备份

This commit is contained in:
lishuo committed 2021-04-21 14:08:45 +08:00
1 parent 4896fab824
commit e7ad9473a5
85 files changed
+6816 -5424

No files matched your search

+14 -8
View File
@@ -35,7 +35,7 @@ namespace Assets.Scenes.Ride.Scripts
protected Vector2d nextlatlong; //下一个点的坐标
protected Vector2d currentlatlong; //当前坐标
//protected bool isStart;//开始或者暂停
public bool isQuit;//true 中途退出 或者到达终点
//public bool isQuit;//true 中途退出 或者到达终点
protected bool isMajor;//是否是主人公
protected MapDataModel mapData;
protected int userId;
@@ -92,7 +92,7 @@ namespace Assets.Scenes.Ride.Scripts
protected BaseCycling cyclingExcutor;
protected virtual void Init()
{
//characterAnimator = GetComponentInChildren<Animator>();
characterAnimator = GetComponentInChildren<Animator>();
mainController = transform.parent.GetComponent<CyclingController>();
map = transform.parent.Find("Map").GetComponent<AbstractMap>();
mapData = mainController.GetMapData();//获取路书信息
@@ -113,7 +113,16 @@ namespace Assets.Scenes.Ride.Scripts
protected virtual void Run()
{
ComputeNextSlope();//计算下一个坡度相关数据
//人物动画控制
if (characterAnimator != null && mapData != null)
{
characterAnimator.SetFloat("Speed", (float)speed);
if (totalDistance >= mapData.TotalDistance)
{
characterAnimator.SetBool("ReachEnd", true);//到达终点
}
}
//开始骑行
if (mainController.isStart)
{
if (index > 0)
@@ -131,14 +140,12 @@ namespace Assets.Scenes.Ride.Scripts
}
ticks++;
Compute();//接受蓝牙设备数据计算
//characterAnimator.SetBool("IsRide", false);//初始化动画状态
if (totalDistance > mapData.TotalDistance)
{
distance = totalDistance - mapData.TotalDistance;
totalDistance = mapData.TotalDistance;
//characterAnimator.SetBool("ReachEnd", true);//到达终点
StartCoroutine("LateUpload");
isQuit = true;
}
//数据处理
@@ -147,10 +154,9 @@ namespace Assets.Scenes.Ride.Scripts
nextPos.y += 0.6f;//提高y轴让人物站在地图上面
prePos = transform.localPosition;//当前点
thisRotation = transform.localRotation;
//动画控制
//移动动画控制
if (distance > 0)
{
//characterAnimator.SetBool("IsRide", true);//开始移动动画
StartCoroutine(MoveTo());//移动
}
}