界面微调,设备连接中断跳时间bug修复
This commit is contained in:
1 parent
f1eeb11543
commit
7ba012f5f2
20 files changed
+3763
-3334
No files matched your search
@@ -23,6 +23,7 @@ namespace Assets.Scenes.Ride.Scripts
|
||||
public PlayerController playerController;
|
||||
GameObject _mipMapRoute;
|
||||
public RectTransform RectRoot;//rawImage
|
||||
TrailRenderer trail;
|
||||
void Start()
|
||||
{
|
||||
cyclingCotroller = FindObjectOfType<CyclingController>();
|
||||
@@ -44,7 +45,13 @@ namespace Assets.Scenes.Ride.Scripts
|
||||
}
|
||||
RectRoot = transform.parent.Find("SingleUI/Panel/MiniMap/MiniMap").GetComponent<RectTransform>();
|
||||
}
|
||||
}
|
||||
|
||||
trail = transform.parent.Find("Sphere").GetComponent<TrailRenderer>();
|
||||
trail.startWidth = 5f;
|
||||
trail.endWidth = 5f;
|
||||
trail.startColor = new Color(0.9764706f, 0.1882353f, 0.5254902f, 1f);
|
||||
trail.endColor = new Color(0.9764706f, 0.1882353f, 0.5254902f, 1f);
|
||||
}
|
||||
float timer = 0;
|
||||
private void Update()
|
||||
{
|
||||
@@ -52,9 +59,12 @@ namespace Assets.Scenes.Ride.Scripts
|
||||
{
|
||||
var tr = transform.parent.Find("SingleUI/Panel/MiniMap/MiniMap/arrow");
|
||||
tr.SetSiblingIndex(9999);
|
||||
_player.transform.localPosition = _map.GeoToWorldPosition(playerController.Currentlatlong);
|
||||
var pos = _map.GeoToWorldPosition(playerController.Currentlatlong);
|
||||
pos.y += 15f;
|
||||
_player.transform.localPosition = pos;
|
||||
Vector2 vp2 = _minicamera.WorldToViewportPoint(_player.transform.localPosition);//将三维物体的世界坐标转换为视口坐标
|
||||
((RectTransform)tr.transform).anchoredPosition = new Vector2((vp2.x * RectRoot.sizeDelta.x) - (RectRoot.sizeDelta.x * 0.5f), (vp2.y * RectRoot.sizeDelta.y) - (RectRoot.sizeDelta.y * 0.5f));
|
||||
trail.enabled = playerController.GetStart();
|
||||
}
|
||||
timer += Time.deltaTime;
|
||||
|
||||
@@ -81,7 +91,7 @@ namespace Assets.Scenes.Ride.Scripts
|
||||
var point = mapData.List[i].Point;
|
||||
Vector3 item = _map.GeoToWorldPosition(new Vector2d(point[0], point[1]));
|
||||
item.y += 5f;
|
||||
if (playerController.CurrentIndex >= i-1)
|
||||
if (playerController.CurrentIndex >= i)
|
||||
{
|
||||
dat.Add(item);
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user