GpuEcsAnimatorControlComponents.cs 1.0 KB

123456789101112131415161718192021222324252627282930
  1. using Unity.Entities;
  2. namespace GPUECSAnimationBaker.Engine.AnimatorSystem
  3. {
  4. public struct GpuEcsAnimatorControlComponent : IComponentData
  5. {
  6. public AnimatorInfo animatorInfo; // All info about the animation you want to play
  7. public float startNormalizedTime; // An option to start the animation from an arbitrary position (0 to 1)
  8. public float transitionSpeed; // The transition speed that will be applied when switching to another animation
  9. }
  10. public struct AnimatorInfo
  11. {
  12. public int animationID; // the unique animation ID, can be assigned from the generated enum file
  13. public float blendFactor; // From 0 to 1, going from clip1 to clip2
  14. public float speedFactor; // <1 to make the animation go slower, >1 to make it go faster
  15. }
  16. public enum GpuEcsAnimatorControlStates
  17. {
  18. Start,
  19. Stop,
  20. KeepCurrentState
  21. }
  22. public struct GpuEcsAnimatorControlStateComponent : IComponentData
  23. {
  24. public GpuEcsAnimatorControlStates state;
  25. }
  26. }