|
|
|
@ -51,18 +51,16 @@ namespace Fungus
|
|
|
|
|
protected virtual void Awake() |
|
|
|
|
{ |
|
|
|
|
writer = GetComponent<Writer>(); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
protected virtual void Update() |
|
|
|
|
{ |
|
|
|
|
if (EventSystem.current == null) |
|
|
|
|
{ |
|
|
|
|
return; |
|
|
|
|
CheckEventSystem(); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
if (currentStandaloneInputModule == null) |
|
|
|
|
// There must be an Event System in the scene for Say and Menu input to work. |
|
|
|
|
// This method will automatically instantiate one if none exists. |
|
|
|
|
protected virtual void CheckEventSystem() |
|
|
|
|
{ |
|
|
|
|
if (EventSystem.current == null) |
|
|
|
|
EventSystem eventSystem = GameObject.FindObjectOfType<EventSystem>(); |
|
|
|
|
if (eventSystem == null) |
|
|
|
|
{ |
|
|
|
|
// Auto spawn an Event System from the prefab |
|
|
|
|
GameObject prefab = Resources.Load<GameObject>("Prefabs/EventSystem"); |
|
|
|
@ -72,7 +70,17 @@ namespace Fungus
|
|
|
|
|
go.name = "EventSystem"; |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
protected virtual void Update() |
|
|
|
|
{ |
|
|
|
|
if (EventSystem.current == null) |
|
|
|
|
{ |
|
|
|
|
return; |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
if (currentStandaloneInputModule == null) |
|
|
|
|
{ |
|
|
|
|
currentStandaloneInputModule = EventSystem.current.GetComponent<StandaloneInputModule>(); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|