From 4108b7934035d552498246e0fa67a60b2a9375be Mon Sep 17 00:00:00 2001 From: Chris Langsenkamp Date: Wed, 5 Feb 2020 00:53:14 -0500 Subject: [PATCH] Code cleanup --- .../Examples/Chat/Scripts/ChatNetworkManager.cs | 11 ++--------- Assets/Mirror/Examples/Chat/Scripts/ChatWindow.cs | 4 ---- Assets/Mirror/Examples/Chat/Scripts/Player.cs | 3 --- 3 files changed, 2 insertions(+), 16 deletions(-) diff --git a/Assets/Mirror/Examples/Chat/Scripts/ChatNetworkManager.cs b/Assets/Mirror/Examples/Chat/Scripts/ChatNetworkManager.cs index 0b99932a7..3d3194929 100644 --- a/Assets/Mirror/Examples/Chat/Scripts/ChatNetworkManager.cs +++ b/Assets/Mirror/Examples/Chat/Scripts/ChatNetworkManager.cs @@ -1,8 +1,4 @@ -using System.Collections; -using System.Collections.Generic; using UnityEngine; -using Mirror; -using System; namespace Mirror.Examples.Chat { @@ -13,7 +9,7 @@ public class ChatNetworkManager : NetworkManager public void SetHostname(string hostname) { - this.networkAddress = hostname; + networkAddress = hostname; } public ChatWindow chatWindow; @@ -34,10 +30,7 @@ public override void OnClientConnect(NetworkConnection conn) base.OnClientConnect(conn); // tell the server to create a player with this name - conn.Send(new CreatePlayerMessage - { - name = playerName - }); + conn.Send(new CreatePlayerMessage { name = playerName }); } private void OnCreatePlayer(NetworkConnection connection, CreatePlayerMessage createPlayerMessage) diff --git a/Assets/Mirror/Examples/Chat/Scripts/ChatWindow.cs b/Assets/Mirror/Examples/Chat/Scripts/ChatWindow.cs index bd0fdfd8c..2752cbd35 100644 --- a/Assets/Mirror/Examples/Chat/Scripts/ChatWindow.cs +++ b/Assets/Mirror/Examples/Chat/Scripts/ChatWindow.cs @@ -1,6 +1,4 @@ -using System; using System.Collections; -using System.Collections.Generic; using UnityEngine; using UnityEngine.UI; @@ -14,9 +12,7 @@ public class ChatWindow : MonoBehaviour public void Awake() { - Player.OnMessage += OnPlayerMessage; - } private void OnPlayerMessage(Player player, string message) diff --git a/Assets/Mirror/Examples/Chat/Scripts/Player.cs b/Assets/Mirror/Examples/Chat/Scripts/Player.cs index 060f8d657..3aa0d2f2b 100644 --- a/Assets/Mirror/Examples/Chat/Scripts/Player.cs +++ b/Assets/Mirror/Examples/Chat/Scripts/Player.cs @@ -1,7 +1,4 @@ using System; -using System.Collections; -using System.Collections.Generic; -using UnityEngine; namespace Mirror.Examples.Chat {