summaryrefslogtreecommitdiff
path: root/Client/Assets/Scripts/XMainClient/BroadBarrageItem.cs
blob: 9f5a93c3b3c53ea4443decd2cd74457645181720 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
using System;
using UILib;
using UnityEngine;
using XUtliPoolLib;

namespace XMainClient
{
	public class BroadBarrageItem : MonoBehaviour
	{
		public IXUILabel m_lblContent;

		private IXUISprite m_sprRoot;

		private void Awake()
		{
			this.m_sprRoot = (base.GetComponent("XUISprite") as IXUISprite);
			this.m_lblContent = (base.transform.Find("content").GetComponent("XUILabel") as IXUILabel);
		}

		public void Refresh()
		{
		}

		public void Refresh(string nick, string content)
		{
			bool flag = this.m_lblContent != null && !string.IsNullOrEmpty(nick) && !string.IsNullOrEmpty(content);
			if (flag)
			{
				this.m_lblContent.SetText(XSingleton<XCommon>.singleton.StringCombine("[00ff00]", nick, "[-]: ", content));
				this.m_sprRoot.spriteHeight = 20 + this.m_lblContent.spriteHeight;
				this.m_lblContent.gameObject.transform.localPosition = new Vector3(-160f, (float)(this.m_sprRoot.spriteHeight / 2 - 4), 0f);
			}
		}
	}
}