diff --git a/Assets/Mirror/Tests/Performance/Runtime/ULocalConnectionPerformance.cs b/Assets/Mirror/Tests/Performance/Runtime/ULocalConnectionPerformance.cs index 70be227f1..057df7225 100644 --- a/Assets/Mirror/Tests/Performance/Runtime/ULocalConnectionPerformance.cs +++ b/Assets/Mirror/Tests/Performance/Runtime/ULocalConnectionPerformance.cs @@ -13,7 +13,9 @@ class NetworkManagerTest : NetworkManager public override void Awake() { transport = gameObject.AddComponent(); - playerPrefab = new GameObject("testPlayerPrefab", typeof(NetworkIdentity)); + playerPrefab = new GameObject(); + NetworkIdentity identity = playerPrefab.AddComponent(); + identity.assetId = System.Guid.NewGuid(); base.Awake(); } public override void OnDestroy() @@ -45,6 +47,16 @@ IEnumerator Disconnect() yield return null; GameObject.Destroy(manager.gameObject); } + [OneTimeTearDown] + public void OneTimeTearDown() + { + if (NetworkManager.singleton != null) + { + GameObject go = NetworkManager.singleton.gameObject; + NetworkManager.Shutdown(); + GameObject.DestroyImmediate(go); + } + } [UnityTest] public IEnumerator ConnectAndDisconnectWorks() diff --git a/Assets/Mirror/Tests/Runtime/HostSetup.cs b/Assets/Mirror/Tests/Runtime/HostSetup.cs index 9bb4dd34c..a72cb660b 100644 --- a/Assets/Mirror/Tests/Runtime/HostSetup.cs +++ b/Assets/Mirror/Tests/Runtime/HostSetup.cs @@ -24,6 +24,7 @@ public IEnumerator SetupHost() playerGO = new GameObject(); identity = playerGO.AddComponent(); + identity.assetId = System.Guid.NewGuid(); manager.playerPrefab = playerGO; manager.startOnHeadless = false; diff --git a/Assets/Mirror/Tests/Runtime/NetworkManagerTests.cs b/Assets/Mirror/Tests/Runtime/NetworkManagerTests.cs index 94834639a..c1cf3e2f1 100644 --- a/Assets/Mirror/Tests/Runtime/NetworkManagerTests.cs +++ b/Assets/Mirror/Tests/Runtime/NetworkManagerTests.cs @@ -5,7 +5,7 @@ namespace Mirror.Tests.Runtime { - public class NetworkManagerTests : HostSetup + public class NetworkManagerTests { Scene activeScene;