IEnumerator DelaySpawn() { yield return(new WaitUntil(() => NetworkServer.active)); foreach (var prefab in _prefabs) { var go = Instantiate(prefab.gameObject); go.transform.SetParent(transform); SyncNet.Spawn(go); } }
IEnumerator DelaySpawn() { yield return(new WaitUntil(() => NetworkServer.active)); _prefabs .Select(p => Instantiate(p.gameObject)) .ToList() .ForEach(go => { go.transform.SetParent(transform); SyncNet.Spawn(go); }); }