added comments and organized project files
This commit is contained in:
14
Assets/Scripts/Game/EventSystemizer.cs
Normal file
14
Assets/Scripts/Game/EventSystemizer.cs
Normal file
@@ -0,0 +1,14 @@
|
||||
using UnityEngine;
|
||||
using UnityEngine.EventSystems;
|
||||
|
||||
public class EventSystemizer : MonoBehaviour
|
||||
{
|
||||
private void Update() // Ensures only one instance of EventSystem exists
|
||||
{
|
||||
foreach (EventSystem system in FindObjectsByType<EventSystem>(FindObjectsSortMode.None))
|
||||
{
|
||||
if (system == GetComponent<EventSystem>()) continue;
|
||||
Destroy(system.gameObject);
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user