海拔图头像位移bug修复

This commit is contained in:
lishuo committed 2021-05-20 19:56:17 +08:00
1 parent 7ba012f5f2
commit fdf33ba8df
3 files changed
+16 -5

No files matched your search

@@ -77,6 +77,10 @@ namespace Assets.Scenes.Ride.Scripts
break;
}
}
if (endistance > mapDataModel.TotalDistance)
{
onIndex = pointList.Count-2;
}
return onIndex;
}
@@ -87,8 +91,9 @@ namespace Assets.Scenes.Ride.Scripts
}
public void MoveHead(Transform parent)
{
var itemIndex = chartDataSourceScript.GetViewIndex(GetCurrentIndex(TotalDistance, mainController.GetMapData())) + 1;
var itemIndex = chartDataSourceScript.GetViewIndex(GetCurrentIndex(TotalDistance, mainController.GetMapData()))+1;
var m = graph.DataSource.GetPoint("Player 2", itemIndex);
Debug.Log(itemIndex.ToString() + "=" + TotalDistance.ToString());
graph.PointToWorldSpace(out Vector3 itemPosition, m.x, m.y, "Player 2");
itemPosition.x -= 12f;
itemPosition.y += 5f;
@@ -100,6 +105,10 @@ namespace Assets.Scenes.Ride.Scripts
headPanel.transform.localScale = new Vector3(0.8f, 0.8f, 0.8f);
headPanel.transform.position = itemPosition;
}
else
{
headPanel.transform.DOMove(new Vector3(itemPosition.x, itemPosition.y, 0), 1);
}
if (head == null)
{
head = headPanel.GetComponentInChildren<RawImage>();
@@ -113,7 +122,7 @@ namespace Assets.Scenes.Ride.Scripts
}
}
headPanel.transform.DOMove(new Vector3(itemPosition.x, itemPosition.y, 0), 1);
}
public void ShowInfoPanel(Vector3 playerScreenPos)