细节调整

线路材质&位置调整,海拔图区间优化,loading动画只执行一次问题解决,小地图的球替换成圆形图片
This commit is contained in:
lishuo committed 2021-05-14 16:11:22 +08:00
1 parent e29381b13b
commit eb70ee4397
13 files changed
+3306 -3076

No files matched your search

@@ -7,9 +7,16 @@ namespace Assets.Scenes.Ride.Scripts
{
private AbstractPlayer _player;
private AbstractMap _map;
RectTransform RectRoot;
GameObject arrow;
Camera _minicamera;
private void Awake()
{
_map = transform.parent.Find("MiniMap").GetComponent<AbstractMap>();
_minicamera = transform.parent.Find("MiniCamera").GetComponent<Camera>();
RectRoot = transform.parent.Find("SingleUI/Panel/MiniMap/MiniMap").GetComponent<RectTransform>();
var parent = transform.parent.Find("SingleUI/Panel/MiniMap/MiniMap");
arrow = Instantiate(Resources.Load<GameObject>("UI/Prefab/Ride/MiniArrow"), parent);
}
public void SetController(AbstractPlayer player)
{
@@ -24,6 +31,9 @@ namespace Assets.Scenes.Ride.Scripts
if (_player != null)
{
transform.localPosition = _map.GeoToWorldPosition(_player.Currentlatlong);
var tr = arrow.GetComponent<RectTransform>();
Vector2 vp2 = _minicamera.WorldToViewportPoint(transform.localPosition);//将三维物体的世界坐标转换为视口坐标
tr.anchoredPosition = new Vector2((vp2.x * RectRoot.sizeDelta.x) - (RectRoot.sizeDelta.x * 0.5f), (vp2.y * RectRoot.sizeDelta.y) - (RectRoot.sizeDelta.y * 0.5f));
}
t = 1;
}