Пример #1
0
        private void AddSelfChat(ChatData newChat)
        {
            var chatItemView = _selfChatHistoryItemPool.Spawn();

            chatItemView.transform.SetAsLastSibling();
            chatItemView.Initialize(newChat);
        }
Пример #2
0
        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();
            }
        }
Пример #3
0
 public void Initialize(ChatData data)
 {
     chatMessage.text      = data.Message;
     chatReceivedTime.text = data.ReceivedTime.ToShortTimeString();
 }