A game about forced loneliness, made by TACStudios
at master 91 lines 2.8 kB view raw
1using System; 2using UnityEngine; 3 4namespace UnityEditor.Timeline 5{ 6 enum TimelineModeGUIState 7 { 8 Disabled, 9 Hidden, 10 Enabled 11 } 12 13 abstract class TimelineMode 14 { 15 public struct HeaderState 16 { 17 public TimelineModeGUIState breadCrumb; 18 public TimelineModeGUIState sequenceSelector; 19 public TimelineModeGUIState options; 20 } 21 22 public struct TrackOptionsState 23 { 24 public TimelineModeGUIState newButton; 25 public TimelineModeGUIState editAsAssetButton; 26 } 27 28 public HeaderState headerState { get; protected set; } 29 public TrackOptionsState trackOptionsState { get; protected set; } 30 public TimelineModes mode { get; protected set; } 31 32 public abstract bool ShouldShowPlayRange(WindowState state); 33 public abstract bool ShouldShowTimeCursor(WindowState state); 34 35 public virtual bool ShouldShowTrackBindings(WindowState state) 36 { 37 return ShouldShowTimeCursor(state); 38 } 39 40 public virtual bool ShouldShowTimeArea(WindowState state) 41 { 42 return !state.IsEditingAnEmptyTimeline(); 43 } 44 45 public abstract TimelineModeGUIState TrackState(WindowState state); 46 public abstract TimelineModeGUIState ToolbarState(WindowState state); 47 48 public virtual TimelineModeGUIState PreviewState(WindowState state) 49 { 50 return state.ignorePreview ? TimelineModeGUIState.Disabled : TimelineModeGUIState.Enabled; 51 } 52 53 public virtual TimelineModeGUIState EditModeButtonsState(WindowState state) 54 { 55 return TimelineModeGUIState.Enabled; 56 } 57 } 58 59 /// <summary> 60 /// Different mode for Timeline 61 /// </summary> 62 [Flags] 63 public enum TimelineModes 64 { 65 /// <summary> 66 /// A playable director with a valid timeline is selected in editor. 67 /// </summary> 68 Active = 1, 69 /// <summary> 70 /// The timeline is not editable. (the TimelineAsset file is either readonly on disk or locked by source control). 71 /// </summary> 72 ReadOnly = 2, 73 /// <summary> 74 /// The timeline cannot be played or previewed. 75 /// </summary> 76 Inactive = 4, 77 /// <summary> 78 /// Disabled Timeline. 79 /// </summary> 80 Disabled = 8, 81 /// <summary> 82 /// Timeline in AssetEditing mode. 83 /// This mode is enabled when a timeline asset is selected in the project window. 84 /// </summary> 85 AssetEdition = 16, 86 /// <summary> 87 /// The timeline can be edited (either through playable director or selected timeline asset in project window). 88 /// </summary> 89 Default = Active | AssetEdition 90 } 91}