private static Creator _CreateDefaultCreator(GameObject prefab, NetworkView parent, NetworkView[] children) { if (children != null && children.Length != 0) { Log.Info(NetworkLogFlags.Instantiate, "Setting up parent-child relationships in prefab '", prefab.GetName(), "' because it has multiple NetworkViews"); parent.SetChildren(children); } else { parent._parent = null; // ensure it is null, because Unity 5.x (or later) might assign a "null object" which is not technically null. } // we assume the prefab isn't in the scene, otherwise it could be a child and strange things could happen. parent.prefabRoot = prefab.transform.root.gameObject; return(delegate(string prefabName, NetworkInstantiateArgs args, NetworkMessageInfo info) { Profiler.BeginSample("Instantiate: " + prefabName); var networkView = NetworkInstantiatorUtility.Instantiate(parent, args); Profiler.EndSample(); Profiler.BeginSample(NetworkUnity.EVENT_INSTANTIATE); NetworkInstantiatorUtility.BroadcastOnNetworkInstantiate(networkView, info); Profiler.EndSample(); return networkView; }); }