Exemple #1
0
        private void Update()
        {
            var dir          = Minimap.GetPositionInMap(image.rectTransform.position + Vector3.forward) - Minimap.GetPositionInMap(image.rectTransform.position);
            var angle        = Mathf.Atan2(dir.y, dir.x) * Mathf.Rad2Deg;
            var lookRotation = Quaternion.AngleAxis(angle - 90, Vector3.forward);

            image.rectTransform.rotation = lookRotation;

            image.rectTransform.localPosition = Minimap.GetPositionInMap(resurrectionTombstone.transform);
        }