AnimationEvent.cs 779 B

12345678910111213141516171819202122232425
  1. // Copyright (c) Craftwork Games. All rights reserved.
  2. // Licensed under the MIT license.
  3. // See LICENSE file in the project root for full license information.
  4. using System;
  5. namespace MonoGame.Extended.Animations;
  6. /// <summary>
  7. /// Represents an event that occurs during an animation.
  8. /// </summary>
  9. public class AnimationEvent : EventArgs
  10. {
  11. /// <summary>
  12. /// Gets the animation controller associated with the event.
  13. /// </summary>
  14. public IAnimationController Animation { get; }
  15. /// <summary>
  16. /// Gets the trigger that caused the event.
  17. /// </summary>
  18. public AnimationEventTrigger Trigger { get; }
  19. internal AnimationEvent(IAnimationController animation, AnimationEventTrigger trigger) => (Animation, Trigger) = (animation, trigger);
  20. }