界面微调,设备连接中断跳时间bug修复

This commit is contained in:
lishuo committed 2021-05-20 15:55:27 +08:00
1 parent f1eeb11543
commit 7ba012f5f2
20 files changed
+3763 -3334

No files matched your search

+15 -25
View File
@@ -133,14 +133,7 @@ namespace Assets.Scenes.Ride.Scripts
{
characterAnimator.speed = 1f;
}
//if (speed < 20 && speed >= 10)
//{
// characterAnimator.speed = 0.8f;
//}
//if (speed >= 20)
//{
// characterAnimator.speed = 1f;
//}
if (totalDistance >= mapData.TotalDistance)
{
characterAnimator.SetBool("ReachEnd", true);//到达终点
@@ -176,7 +169,7 @@ namespace Assets.Scenes.Ride.Scripts
}
}
//游戏开始开关
protected virtual bool GetStart()
public virtual bool GetStart()
{
return mainController.isStart;
}
@@ -252,16 +245,18 @@ namespace Assets.Scenes.Ride.Scripts
public Quaternion currentRotation;
IEnumerator LookAtNextPos()
{
Quaternion neededRotation = Quaternion.LookRotation(prePos - nextPos);
//Quaternion thisRotation = character.transform.localRotation;
float t = 0;
while (t < 1.0f)
if (prePos != nextPos)
{
t += Time.deltaTime / 0.5f;
currentRotation = Quaternion.Slerp(thisRotation, neededRotation, t);
character.transform.rotation = Quaternion.Euler(0, currentRotation.eulerAngles.y, 0);
yield return null;
Quaternion neededRotation = Quaternion.LookRotation(prePos - nextPos);
float t = 0;
while (t < 1.0f)
{
t += Time.deltaTime / 0.5f;
currentRotation = Quaternion.Slerp(thisRotation, neededRotation, t);
character.transform.rotation = Quaternion.Euler(0, currentRotation.eulerAngles.y, 0);
yield return null;
}
}
}
Vector3 deltaPos = Vector3.zero;
@@ -285,13 +280,8 @@ namespace Assets.Scenes.Ride.Scripts
t += Time.deltaTime;
Vector3 v = Vector3.Lerp(prePos, nextPos, t);
//Vector3 nextPosition = new Vector3((float)Math.Round(v.x, 2), (float)Math.Round(v.y, 2), (float)Math.Round(v.z, 2));
//if (!nextPosition.Equals(transform.localPosition))
{
currentPos = v;
transform.localPosition = v;
//Camera.main.transform.localPosition = nextPosition;
}
currentPos = v;
transform.localPosition = v;
yield return new WaitForEndOfFrame();
}
}