ND_SimulationAutomaticControl/Assets/Scripts/UI/UIBase/UI_Comment.cs

44 lines
1015 B
C#

using System;
using System.Collections;
using System.Collections.Generic;
using TMPro;
using UnityEngine;
public class UI_Comment : BaseItem
{
public TextMeshProUGUI UserText; //用户名
public TextMeshProUGUI timetext; //时间
public TextMeshProUGUI CommentText; //内容
protected override void Awake()
{
base.Awake();
OnInit();
}
private void OnInit()
{
UserText = GetControl<TextMeshProUGUI>("用户名");
timetext = GetControl<TextMeshProUGUI>("时间");
CommentText = GetControl<TextMeshProUGUI>("内容");
}
public void Init(string UserNameDate,string TimeDate,string CommentDate)
{
UserText.text = UserNameDate;
timetext.text = TimeDate;
CommentText.text = CommentDate;
}
public override void ShowMe()
{
base.ShowMe();
DateTime now = DateTime.Now;
timetext.text = now.ToString("yyyy-MM-dd");;
}
public override void HideMe()
{
base.HideMe();
}
}