summaryrefslogtreecommitdiff
path: root/Client/Assets/Scripts/XMainClient/UI/PartnerLivenessRecordItem.cs
blob: 3f336f3cf391ff913ffca50ff484b8180a408fa5 (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
36
37
38
39
40
41
using System;
using UILib;
using UnityEngine;

namespace XMainClient.UI
{
	public class PartnerLivenessRecordItem : MonoBehaviour
	{
		public IXUILabel m_nameLab;

		public IXUILabel m_timeLab;

		public IXUILabel m_contentLab;

		private IXUISprite m_sprRoot;

		private IXUISprite m_bgSpr;

		private void Awake()
		{
			this.m_sprRoot = (base.GetComponent("XUISprite") as IXUISprite);
			this.m_bgSpr = (base.transform.Find("Bg").GetComponent("XUISprite") as IXUISprite);
			this.m_nameLab = (base.transform.Find("Bg/Name").GetComponent("XUILabel") as IXUILabel);
			this.m_timeLab = (base.transform.Find("Bg/Time").GetComponent("XUILabel") as IXUILabel);
			this.m_contentLab = (base.transform.Find("Bg/Description").GetComponent("XUILabel") as IXUILabel);
		}

		public void Refresh(PartnerLivenessRecord record)
		{
			bool flag = record == null;
			if (!flag)
			{
				this.m_nameLab.SetText(record.Name);
				this.m_timeLab.SetText(record.ShowTimeStr);
				this.m_contentLab.SetText(record.ShowString);
				this.m_sprRoot.spriteHeight = 46 + this.m_contentLab.spriteHeight;
				this.m_bgSpr.spriteHeight = this.m_sprRoot.spriteHeight;
			}
		}
	}
}