示例#1
0
    public void SendChatMessage()
    {
        var mes = new ChatMessage5();

        mes.Message         = _nameInput.text + ": " + _sendTextInput.text;
        _sendTextInput.text = "";
        _client.Send((short)MessageType.Message, mes);
    }
示例#2
0
    private void OnClientDisconnected(NetworkMessage netMes)
    {
        var mes = new ChatMessage5();

        mes.Message = "Player " + netMes.conn.connectionId + " disconnected.";
        AddMessageToChat(mes.Message);
        NetworkServer.SendToAll((short)MessageType.Message, mes);
    }
示例#3
0
    public void SendChatMessage()
    {
        var mes = new ChatMessage5();

        mes.Message = "[Server] " + _sendTextInput.text;
        AddMessageToChat(mes.Message);
        _sendTextInput.text = string.Empty;
        NetworkServer.SendToAll((short)MessageType.Message, mes);
    }