public void disPlayDialog(ChatClient.Conversation conversation) { if (currentChat != null && currentChat != conversation.toggle) { currentChat.toggle.isOn = false; } conversation.toggle.toggle.isOn = true; currentChat = conversation.toggle; }
public Conversation(TcpClient c, ChatClient _chatClient) { UICreated = false; // tcpClient = c; // stream = c.GetStream(); userItem = null; chatClient = _chatClient; dialog = null; toggle = null; }
public Conversation(TcpClient c, string _remoteName, ushort _remotePort, ChatClient _chatClient) { UICreated = false; // tcpClient = c; remoteName = _remoteName; remotePort = _remotePort; userItem = null; chatClient = _chatClient; dialog = null; toggle = null; }
public void createDialog(ChatClient.Conversation conversation) { //Create toggle for a conversation GameObject newtoggle = (GameObject)GameObject.Instantiate(TogglePrefab); newtoggle.transform.SetParent(toggleGroup.transform); newtoggle.SetActive(true); toggleControl newToggleControl = newtoggle.GetComponent <toggleControl>(); conversation.toggle = newToggleControl; //Create Dialog for a conversation GameObject newdialog = (GameObject)GameObject.Instantiate(DialogPrefab); RectTransform newRect = newdialog.GetComponent <RectTransform>(); newdialog.transform.SetParent(chatPage.transform); newRect.localPosition = DialogStartPosition.localPosition; conversation.dialog = newdialog.GetComponent <DialogControl>(); conversation.dialog.SetUp(conversation); newToggleControl.SetUp(conversation.remoteName, conversation, this); disPlayDialog(conversation); }
// Use this for initialization void Start() { currentChat = null; }