using System.Collections;
using System.Collections.Generic;
using System.Linq; 
using UnityEngine; 

public class InteractibleManager : MonoBehaviour
{

    private List<InteractableObject> interactableObjects = new List<InteractableObject>(); 

    private static InteractibleManager instance; 
    public static InteractibleManager Instance
    {
        get
        {
            return instance;
        }
    }

    public void Awake()
    {
        instance = this; 
    }

    public InteractableObject[] GetAvailableInteractables(Vector3 position)
    {
        return interactableObjects.Where(x => (x.transform.position - position).magnitude < 3.0f).ToArray(); 
    }

    public void Register(InteractableObject i)
    {
        interactableObjects.Add(i); 
    }

}