Esempio n. 1
0
    public virtual void SetLocalization()
    {
        localized = true;

        if (FastMoveBtn != null)
        {
            FastMoveBtn.Switch(GameManager.FastStoneMove);
        }
        if (FastBackMoveBtn != null)
        {
            if (GameManager.FastStoneMove)
            {
                FastBackMoveBtn.Switch(true);
            }

            else
            {
                FastBackMoveBtn.Switch(GameManager.FastStoneBackMove);
            }
        }


        TextMeshProUGUI[] children = RootPanel.GetComponentsInChildren <TextMeshProUGUI>(true);
        foreach (var t in children)
        {
            if (t != null)
            {
                string newText = null;

                if (t.GetType() == typeof(LocalizableText))
                {
                    LocalizableText lc = t as LocalizableText;

                    newText = getLocal(lc.Key, lc.text);
                }
                else
                {
                    newText = getLocal(t.name, t.text);
                }

                if (t.transform.GetComponentInParent <TextSwitching>() != null)
                {
                    t.transform.GetComponentInParent <TextSwitching>().Localize();
                    continue;
                }
                if (newText != null)
                {
                    t.text = newText;
                }
            }
        }
    }
Esempio n. 2
0
 public void SwitchLanguage(Object b)
 {
     LocalizationManager.Instance.SwitchLanguage();
     if (b != null)
     {
         GameObject sender = b as GameObject;
         if (sender != null)
         {
             UIElemSwitchValue uIElemSwitch = sender.GetComponent <UIElemSwitchValue>();
             uIElemSwitch.Switch();
         }
     }
 }
Esempio n. 3
0
 public void FastStoneBackMove(Object b)
 {
     if (GameManager.FastStoneMove)
     {
         return;
     }
     GameManager.Instance.SetFastBackMove();
     if (b != null)
     {
         GameObject sender = b as GameObject;
         if (sender != null)
         {
             UIElemSwitchValue uIElemSwitch = sender.GetComponent <UIElemSwitchValue>();
             uIElemSwitch.Switch(GameManager.FastStoneBackMove);
         }
     }
 }