コード例 #1
0
        public DictionaryInfo SetGTextByCode(string Owner, string Block, string code)
        {
            string pjblock = Utility.Text.Format("{0}{1}", Owner, Block);

            DictionaryInfo dictionaryInfo = RefreshGTextInfo(pjblock, code);

            return(RefreshGTextInfo(pjblock, code));
        }
コード例 #2
0
ファイル: FBlockInfo.cs プロジェクト: wangjie0707/Temp_01
 public void UpdateDicInfo(DictionaryInfo dictionaryInfo)
 {
     if (Dictionary.ContainsKey(dictionaryInfo.Key))
     {
         Dictionary[dictionaryInfo.Key] = dictionaryInfo;
     }
     else
     {
         Dictionary.Add(dictionaryInfo.Key, dictionaryInfo);
     }
 }
コード例 #3
0
        public DictionaryInfo GetGtextInfo(string pjblock, string key)
        {
            FBlockInfo fBlockInfo = null;

            DictionaryInfo dictionaryInfo = null;

            if (BlockInfoDic.TryGetValue(pjblock, out fBlockInfo))
            {
                if (fBlockInfo.Dictionary.TryGetValue(key, out dictionaryInfo))
                {
                    return(dictionaryInfo);
                }
            }

            return(null);
        }
コード例 #4
0
        public void SetGRichTextByCode(GRichTextField gTextField, string code)
        {
            string pjblock = Utility.Text.Format("{0}{1}", gTextField.Owner, gTextField.Block);

            DictionaryInfo dictionaryInfo = RefreshGTextInfo(pjblock, code);

            if (dictionaryInfo != null)
            {
                gTextField.text = dictionaryInfo.Value;
                if (dictionaryInfo.Size > 0)
                {
                    gTextField.textFormat.size = dictionaryInfo.Size;
                }

                if (dictionaryInfo.NewLine)
                {
                    gTextField.text = gTextField.text.Replace("**", System.Environment.NewLine);
                }
            }
        }
コード例 #5
0
        /// <summary>
        /// 注册字体组件到多语言
        /// </summary>
        /// <param name="gTextInput">GTextInput</param>
        public void RegToLocalization(GTextInput gTextInput)
        {
            string pjblock = Utility.Text.Format("{0}{1}", gTextInput.Owner, gTextInput.Block);

            DictionaryInfo dictionaryInfo = RefreshGTextInfo(pjblock, gTextInput.key);

            if (dictionaryInfo != null)
            {
                gTextInput.promptText = dictionaryInfo.Value;
                if (dictionaryInfo.Size > 0)
                {
                    gTextInput.textFormat.size = dictionaryInfo.Size;
                }

                if (dictionaryInfo.NewLine)
                {
                    gTextInput.text = gTextInput.text.Replace("**", System.Environment.NewLine);
                }
            }
        }