mirror of
https://github.com/MirrorNetworking/Mirror.git
synced 2024-11-18 11:00:32 +00:00
CreateNetworkedAndSpawn: reuse CreateNetworked
This commit is contained in:
parent
86d8986f5b
commit
69fea4064b
@ -84,10 +84,7 @@ protected void CreateNetworkedAndSpawn<T>(out GameObject go, out NetworkIdentity
|
|||||||
Debug.Assert(NetworkClient.active, "NetworkClient needs to be active before spawning.");
|
Debug.Assert(NetworkClient.active, "NetworkClient needs to be active before spawning.");
|
||||||
Debug.Assert(NetworkServer.active, "NetworkServer needs to be active before spawning.");
|
Debug.Assert(NetworkServer.active, "NetworkServer needs to be active before spawning.");
|
||||||
|
|
||||||
go = new GameObject();
|
CreateNetworked(out go, out identity, out component);
|
||||||
identity = go.AddComponent<NetworkIdentity>();
|
|
||||||
component = go.AddComponent<T>();
|
|
||||||
instantiated.Add(go);
|
|
||||||
|
|
||||||
// host mode object needs a connection to server for commands to work
|
// host mode object needs a connection to server for commands to work
|
||||||
identity.connectionToServer = NetworkClient.connection;
|
identity.connectionToServer = NetworkClient.connection;
|
||||||
|
Loading…
Reference in New Issue
Block a user