private void onElementHidden(int index, GameObject element) { FullScreenChatBlock component = element.GetComponent <FullScreenChatBlock>(); component.EnablePreloader(); component.OnClicked = (Action <long>)Delegate.Remove(component.OnClicked, new Action <long>(onFullScreenChatBlockClicked)); }
private void onImageReady(DataEntityHandle handle, Texture2D icon) { long sessionId = dataEntityCollection.GetComponent <SessionIdData>(handle).SessionId; for (int i = 0; i < fullScreenChatBlockDataList.Count; i++) { if (fullScreenChatBlockDataList[i].SessionId == sessionId && layoutElementPool.IsElementVisible(i)) { GameObject elementAtIndex = layoutElementPool.GetElementAtIndex(i); FullScreenChatBlock component = elementAtIndex.GetComponent <FullScreenChatBlock>(); component.SetIcon(icon); } } imageRequests.Dequeue(); }
private void onElementShown(int index, GameObject element) { FullScreenChatBlock component = element.GetComponent <FullScreenChatBlock>(); component.SessionId = fullScreenChatBlockDataList[index].SessionId; component.SetChatMessage(fullScreenChatBlockDataList[index].DisplayName, fullScreenChatBlockDataList[index].Message, fullScreenChatBlockDataList[index].IsChatActivity, fullScreenChatBlockDataList[index].IsAwatingModeration, fullScreenChatBlockDataList[index].IsChatBlocked); component.OnClicked = (Action <long>)Delegate.Combine(component.OnClicked, new Action <long>(onFullScreenChatBlockClicked)); if (!imageRequests.Contains(fullScreenChatBlockDataList[index].SessionId)) { DataEntityHandle handle = findPlayerHandle(fullScreenChatBlockDataList[index].SessionId); imageRequests.Enqueue(fullScreenChatBlockDataList[index].SessionId); AvatarAnimationFrame avatarAnimationFrame = new AvatarAnimationFrame("Base Layer.Idle", 0.5f); avatarImageComponent.RequestImage(handle, avatarAnimationFrame, "FullScreenChatAvatar"); } }