TimelineReadOnlyMode.cs 1.7 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152
  1. namespace UnityEditor.Timeline
  2. {
  3. class TimelineReadOnlyMode : TimelineMode
  4. {
  5. public TimelineReadOnlyMode()
  6. {
  7. headerState = new HeaderState()
  8. {
  9. breadCrumb = TimelineModeGUIState.Enabled,
  10. options = TimelineModeGUIState.Enabled,
  11. sequenceSelector = TimelineModeGUIState.Enabled,
  12. };
  13. trackOptionsState = new TrackOptionsState()
  14. {
  15. newButton = TimelineModeGUIState.Disabled,
  16. editAsAssetButton = TimelineModeGUIState.Disabled,
  17. };
  18. mode = TimelineModes.ReadOnly;
  19. }
  20. public override bool ShouldShowPlayRange(WindowState state)
  21. {
  22. return state.editSequence.director != null && state.playRangeEnabled;
  23. }
  24. public override bool ShouldShowTimeCursor(WindowState state)
  25. {
  26. return state.editSequence.director != null;
  27. }
  28. public override TimelineModeGUIState TrackState(WindowState state)
  29. {
  30. return TimelineModeGUIState.Disabled;
  31. }
  32. public override TimelineModeGUIState ToolbarState(WindowState state)
  33. {
  34. return state.editSequence.director == null ? TimelineModeGUIState.Disabled : TimelineModeGUIState.Enabled;
  35. }
  36. public override TimelineModeGUIState PreviewState(WindowState state)
  37. {
  38. return state.editSequence.director == null ? TimelineModeGUIState.Disabled : TimelineModeGUIState.Enabled;
  39. }
  40. public override TimelineModeGUIState EditModeButtonsState(WindowState state)
  41. {
  42. return TimelineModeGUIState.Disabled;
  43. }
  44. }
  45. }