Beispiel #1
0
    public void OnLocalize()
    {
#if UNITY_EDITOR
        var flags = text != null ? text.hideFlags : HideFlags.None;
        if (text != null)
        {
            text.hideFlags = HideFlags.DontSave;
        }
#endif
        if (parameters != null && parameters.Count > 0)
        {
            SetText(text, MultiLanguage.GetFormat(key, parameters.ToArray()));
        }
        else
        {
            SetText(text, MultiLanguage.Get(key));
        }

        var direction = MultiLanguage.Instance.SelectedLanguageDirection;

        if (text != null && !maintainTextAlignment)
        {
            UpdateAlignment(text, direction);
        }

#if UNITY_EDITOR
        if (text != null)
        {
            text.hideFlags = flags;
        }
#endif
    }