mirror of
https://github.com/MirrorNetworking/Mirror.git
synced 2024-11-18 11:00:32 +00:00
adjust tests
This commit is contained in:
parent
61cf08e01b
commit
d618582f41
@ -16,14 +16,22 @@ public abstract class MirrorTest
|
|||||||
public List<GameObject> instantiated;
|
public List<GameObject> instantiated;
|
||||||
|
|
||||||
// we usually need the memory transport
|
// we usually need the memory transport
|
||||||
|
GameObject holder;
|
||||||
public MemoryTransport transport;
|
public MemoryTransport transport;
|
||||||
|
|
||||||
public virtual void SetUp()
|
public virtual void SetUp()
|
||||||
{
|
{
|
||||||
instantiated = new List<GameObject>();
|
instantiated = new List<GameObject>();
|
||||||
|
|
||||||
|
// need a holder GO
|
||||||
|
holder = new GameObject();
|
||||||
|
|
||||||
// need a transport to send & receive
|
// need a transport to send & receive
|
||||||
Transport.activeTransport = transport = new GameObject().AddComponent<MemoryTransport>();
|
Transport.activeTransport = transport = holder.AddComponent<MemoryTransport>();
|
||||||
|
|
||||||
|
// NetworkServer was static before (= always existed).
|
||||||
|
// so always create the component again.
|
||||||
|
NetworkServerComponent.singleton = holder.AddComponent<NetworkServerComponent>();
|
||||||
}
|
}
|
||||||
|
|
||||||
public virtual void TearDown()
|
public virtual void TearDown()
|
||||||
@ -41,7 +49,8 @@ public virtual void TearDown()
|
|||||||
if (go != null)
|
if (go != null)
|
||||||
GameObject.DestroyImmediate(go);
|
GameObject.DestroyImmediate(go);
|
||||||
|
|
||||||
GameObject.DestroyImmediate(transport.gameObject);
|
GameObject.DestroyImmediate(holder);
|
||||||
|
NetworkServerComponent.singleton = null;
|
||||||
Transport.activeTransport = null;
|
Transport.activeTransport = null;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -24,8 +24,6 @@ public override void SetUp()
|
|||||||
public override void TearDown()
|
public override void TearDown()
|
||||||
{
|
{
|
||||||
base.TearDown();
|
base.TearDown();
|
||||||
// clear server aoi again
|
|
||||||
NetworkServer.aoi = null;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// brute force interest management
|
// brute force interest management
|
||||||
|
Loading…
Reference in New Issue
Block a user