// Update is called once per frame void Update() { PlayerTransform.Update update = new PlayerTransform.Update { Position = Coordinates.FromUnityVector(transform.position), Rotation = Coordinates.FromUnityVector(transform.rotation.eulerAngles) }; _writer.SendUpdate(update); }
private void Update() { var update = new PlayerTransform.Update { Position = Vector3f.FromUnityVector(transform.position), Rotation = Vector3f.FromUnityVector(transform.rotation.eulerAngles) }; _writer.SendUpdate(update); }
public void SendUpdate(PlayerTransform.Update update) { var component = EntityManager.GetComponentData <PlayerTransform.Component>(Entity); if (update.Position.HasValue) { component.Position = update.Position.Value; } if (update.Rotation.HasValue) { component.Rotation = update.Rotation.Value; } EntityManager.SetComponentData(Entity, component); }
// Update is called once per frame void Update() { var update = new Position.Update() { Coords = transform.position.ToCoordinates() }; spatialPosition.SendUpdate(update); var update2 = new PlayerTransform.Update() { //Position = Vector3f.FromUnityVector(transform.position), Rotation = Vector3f.FromUnityVector(transform.eulerAngles) }; _writer.SendUpdate(update2); }