mirror of
https://github.com/MirrorNetworking/Mirror.git
synced 2024-11-18 02:50: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(NetworkServer.active, "NetworkServer needs to be active before spawning.");
|
||||
|
||||
go = new GameObject();
|
||||
identity = go.AddComponent<NetworkIdentity>();
|
||||
component = go.AddComponent<T>();
|
||||
instantiated.Add(go);
|
||||
CreateNetworked(out go, out identity, out component);
|
||||
|
||||
// host mode object needs a connection to server for commands to work
|
||||
identity.connectionToServer = NetworkClient.connection;
|
||||
|
Loading…
Reference in New Issue
Block a user