public void SetOrAdd(ChatVote vote) { UserIdentifier userId = vote.GetUserInfo().UserID; UI_ParticipantVoteYesNo participant = GetParticipant(ref userId); if (participant == null) { participant = AddParticipant(vote.GetUserInfo()); } participant.SetChatVote(vote); m_voteDetected.Invoke(); }
private UI_ParticipantVoteYesNo AddParticipant(RestreamChatUser user) { GameObject created = Instantiate(m_prefab); created.transform.SetParent(m_whereToAdd); created.transform.localScale = Vector3.one; UI_ParticipantVoteYesNo participant = created.GetComponent <UI_ParticipantVoteYesNo>(); participant.SetChatVote(new ChatVote(user, ChatVoteType.NotVoted)); m_currentlyAvailable.Add(participant); return(participant); }