Exemple #1
0
        public void SetTextRenderer(string fullPath,
		string textName, string text, TextRenderer textRenderer)
        {
            bool setText = false;
            string fullName = fullPath + "." + textName;
            TextDictionaryItem item;
            if (m_textDictionary.TryGetValue(fullName, out item)) {
            item.renderer = textRenderer;
            if (!String.IsNullOrEmpty(item.text)) {
                textRenderer.SetText(item.text);
                setText = true;
            }
            } else {
            m_textDictionary[fullName] =
                new TextDictionaryItem(text, textRenderer);
            }

            if (m_textDictionary.TryGetValue(textName, out item)) {
            item.renderer = textRenderer;
            if (!setText && !String.IsNullOrEmpty(item.text)) {
                textRenderer.SetText(item.text);
                setText = true;
            }
            } else {
            m_textDictionary[textName] =
                new TextDictionaryItem(text, textRenderer);
            }

            if (!setText)
            textRenderer.SetText(text);
        }
Exemple #2
0
 public TextDictionaryItem(string t, TextRenderer r)
 {
     text = t;
     renderer = r;
 }