using System.Collections; using System.Collections.Generic; using UnityEngine; using UnityEngine.UI; using TMPro; public class MsgItem : MonoBehaviour { public Image headImage; public TMP_Text nameText; public string msgType; public FileItem fileItem; public List refreshFitter; public GameObject messageItem; public Text msgText; private FileConfig fileConfig; public void Init( Sprite headImage, string name , string message ) { if (headImage != null) this.headImage.sprite = headImage; nameText.text = name; this.fileItem.gameObject.SetActive(false); this.messageItem.SetActive(true); msgText.text = message; StartCoroutine(Refresh()); } public void Init(Sprite headImage, FileConfig fileConfig) { this.fileConfig = fileConfig; fileItem.Init(fileConfig); nameText.text = fileConfig.From; if (headImage != null) this.headImage.sprite = headImage; } private IEnumerator Refresh() { int i = 0; while(i()); } } }