public override void Process() { LoadMultipleObjects(new uint[] { SpawnedObject, ClonedFrom }); if (NetworkObjects[0] == null) { Logger.LogWarning("Couldn't resolve SpawnedObject!", Category.NetMessage); return; } if (NetworkObjects[1] == null) { Logger.LogWarning("Couldn't resolve ClonedFrom!", Category.NetMessage); return; } //call all the hooks! var comps = NetworkObjects[0].GetComponents <IClientSpawn>(); var spawnInfo = ClientSpawnInfo.Create(NetworkObjects[1]); if (comps != null) { foreach (var comp in comps) { comp.OnSpawnClient(spawnInfo); } } }
public override IEnumerator Process() { yield return(WaitFor(SpawnedObject, ClonedFrom)); if (NetworkObjects[0] == null) { Logger.LogWarning("Couldn't resolve SpawnedObject!", Category.NetMessage); yield break; } if (NetworkObjects[1] == null) { Logger.LogWarning("Couldn't resolve ClonedFrom!", Category.NetMessage); yield break; } //call all the hooks! var comps = NetworkObjects[0].GetComponents <IClientSpawn>(); var spawnInfo = ClientSpawnInfo.Create(NetworkObjects[1]); if (comps != null) { foreach (var comp in comps) { comp.OnSpawnClient(spawnInfo); } } }
public override IEnumerator Process() { yield return(WaitFor(SpawnedObject, ClonedFrom)); //call all the hooks! var comps = NetworkObjects[0].GetComponents <IClientSpawn>(); var spawnInfo = ClientSpawnInfo.Create(NetworkObjects[1]); if (comps != null) { foreach (var comp in comps) { comp.OnSpawnClient(spawnInfo); } } }