using UnityEngine;
using UnityEngine.EventSystems;

public class EventRemoval : MonoBehaviour
{
    void Awake()
    {
        EventSystem[] eventSystems = FindObjectsOfType<EventSystem>();

        // If there's more than one EventSystem in the scene, remove the extras.
        if (eventSystems.Length > 1)
        {
            for (int i = 1; i < eventSystems.Length; i++) // Start from 1 to keep the first one.
            {
                Destroy(eventSystems[i].gameObject);
            }
        }
    }
}