mirror of
https://github.com/MirrorNetworking/Mirror.git
synced 2024-11-18 11:00:32 +00:00
Tests: CreateNetworked without NetworkBehaviour
This commit is contained in:
parent
c4491fe0d6
commit
dc70cd33d7
@ -7,6 +7,16 @@ namespace Mirror.Tests
|
||||
{
|
||||
public static class TestUtils
|
||||
{
|
||||
// create GameObject + NetworkIdentity
|
||||
// add to tracker list if needed (useful for cleanups afterwards)
|
||||
public static void CreateNetworked(out GameObject go, out NetworkIdentity identity, List<GameObject> tracker = null)
|
||||
where T : NetworkBehaviour
|
||||
{
|
||||
go = new GameObject();
|
||||
identity = go.AddComponent<NetworkIdentity>();
|
||||
tracker?.Add(go);
|
||||
}
|
||||
|
||||
// create GameObject + NetworkIdentity + NetworkBehaviour<T>
|
||||
// add to tracker list if needed (useful for cleanups afterwards)
|
||||
public static void CreateNetworked<T>(out GameObject go, out NetworkIdentity identity, out T component, List<GameObject> tracker = null)
|
||||
|
Loading…
Reference in New Issue
Block a user