I'm writing a Unity editor script and need to make sure that an (UI) Event System exists so I want to create one if it's not already there. But the EventSystem
class and StandaloneInputModule
class can nowhere be found when trying to import it to a script. What's the matter with this? I can't find any other info on this matter either.
When you add an UI item, the EventSystem object is automatically added. Just drag it into your Project to make it a prefab so you can use it to be instantiated just like any game object.
public GameObject eventPrefab;
void Start(){
if(GameObject.Find("EventSystem") == null){
Instantiate(eventPrefab);
}
}