伴侣骑行
This commit is contained in:
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;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in new issue
Block a user