GraphicAnimationMixer.cs 761 B

1234567891011121314151617181920212223242526
  1. using UnityEngine.UI;
  2. namespace UnityUIPlayables
  3. {
  4. public class GraphicAnimationMixer : AnimationMixer<Graphic, GraphicAnimationBehaviour>
  5. {
  6. private readonly GraphicColorMixer _colorMixer = new GraphicColorMixer();
  7. public override void SetupFrame(Graphic binding)
  8. {
  9. base.SetupFrame(binding);
  10. _colorMixer.SetupFrame();
  11. }
  12. public override void Blend(GraphicAnimationBehaviour behaviour, float inputWeight, float progress)
  13. {
  14. // Color
  15. _colorMixer.Blend(behaviour.StartValue.Color, behaviour.EndValue.Color, inputWeight, progress);
  16. }
  17. public override void ApplyFrame()
  18. {
  19. _colorMixer.ApplyFrame(Binding);
  20. }
  21. }
  22. }