Skip to content

Instantly share code, notes, and snippets.

@daniele-quero
Created February 6, 2023 14:40
Show Gist options
  • Save daniele-quero/a7ca33eb1544535964bc37efa8aa837b to your computer and use it in GitHub Desktop.
Save daniele-quero/a7ca33eb1544535964bc37efa8aa837b to your computer and use it in GitHub Desktop.
private Image _mapImage;
private Vector3 _mapPos = Vector3.zero;
private Vector3 _elemPos = Vector3.zero;
void Update()
{
_mapPos.x = _player.transform.position.x;
_mapPos.y = _player.transform.position.z;
_mapImage.rectTransform.localPosition = -_mapPos;
foreach (var o in _images.Keys)
{
_elemPos.x = o.position.x;
_elemPos.y = o.position.z;
_images[o].localPosition = _elemPos;
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment