This commit is contained in:
parent
8f2d9ce319
commit
ac62f78ecf
|
@ -760,11 +760,11 @@ public class UnmannedAerialVehicleManage : MonoBehaviour
|
||||||
if (string.IsNullOrEmpty(currentSceneInfo.EnvWindSpeed))
|
if (string.IsNullOrEmpty(currentSceneInfo.EnvWindSpeed))
|
||||||
{
|
{
|
||||||
///根据风得速度改变无人机得速度
|
///根据风得速度改变无人机得速度
|
||||||
FireSpeed = float.Parse(maximumFlyingSpeed) / float.Parse(currentSceneInfo.EnvWindSpeed);
|
maximumFlyingSpeed = (float.Parse(maximumFlyingSpeed) / float.Parse(currentSceneInfo.EnvWindSpeed)).ToString("f2");
|
||||||
/////如果风速大于6级,无人机停止飞行
|
/////如果风速大于6级,无人机停止飞行
|
||||||
if (float.Parse(currentSceneInfo.EnvWindSpeed) * 10 > 6)
|
if (float.Parse(currentSceneInfo.EnvWindSpeed) * 10 > 6)
|
||||||
{
|
{
|
||||||
FireSpeed = 0;
|
maximumFlyingSpeed = "";
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
//CheckRSC();
|
//CheckRSC();
|
||||||
|
@ -1194,7 +1194,7 @@ public class UnmannedAerialVehicleManage : MonoBehaviour
|
||||||
//gamemap.gameObject.SetActive(true);
|
//gamemap.gameObject.SetActive(true);
|
||||||
Vector3 targetPosition = new Vector3(_positions.x, hight, _positions.z);// 目标位置为当前顶点坐标
|
Vector3 targetPosition = new Vector3(_positions.x, hight, _positions.z);// 目标位置为当前顶点坐标
|
||||||
float _distance = Vector3.Distance(transform.position, targetPosition);
|
float _distance = Vector3.Distance(transform.position, targetPosition);
|
||||||
float _time = _distance / FireSpeed;
|
float _time = _distance / float.Parse(maximumFlyingSpeed);
|
||||||
if (_positions.x != transform.position.x && _positions.z != transform.position.z)
|
if (_positions.x != transform.position.x && _positions.z != transform.position.z)
|
||||||
transform.LookAt(targetPosition);
|
transform.LookAt(targetPosition);
|
||||||
transform.DOMove(targetPosition, _time).SetEase(Ease.Linear);
|
transform.DOMove(targetPosition, _time).SetEase(Ease.Linear);
|
||||||
|
@ -1213,7 +1213,7 @@ public class UnmannedAerialVehicleManage : MonoBehaviour
|
||||||
|
|
||||||
Vector3 targetPosition = new Vector3(_positions.x, hight, _positions.z);// 目标位置为当前顶点坐标
|
Vector3 targetPosition = new Vector3(_positions.x, hight, _positions.z);// 目标位置为当前顶点坐标
|
||||||
float _distance = Vector3.Distance(transform.position, targetPosition);
|
float _distance = Vector3.Distance(transform.position, targetPosition);
|
||||||
float _time = _distance / FireSpeed;
|
float _time = _distance / float.Parse(maximumFlyingSpeed);
|
||||||
if (_positions.x != transform.position.x && _positions.z != transform.position.z)
|
if (_positions.x != transform.position.x && _positions.z != transform.position.z)
|
||||||
transform.LookAt(targetPosition);
|
transform.LookAt(targetPosition);
|
||||||
transform.DOMove(targetPosition, _time).SetEase(Ease.Linear);
|
transform.DOMove(targetPosition, _time).SetEase(Ease.Linear);
|
||||||
|
|
Loading…
Reference in New Issue