Example #1
0
        public virtual void ChangeLanguage()
        {
            string lgg = Global.gApp.gSystemMgr.GetMiscMgr().Language;

            if (lgg == null || lgg.Equals(GameConstVal.EmepyStr))
            {
                lgg = UiTools.GetLanguage();
            }
            if (!lgg.Equals(m_Language))
            {
                m_Language = lgg;
                Text[] ts = gameObject.GetComponentsInChildren <Text>(true);
                foreach (Text t in ts)
                {
                    t.font = Global.gApp.gGameData.GetFont(lgg);
                    if (UiTools.IsNumeric(t.text))
                    {
                        continue;
                    }
                    LanguageTip lt = t.GetComponent <LanguageTip>();
                    if (lt != null)
                    {
                        //Debug.Log(t.text + " use tip = " + lt.TipId);
                        t.text = Global.gApp.gGameData.GetTipsInCurLanguage(lt.TipId);
                    }
                    else
                    {
                        //Debug.Log("text = " + t.text + ", don't add component LanguageTip");
                    }
                }
            }
        }
Example #2
0
    public override void OnInspectorGUI()
    {
        DrawDefaultInspector();
        LanguageTip tip = (LanguageTip)target;

        if (tip.mono == null)
        {
            keys  = tip.propertyInfos.Keys.ToArray();
            index = EditorGUILayout.Popup(index, keys);
            return;
        }
        tip.GetMonoProperties();
        keys        = tip.propertyInfos.Keys.ToArray();
        index       = EditorGUILayout.Popup(index, keys);
        tip.infokey = keys[index];
    }