示例#1
0
文件: lwf_core.cs 项目: ufosky/lwf
        public void SetText(string textName, string text)
        {
            TextDictionaryItem item;

            if (!m_textDictionary.TryGetValue(textName, out item))
            {
                m_textDictionary[textName] = new TextDictionaryItem(text);
            }
            else
            {
                if (item.renderer != null)
                {
                    item.renderer.SetText(text);
                }
                item.text = text;
            }
        }
示例#2
0
文件: lwf_core.cs 项目: ufosky/lwf
        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);
            }
        }
示例#3
0
文件: lwf_core.cs 项目: yonekawa/lwf
        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);
        }
示例#4
0
文件: lwf_core.cs 项目: yonekawa/lwf
 public void SetText(string textName, string text)
 {
     TextDictionaryItem item;
     if (!m_textDictionary.TryGetValue(textName, out item)) {
     m_textDictionary[textName] = new TextDictionaryItem(text);
     } else {
     if (item.renderer != null)
         item.renderer.SetText(text);
     item.text = text;
     }
 }