Пример #1
0
    public void DoRegist_CompoLocalize(CUICompoLocalize pCompo)
    {
        string strKey = pCompo.name;

        if (_mapCompoLocalizeData.ContainsKey(strKey) == false)
        {
            _mapCompoLocalizeData.Add(strKey, new List <CUICompoLocalize>());
        }

        _mapCompoLocalizeData[strKey].Add(pCompo);
    }
Пример #2
0
    public void DoSet_Localize(SystemLanguage eLocalize)
    {
        if (_mapLocaleData.ContainsKey(eLocalize) == false)
        {
            Debug.LogWarning("_mapLocaleData 에 " + eLocalize + " 키가 없습니다.");
            return;
        }

        _eCurrentLocalize = eLocalize;

        _mapLocaleDataCurrent = _mapLocaleData[_eCurrentLocalize];
        IEnumerator <KeyValuePair <string, List <CUICompoLocalize> > > pIter = _mapCompoLocalizeData.GetEnumerator();

        while (pIter.MoveNext())
        {
            //bool bExistLabel = true;

            KeyValuePair <string, List <CUICompoLocalize> > pCurrent = pIter.Current;
            string strKey = pCurrent.Key;

            // 중복 로컬라이징 컴포넌트가 있을 수 있으므로 리스트로 변경후 세팅
            List <CUICompoLocalize> listValue = pCurrent.Value;
            if (_mapLocaleDataCurrent.ContainsKey(strKey))
            {
                int iCount = listValue.Count;
                for (int i = 0; i < iCount; i++)
                {
                    CUICompoLocalize pValueCurrent = listValue[i];
                    pValueCurrent.DoChangeText(DoGetCurrentLocalizeValue(strKey));
                    //if (pValueCurrent.p_pUILabel == null)
                    //{
                    //	pValueCurrent.EventOnAwake();
                    //	if (pValueCurrent.p_pUILabel == null)
                    //		bExistLabel = false;
                    //}

                    //if (bExistLabel)
                    //	pValueCurrent.DoChangeText(DoGetCurrentLocalizeValue(strKey));
                    //else
                    //	Debug.LogWarning("UILabel이 없다.." + pValueCurrent.name, pValueCurrent);
                }
            }
        }

        if (p_EVENT_OnChangeLocalize != null)
        {
            p_EVENT_OnChangeLocalize();
        }
    }