hellbound/Assets/Sources/I2/Localization/Scripts/Utils/CustomLocalizeCallback.cs

27 lines
613 B
C#
Raw Permalink Normal View History

2021-11-26 11:16:25 +03:00
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();
}
}
}