diff options
Diffstat (limited to 'Thronefall_1_57/Decompile/I2.Loc/CustomLocalizeCallback.cs')
| -rw-r--r-- | Thronefall_1_57/Decompile/I2.Loc/CustomLocalizeCallback.cs | 26 |
1 files changed, 26 insertions, 0 deletions
diff --git a/Thronefall_1_57/Decompile/I2.Loc/CustomLocalizeCallback.cs b/Thronefall_1_57/Decompile/I2.Loc/CustomLocalizeCallback.cs new file mode 100644 index 0000000..d308920 --- /dev/null +++ b/Thronefall_1_57/Decompile/I2.Loc/CustomLocalizeCallback.cs @@ -0,0 +1,26 @@ +using UnityEngine; +using UnityEngine.Events; + +namespace I2.Loc; + +[AddComponentMenu("I2/Localization/I2 Localize Callback")] +public class CustomLocalizeCallback : MonoBehaviour +{ + public UnityEvent _OnLocalize = new UnityEvent(); + + public void OnEnable() + { + LocalizationManager.OnLocalizeEvent -= OnLocalize; + LocalizationManager.OnLocalizeEvent += OnLocalize; + } + + public void OnDisable() + { + LocalizationManager.OnLocalizeEvent -= OnLocalize; + } + + public void OnLocalize() + { + _OnLocalize.Invoke(); + } +} |
