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("用户名"); timetext = GetControl("时间"); CommentText = GetControl("内容"); } 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(); } }