public NetworkChatMessage(string senderGuid, string text, DateTime timeStamp, NetworkChatMessageType type) { this.senderGuid = senderGuid; NetworkPlayerData playerData = NetworkCenter.Instance.GetPlayerData(senderGuid); this.senderName = playerData == null ? string.Empty : playerData.playerName; this.text = text; this.timeStamp = timeStamp; this.type = type; }
private void AddTextMessage(string text, string playerGuid, NetworkChatMessageType type) { NetworkChatMessage message = new NetworkChatMessage(playerGuid, text, DateTime.Now, type); chatHistory.Enqueue(message); if (onMessageReceivedDelegate != null) { onMessageReceivedDelegate(message); } }