using UnityEngine;

public sealed class ObjectSelectionMarker : MonoBehaviour
{
    [SerializeField]
    private Transform[] elements = null;
    [SerializeField]
    private float itemsRadius = 0.2f;
    [SerializeField]
    private float angleBetweenElements = 90;
    public void Show(Vector3 position, float radius)
    {
        transform.position = position;
        var fullRadius = itemsRadius + radius;
        for (int i = 0; i < elements.Length; i++) {
            var direction = Quaternion.Euler(0, 0, angleBetweenElements * i) * Vector3.up * fullRadius;
            elements[i].localPosition = direction;
        }
        gameObject.SetActive(true);
    }
    public void Hide()
    {
        gameObject.SetActive(false);
    }
}
