TrackZoom.cs 533 B

1234567891011121314151617181920
  1. using UnityEngine;
  2. using UnityEngine.Timeline;
  3. namespace UnityEditor.Timeline
  4. {
  5. class TrackZoom : Manipulator
  6. {
  7. // only handles 'vertical' zoom. horizontal is handled in timelineGUI
  8. protected override bool MouseWheel(Event evt, WindowState state)
  9. {
  10. if (EditorGUI.actionKey)
  11. {
  12. state.trackScale = Mathf.Min(Mathf.Max(state.trackScale + (evt.delta.y * 0.1f), 1.0f), 100.0f);
  13. return true;
  14. }
  15. return false;
  16. }
  17. }
  18. }