- EventSystemChecker.cs
- Utility /
- Standard Assets /
- Assets /
- project /
1 using System;
2 using System.Collections;
3 using UnityEngine;
4 using UnityEngine.EventSystems;
5
6 public class EventSystemChecker : MonoBehaviour
7 {
8 //public GameObject eventSystem;
9
10 // Use this for initialization
11 void Awake ()
12 {
13 if(!FindObjectOfType<EventSystem>())
14 {
15 //Instantiate(eventSystem);
16 GameObject obj = new GameObject("EventSystem");
17 obj.AddComponent<EventSystem>();
18 obj.AddComponent<StandaloneInputModule>().forceModuleActive = true;
19 }
20 }
21 }
2 using System.Collections;
3 using UnityEngine;
4 using UnityEngine.EventSystems;
5
6 public class EventSystemChecker : MonoBehaviour
7 {
8 //public GameObject eventSystem;
9
10 // Use this for initialization
11 void Awake ()
12 {
13 if(!FindObjectOfType<EventSystem>())
14 {
15 //Instantiate(eventSystem);
16 GameObject obj = new GameObject("EventSystem");
17 obj.AddComponent<EventSystem>();
18 obj.AddComponent<StandaloneInputModule>().forceModuleActive = true;
19 }
20 }
21 }