private void UpdateCamera(PositionUpdatedEvent updatedEvent) { var goalVector = _goalPosition - updatedEvent.NewPosition; Camera.orthographicSize = GetTargetOrthographicSize(goalVector); Camera.transform.position = GetTargetCameraPosition(updatedEvent.NewPosition, goalVector); }
public void UpdatePosition(string Projection, double North, double East, double Altitude) { Position = new GPSPosition(Projection, North, East, Altitude); PositionUpdatedEvent?.Invoke(Position); UpdatedEvent?.Invoke(); }
public override IEnumerable <ComponentUpdate> Tick(SimState state, IEnumerable <IEvent> events) { List <ComponentUpdate> updates = new List <ComponentUpdate>(); if (!events.Any()) { return(Enumerable.Empty <ComponentUpdate>()); } PositionUpdatedEvent @event = (PositionUpdatedEvent)events.LastOrDefault(e => e.GetType() == typeof(PositionUpdatedEvent)); foreach (SimCamera camera in state.GetComponents <SimCamera>()) { SimCamera newCamera = camera.Clone() as SimCamera; newCamera.Position = @event.Position; updates.Add(new ComponentUpdate(newCamera)); } return(updates); }