伴侣骑行

This commit is contained in:
lishuo committed 2021-04-15 10:13:01 +08:00
1 parent 34cde86a28
commit 7744eec847
42 files changed
+18737 -13497

No files matched your search

@@ -0,0 +1,32 @@
using Mapbox.Unity.Map;
using UnityEngine;
namespace Assets.Scenes.Ride.Scripts
{
public class MiniMapPlayerController: MonoBehaviour
{
private AbstractPlayer _player;
private AbstractMap _map;
private void Awake()
{
_map = transform.parent.Find("MiniMap").GetComponent<AbstractMap>();
}
public void SetController(AbstractPlayer player)
{
_player = player;
}
float t = 1f;
private void Update()
{
t -= Time.deltaTime;
while (t < 0)
{
if (_player != null)
{
transform.localPosition = _map.GeoToWorldPosition(_player.Nextlatlong);
}
t = 1;
}
}
}
}