暫無描述
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

RectangleZoom.cs 636B

1234567891011121314151617181920212223
  1. using UnityEngine;
  2. namespace UnityEditor.Timeline
  3. {
  4. class RectangleZoom : RectangleTool
  5. {
  6. protected override bool enableAutoPan { get { return true; } }
  7. protected override bool CanStartRectangle(Event evt)
  8. {
  9. return evt.button == 1 && evt.modifiers == (EventModifiers.Alt | EventModifiers.Shift);
  10. }
  11. protected override bool OnFinish(Event evt, WindowState state, Rect rect)
  12. {
  13. var x = state.PixelToTime(rect.xMin);
  14. var y = state.PixelToTime(rect.xMax);
  15. state.SetTimeAreaShownRange(x, y);
  16. return true;
  17. }
  18. }
  19. }