|
|
@ -87,14 +87,6 @@ namespace Fungus |
|
|
|
protected StringSubstituter stringSubstituer; |
|
|
|
protected StringSubstituter stringSubstituer; |
|
|
|
|
|
|
|
|
|
|
|
#if UNITY_5_4_OR_NEWER |
|
|
|
#if UNITY_5_4_OR_NEWER |
|
|
|
protected virtual void Awake() |
|
|
|
|
|
|
|
{ |
|
|
|
|
|
|
|
CheckEventSystem(); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
UnityEngine.SceneManagement.SceneManager.activeSceneChanged += (A, B) => { |
|
|
|
|
|
|
|
LevelWasLoaded(); |
|
|
|
|
|
|
|
}; |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
#else |
|
|
|
#else |
|
|
|
protected virtual void OnLevelWasLoaded(int level) |
|
|
|
protected virtual void OnLevelWasLoaded(int level) |
|
|
|
{ |
|
|
|
{ |
|
|
@ -137,11 +129,20 @@ namespace Fungus |
|
|
|
eventSystemPresent = true; |
|
|
|
eventSystemPresent = true; |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
private void SceneManager_activeSceneChanged(UnityEngine.SceneManagement.Scene arg0, UnityEngine.SceneManagement.Scene arg1) |
|
|
|
|
|
|
|
{ |
|
|
|
|
|
|
|
LevelWasLoaded(); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
protected virtual void OnEnable() |
|
|
|
protected virtual void OnEnable() |
|
|
|
{ |
|
|
|
{ |
|
|
|
if (!cachedFlowcharts.Contains(this)) |
|
|
|
if (!cachedFlowcharts.Contains(this)) |
|
|
|
{ |
|
|
|
{ |
|
|
|
cachedFlowcharts.Add(this); |
|
|
|
cachedFlowcharts.Add(this); |
|
|
|
|
|
|
|
//TODO these pairs could be replaced by something static that manages all active flowcharts |
|
|
|
|
|
|
|
#if UNITY_5_4_OR_NEWER |
|
|
|
|
|
|
|
UnityEngine.SceneManagement.SceneManager.activeSceneChanged += SceneManager_activeSceneChanged; |
|
|
|
|
|
|
|
#endif |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
CheckItemIds(); |
|
|
|
CheckItemIds(); |
|
|
@ -155,6 +156,10 @@ namespace Fungus |
|
|
|
{ |
|
|
|
{ |
|
|
|
cachedFlowcharts.Remove(this); |
|
|
|
cachedFlowcharts.Remove(this); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
#if UNITY_5_4_OR_NEWER |
|
|
|
|
|
|
|
UnityEngine.SceneManagement.SceneManager.activeSceneChanged -= SceneManager_activeSceneChanged; |
|
|
|
|
|
|
|
#endif |
|
|
|
|
|
|
|
|
|
|
|
StringSubstituter.UnregisterHandler(this); |
|
|
|
StringSubstituter.UnregisterHandler(this); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|