private void AddSelfChat(ChatData newChat) { var chatItemView = _selfChatHistoryItemPool.Spawn(); chatItemView.transform.SetAsLastSibling(); chatItemView.Initialize(newChat); }
private void ResolveChat([NotNull] ChatData newChat) { if (newChat == null) { throw new ArgumentNullException(nameof(newChat)); } switch (newChat.ChatType) { case ChatType.Self: AddSelfChat(newChat); break; case ChatType.Other: AddOtherChat(newChat); break; default: throw new ArgumentOutOfRangeException(); } }
public void Initialize(ChatData data) { chatMessage.text = data.Message; chatReceivedTime.text = data.ReceivedTime.ToShortTimeString(); }