public void BroadcastTransforms(Dictionary <NitroxId, GameObject> gameObjectsById) { EntityTransformUpdates update = new EntityTransformUpdates(); foreach (KeyValuePair <NitroxId, GameObject> gameObjectWithId in gameObjectsById) { if (gameObjectWithId.Value) { update.AddUpdate(gameObjectWithId.Key, gameObjectWithId.Value.transform.position.ToDto(), gameObjectWithId.Value.transform.rotation.ToDto()); } } packetSender.Send(update); }
public void BroadcastTransforms(Dictionary <string, GameObject> gameObjectsByGuid) { EntityTransformUpdates update = new EntityTransformUpdates(); foreach (KeyValuePair <string, GameObject> gameObjectWithGuid in gameObjectsByGuid) { GameObject go = gameObjectWithGuid.Value; if (go != null) { update.AddUpdate(gameObjectWithGuid.Key, gameObjectWithGuid.Value.transform.position, gameObjectWithGuid.Value.transform.rotation); } } packetSender.Send(update); }