|
|
@ -77,13 +77,18 @@ namespace Fungus |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
public virtual void ClearLocalizeableCache() |
|
|
|
|
|
|
|
{ |
|
|
|
|
|
|
|
localizeableObjects.Clear(); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
// Build a cache of all the localizeable objects in the scene |
|
|
|
// Build a cache of all the localizeable objects in the scene |
|
|
|
protected virtual void CacheLocalizeableObjects() |
|
|
|
protected virtual void CacheLocalizeableObjects() |
|
|
|
{ |
|
|
|
{ |
|
|
|
Component[] components = GameObject.FindObjectsOfType<Component>(); |
|
|
|
UnityEngine.Object[] objects = Resources.FindObjectsOfTypeAll(typeof(Component)); |
|
|
|
foreach (Component component in components) |
|
|
|
foreach (UnityEngine.Object o in objects) |
|
|
|
{ |
|
|
|
{ |
|
|
|
ILocalizable localizable = component as ILocalizable; |
|
|
|
ILocalizable localizable = o as ILocalizable; |
|
|
|
if (localizable != null) |
|
|
|
if (localizable != null) |
|
|
|
{ |
|
|
|
{ |
|
|
|
localizeableObjects[localizable.GetStringId()] = localizable; |
|
|
|
localizeableObjects[localizable.GetStringId()] = localizable; |
|
|
@ -202,11 +207,11 @@ namespace Fungus |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
// Add everything else that's localizable |
|
|
|
// Add everything else that's localizable (including inactive objects) |
|
|
|
Component[] components = GameObject.FindObjectsOfType<Component>(); |
|
|
|
UnityEngine.Object[] objects = Resources.FindObjectsOfTypeAll(typeof(Component)); |
|
|
|
foreach (Component component in components) |
|
|
|
foreach (UnityEngine.Object o in objects) |
|
|
|
{ |
|
|
|
{ |
|
|
|
ILocalizable localizable = component as ILocalizable; |
|
|
|
ILocalizable localizable = o as ILocalizable; |
|
|
|
if (localizable != null) |
|
|
|
if (localizable != null) |
|
|
|
{ |
|
|
|
{ |
|
|
|
string stringId = localizable.GetStringId(); |
|
|
|
string stringId = localizable.GetStringId(); |
|
|
|