mirror of
https://github.com/MirrorNetworking/Mirror.git
synced 2024-11-18 11:00:32 +00:00
MirrorTest: CreateNetworked<T,U>
This commit is contained in:
parent
152ffb11a7
commit
f6c13424cf
@ -55,6 +55,19 @@ protected void CreateNetworked<T>(out GameObject go, out NetworkIdentity identit
|
||||
instantiated.Add(go);
|
||||
}
|
||||
|
||||
// create GameObject + NetworkIdentity + 2x NetworkBehaviour<T>
|
||||
// add to tracker list if needed (useful for cleanups afterwards)
|
||||
protected void CreateNetworked<T, U>(out GameObject go, out NetworkIdentity identity, out T componentA, out U componentB)
|
||||
where T : NetworkBehaviour
|
||||
where U : NetworkBehaviour
|
||||
{
|
||||
go = new GameObject();
|
||||
identity = go.AddComponent<NetworkIdentity>();
|
||||
componentA = go.AddComponent<T>();
|
||||
componentB = go.AddComponent<U>();
|
||||
instantiated.Add(go);
|
||||
}
|
||||
|
||||
// create GameObject + NetworkIdentity + NetworkBehaviour & SPAWN
|
||||
// => ownerConnection can be NetworkServer.localConnection if needed.
|
||||
protected void CreateNetworkedAndSpawn<T>(out GameObject go, out NetworkIdentity identity, out T component, NetworkConnection ownerConnection = null)
|
||||
|
Loading…
Reference in New Issue
Block a user