コード例 #1
0
 private new void Awake()
 {
     _ownerPool = scrollViewContent.gameObject.AddComponent <MessageViewsPool>();
     _ownerPool.Create(ownerMessagePrefab, 50);
     _usualPool = scrollViewContent.gameObject.AddComponent <MessageViewsPool>();
     _usualPool.Create(usualMessagePrefab, 50);
     base.Awake();
 }
コード例 #2
0
        private void AddMessage <T>(T messageData, MessageViewsPool pool) where T : ChatMessage
        {
            var messageView = pool.GetChatView();

            messageView.FillWithInfo(messageData);
            messageView.onRemoveButtonClickEvent.AddListener(() => { DeleteMessageCall.Invoke(messageData.Id); });
            messageView.ShowWithAnimation();
            MessageViews.Add(messageView);
            CheckMessagesBlock(MessageViews.IndexOf(messageView));
            messageView.transform.SetAsLastSibling();
        }
コード例 #3
0
 public void LinkToPool(MessageViewsPool pool)
 {
     Pool = pool;
 }