Tests clear NetworkManager singleton. prepares for NS/NC as component where we would need to initialize NM (and the singleton), and need to clear it

This commit is contained in:
vis2k 2022-02-02 01:34:28 +08:00
parent 8f7a0858ce
commit 55abc80c8e
2 changed files with 2 additions and 1 deletions

View File

@ -97,7 +97,7 @@ public class NetworkManager : MonoBehaviour
public static int startPositionIndex;
/// <summary>The one and only NetworkManager</summary>
public static NetworkManager singleton { get; private set; }
public static NetworkManager singleton { get; internal set; }
/// <summary>Number of active player objects across all connections on the server.</summary>
public int numPlayers => NetworkServer.connections.Count(kv => kv.Value.identity != null);

View File

@ -47,6 +47,7 @@ public virtual void TearDown()
GameObject.DestroyImmediate(transport.gameObject);
Transport.activeTransport = null;
NetworkManager.singleton = null;
}
// create a tracked GameObject for tests without Networkidentity