mirror of
https://github.com/MirrorNetworking/Mirror.git
synced 2024-11-18 11:00:32 +00:00
tests: updating HostSetup.cs
adding methods to spawn a pair of objects for server/client tests
This commit is contained in:
parent
3fcc7415b4
commit
2396da8202
@ -18,6 +18,16 @@ public class HostSetup
|
|||||||
protected virtual void afterStartHost() { }
|
protected virtual void afterStartHost() { }
|
||||||
protected virtual void beforeStopHost() { }
|
protected virtual void beforeStopHost() { }
|
||||||
|
|
||||||
|
protected static void FakeSpawnServerClientIdentity(NetworkIdentity serverNI, NetworkIdentity clientNI)
|
||||||
|
{
|
||||||
|
serverNI.OnStartServer();
|
||||||
|
serverNI.RebuildObservers(true);
|
||||||
|
|
||||||
|
clientNI.netId = serverNI.netId;
|
||||||
|
NetworkIdentity.spawned[serverNI.netId] = clientNI;
|
||||||
|
clientNI.OnStartClient();
|
||||||
|
}
|
||||||
|
|
||||||
[UnitySetUp]
|
[UnitySetUp]
|
||||||
public IEnumerator SetupHost()
|
public IEnumerator SetupHost()
|
||||||
{
|
{
|
||||||
|
Loading…
Reference in New Issue
Block a user