Exemple #1
0
 /// <summary>
 /// Invokes the <see cref="CameraMoved"/> event.
 /// </summary>
 /// <param name="followedEntity">If we are invoking the event while following an entity, contains the reference to the followed entity.</param>
 protected virtual void OnCameraMove(IEntity followedEntity = null)
 {
     CameraMoved?.Invoke(new CameraMovedEventArgs(CameraWorldPosition,
                                                  CameraWorldRotation,
                                                  CameraMode,
                                                  followedEntity));
 }
Exemple #2
0
 /// <summary>
 /// Safely invokes the event <see cref="CameraMoved"/>.
 /// </summary>
 /// <param name="args">The arguments to invoke the event with.</param>
 void OnCameraMoved(CameraMovedEventArgs args)
 {
     try {
         CameraMoved?.Invoke(args);
     }
     catch (Exception e) {
         Urho.IO.Log.Write(LogLevel.Warning,
                           $"There was an unexpected exception during the invocation of {nameof(CameraMoved)}: {e.Message}");
     }
 }
Exemple #3
0
        public void OnCameraMove()
        {
            var loc = new Binding3DLocation(
                latitude: GoogleMap.CameraPosition.Target.Latitude,
                longitude: GoogleMap.CameraPosition.Target.Longitude,
                altitude: GoogleMap.CameraPosition.Zoom
                );

            if (CameraMoved?.CanExecute(loc) ?? false)
            {
                CameraMoved.Execute(loc);
            }
        }