/// <summary> /// /// </summary> void Awake() { ClientName = string.Empty; ChatUI = FindObjectOfType <bl_ChatUI>(); ChatUI.MaxMessages = MaxMessages; ChatUI.ShowChat(false); ChatUI.ShowPlayerNameUI(true); }
/// <summary> /// /// </summary> void Awake() { ClientName = string.Empty; ChatUI = FindObjectOfType <bl_ChatUI>(); ChatUI.MaxMessages = MaxMessages; ChatUI.ShowChat(false); //Changed from false below so that disconnect from server allows player to rejoin the chat upon re-entering game ChatUI.ShowPlayerNameUI(false); }
/// <summary> /// /// </summary> /// <param name="netMsg"></param> public void OnConnected(NetworkMessage netMsg) { //if client and name is not setup yet, then show the inputfild if (string.IsNullOrEmpty(ClientName) && Client.isConnected && ShowPlayerNameInput) { // GetComponent<RectTransform>().anchoredPosition = Vector2.zero; // GetComponent<RectTransform>().sizeDelta = Vector2.zero; ChatUI.ShowPlayerNameUI(false); ClientName = "Anonymous"; } else if (Client.isConnected)//if name already setup { ChatUI.ShowPlayerNameUI(false); ChatUI.ShowChat(true); if (string.IsNullOrEmpty(ClientName)) { ClientName = "Anonymous"; Client.RegisterHandler(MyMsgType.ChatMsn, OnChatMessage); } } }