diff options
| author | Andrew Lee <alee14498@protonmail.com> | 2020-04-19 17:19:32 -0400 |
|---|---|---|
| committer | Andrew Lee <alee14498@protonmail.com> | 2020-04-19 17:19:32 -0400 |
| commit | c55fba8ab2a1c9d3df65eda4a5a1e957f4aa1f78 (patch) | |
| tree | ee4d51c7c1d633e11f46453ef1edd3c77c4ef9f7 /Library/PackageCache/com.unity.timeline@1.2.13/Editor/Window/Modes | |
| download | Project-Sandbox-c55fba8ab2a1c9d3df65eda4a5a1e957f4aa1f78.tar.gz Project-Sandbox-c55fba8ab2a1c9d3df65eda4a5a1e957f4aa1f78.tar.bz2 Project-Sandbox-c55fba8ab2a1c9d3df65eda4a5a1e957f4aa1f78.zip | |
Inital commit
Diffstat (limited to 'Library/PackageCache/com.unity.timeline@1.2.13/Editor/Window/Modes')
14 files changed, 368 insertions, 0 deletions
diff --git a/Library/PackageCache/com.unity.timeline@1.2.13/Editor/Window/Modes/TimeReferenceMode.cs b/Library/PackageCache/com.unity.timeline@1.2.13/Editor/Window/Modes/TimeReferenceMode.cs new file mode 100644 index 0000000..873f7cd --- /dev/null +++ b/Library/PackageCache/com.unity.timeline@1.2.13/Editor/Window/Modes/TimeReferenceMode.cs @@ -0,0 +1,8 @@ +namespace UnityEditor.Timeline +{ + enum TimeReferenceMode + { + Local = 0, + Global = 1 + } +} diff --git a/Library/PackageCache/com.unity.timeline@1.2.13/Editor/Window/Modes/TimeReferenceMode.cs.meta b/Library/PackageCache/com.unity.timeline@1.2.13/Editor/Window/Modes/TimeReferenceMode.cs.meta new file mode 100644 index 0000000..c6c0fc4 --- /dev/null +++ b/Library/PackageCache/com.unity.timeline@1.2.13/Editor/Window/Modes/TimeReferenceMode.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 34d6f60b171c1004e8335d52c65928a3 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Library/PackageCache/com.unity.timeline@1.2.13/Editor/Window/Modes/TimelineActiveMode.cs b/Library/PackageCache/com.unity.timeline@1.2.13/Editor/Window/Modes/TimelineActiveMode.cs new file mode 100644 index 0000000..aa1dd5b --- /dev/null +++ b/Library/PackageCache/com.unity.timeline@1.2.13/Editor/Window/Modes/TimelineActiveMode.cs @@ -0,0 +1,42 @@ +namespace UnityEditor.Timeline +{ + class TimelineActiveMode : TimelineMode + { + public TimelineActiveMode() + { + headerState = new HeaderState + { + breadCrumb = TimelineModeGUIState.Enabled, + options = TimelineModeGUIState.Enabled, + sequenceSelector = TimelineModeGUIState.Enabled + }; + + trackOptionsState = new TrackOptionsState + { + newButton = TimelineModeGUIState.Enabled, + editAsAssetButton = TimelineModeGUIState.Hidden + }; + mode = TimelineModes.Active; + } + + public override bool ShouldShowTimeCursor(WindowState state) + { + return true; + } + + public override bool ShouldShowPlayRange(WindowState state) + { + return state.playRangeEnabled; + } + + public override TimelineModeGUIState ToolbarState(WindowState state) + { + return TimelineModeGUIState.Enabled; + } + + public override TimelineModeGUIState TrackState(WindowState state) + { + return TimelineModeGUIState.Enabled; + } + } +} diff --git a/Library/PackageCache/com.unity.timeline@1.2.13/Editor/Window/Modes/TimelineActiveMode.cs.meta b/Library/PackageCache/com.unity.timeline@1.2.13/Editor/Window/Modes/TimelineActiveMode.cs.meta new file mode 100644 index 0000000..1d055ea --- /dev/null +++ b/Library/PackageCache/com.unity.timeline@1.2.13/Editor/Window/Modes/TimelineActiveMode.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 67ee43b2f6148de40861b289b0e00591 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Library/PackageCache/com.unity.timeline@1.2.13/Editor/Window/Modes/TimelineAssetEditionMode.cs b/Library/PackageCache/com.unity.timeline@1.2.13/Editor/Window/Modes/TimelineAssetEditionMode.cs new file mode 100644 index 0000000..06f8581 --- /dev/null +++ b/Library/PackageCache/com.unity.timeline@1.2.13/Editor/Window/Modes/TimelineAssetEditionMode.cs @@ -0,0 +1,27 @@ +namespace UnityEditor.Timeline +{ + class TimelineAssetEditionMode : TimelineInactiveMode + { + public override TimelineModeGUIState TrackState(WindowState state) + { + return TimelineModeGUIState.Enabled; + } + + public TimelineAssetEditionMode() + { + headerState = new HeaderState + { + breadCrumb = TimelineModeGUIState.Enabled, + options = TimelineModeGUIState.Enabled, + sequenceSelector = TimelineModeGUIState.Enabled + }; + + trackOptionsState = new TrackOptionsState + { + newButton = TimelineModeGUIState.Enabled, + editAsAssetButton = TimelineModeGUIState.Enabled + }; + mode = TimelineModes.AssetEdition; + } + } +} diff --git a/Library/PackageCache/com.unity.timeline@1.2.13/Editor/Window/Modes/TimelineAssetEditionMode.cs.meta b/Library/PackageCache/com.unity.timeline@1.2.13/Editor/Window/Modes/TimelineAssetEditionMode.cs.meta new file mode 100644 index 0000000..6c5b2d1 --- /dev/null +++ b/Library/PackageCache/com.unity.timeline@1.2.13/Editor/Window/Modes/TimelineAssetEditionMode.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 3477d28057cb3e4469c7ea6b8dc23046 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Library/PackageCache/com.unity.timeline@1.2.13/Editor/Window/Modes/TimelineDisabledMode.cs b/Library/PackageCache/com.unity.timeline@1.2.13/Editor/Window/Modes/TimelineDisabledMode.cs new file mode 100644 index 0000000..dea7c1b --- /dev/null +++ b/Library/PackageCache/com.unity.timeline@1.2.13/Editor/Window/Modes/TimelineDisabledMode.cs @@ -0,0 +1,44 @@ +using UnityEngine; + +namespace UnityEditor.Timeline +{ + class TimelineDisabledMode : TimelineMode + { + public TimelineDisabledMode() + { + headerState = new HeaderState + { + breadCrumb = TimelineModeGUIState.Enabled, + options = TimelineModeGUIState.Enabled, + sequenceSelector = TimelineModeGUIState.Enabled + }; + + trackOptionsState = new TrackOptionsState + { + newButton = TimelineModeGUIState.Enabled, + editAsAssetButton = TimelineModeGUIState.Enabled + }; + mode = TimelineModes.Disabled; + } + + public override bool ShouldShowPlayRange(WindowState state) + { + return false; + } + + public override bool ShouldShowTimeCursor(WindowState state) + { + return true; + } + + public override TimelineModeGUIState ToolbarState(WindowState state) + { + return TimelineModeGUIState.Disabled; + } + + public override TimelineModeGUIState TrackState(WindowState state) + { + return TimelineModeGUIState.Enabled; + } + } +} diff --git a/Library/PackageCache/com.unity.timeline@1.2.13/Editor/Window/Modes/TimelineDisabledMode.cs.meta b/Library/PackageCache/com.unity.timeline@1.2.13/Editor/Window/Modes/TimelineDisabledMode.cs.meta new file mode 100644 index 0000000..8139fb6 --- /dev/null +++ b/Library/PackageCache/com.unity.timeline@1.2.13/Editor/Window/Modes/TimelineDisabledMode.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 4c5eb52d37bb6714a98af73df7d9cf2c +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Library/PackageCache/com.unity.timeline@1.2.13/Editor/Window/Modes/TimelineInactiveMode.cs b/Library/PackageCache/com.unity.timeline@1.2.13/Editor/Window/Modes/TimelineInactiveMode.cs new file mode 100644 index 0000000..bb63081 --- /dev/null +++ b/Library/PackageCache/com.unity.timeline@1.2.13/Editor/Window/Modes/TimelineInactiveMode.cs @@ -0,0 +1,47 @@ +namespace UnityEditor.Timeline +{ + class TimelineInactiveMode : TimelineMode + { + public TimelineInactiveMode() + { + headerState = new HeaderState + { + breadCrumb = TimelineModeGUIState.Disabled, + options = TimelineModeGUIState.Enabled, + sequenceSelector = TimelineModeGUIState.Enabled + }; + + trackOptionsState = new TrackOptionsState + { + newButton = TimelineModeGUIState.Disabled, + editAsAssetButton = TimelineModeGUIState.Enabled + }; + mode = TimelineModes.Inactive; + } + + public override bool ShouldShowPlayRange(WindowState state) + { + return false; + } + + public override bool ShouldShowTimeCursor(WindowState state) + { + return false; + } + + public override TimelineModeGUIState ToolbarState(WindowState state) + { + return TimelineModeGUIState.Disabled; + } + + public override TimelineModeGUIState TrackState(WindowState state) + { + return TimelineModeGUIState.Disabled; + } + + public override TimelineModeGUIState PreviewState(WindowState state) + { + return TimelineModeGUIState.Disabled; + } + } +} diff --git a/Library/PackageCache/com.unity.timeline@1.2.13/Editor/Window/Modes/TimelineInactiveMode.cs.meta b/Library/PackageCache/com.unity.timeline@1.2.13/Editor/Window/Modes/TimelineInactiveMode.cs.meta new file mode 100644 index 0000000..12a8898 --- /dev/null +++ b/Library/PackageCache/com.unity.timeline@1.2.13/Editor/Window/Modes/TimelineInactiveMode.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 5503f95d174761548a68a901beab13c2 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Library/PackageCache/com.unity.timeline@1.2.13/Editor/Window/Modes/TimelineMode.cs b/Library/PackageCache/com.unity.timeline@1.2.13/Editor/Window/Modes/TimelineMode.cs new file mode 100644 index 0000000..1a46841 --- /dev/null +++ b/Library/PackageCache/com.unity.timeline@1.2.13/Editor/Window/Modes/TimelineMode.cs @@ -0,0 +1,71 @@ +using System; +using UnityEngine; + +namespace UnityEditor.Timeline +{ + enum TimelineModeGUIState + { + Disabled, + Hidden, + Enabled + } + + abstract class TimelineMode + { + public struct HeaderState + { + public TimelineModeGUIState breadCrumb; + public TimelineModeGUIState sequenceSelector; + public TimelineModeGUIState options; + } + + public struct TrackOptionsState + { + public TimelineModeGUIState newButton; + public TimelineModeGUIState editAsAssetButton; + } + + public HeaderState headerState { get; protected set; } + public TrackOptionsState trackOptionsState { get; protected set; } + public TimelineModes mode { get; protected set; } + + public abstract bool ShouldShowPlayRange(WindowState state); + public abstract bool ShouldShowTimeCursor(WindowState state); + + public virtual bool ShouldShowTrackBindings(WindowState state) + { + return ShouldShowTimeCursor(state); + } + + public virtual bool ShouldShowTimeArea(WindowState state) + { + return !state.IsEditingAnEmptyTimeline(); + } + + public abstract TimelineModeGUIState TrackState(WindowState state); + public abstract TimelineModeGUIState ToolbarState(WindowState state); + + public virtual TimelineModeGUIState PreviewState(WindowState state) + { + return Application.isPlaying ? TimelineModeGUIState.Disabled : TimelineModeGUIState.Enabled; + } + + public virtual TimelineModeGUIState EditModeButtonsState(WindowState state) + { + return TimelineModeGUIState.Enabled; + } + } + + [Flags] + internal enum TimelineModes + { + None = 0, + Active = 1, + ReadOnly = 2, + Inactive = 4, + Disabled = 8, + AssetEdition = 16, + All = Active | ReadOnly | Inactive | Disabled, + Default = Active | AssetEdition + } +} diff --git a/Library/PackageCache/com.unity.timeline@1.2.13/Editor/Window/Modes/TimelineMode.cs.meta b/Library/PackageCache/com.unity.timeline@1.2.13/Editor/Window/Modes/TimelineMode.cs.meta new file mode 100644 index 0000000..7bf4435 --- /dev/null +++ b/Library/PackageCache/com.unity.timeline@1.2.13/Editor/Window/Modes/TimelineMode.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: a2cb43d6b0c226443be7e176590837a5 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Library/PackageCache/com.unity.timeline@1.2.13/Editor/Window/Modes/TimelineReadOnlyMode.cs b/Library/PackageCache/com.unity.timeline@1.2.13/Editor/Window/Modes/TimelineReadOnlyMode.cs new file mode 100644 index 0000000..21418ce --- /dev/null +++ b/Library/PackageCache/com.unity.timeline@1.2.13/Editor/Window/Modes/TimelineReadOnlyMode.cs @@ -0,0 +1,52 @@ +namespace UnityEditor.Timeline +{ + class TimelineReadOnlyMode : TimelineMode + { + public TimelineReadOnlyMode() + { + headerState = new HeaderState() + { + breadCrumb = TimelineModeGUIState.Enabled, + options = TimelineModeGUIState.Enabled, + sequenceSelector = TimelineModeGUIState.Enabled, + }; + + trackOptionsState = new TrackOptionsState() + { + newButton = TimelineModeGUIState.Disabled, + editAsAssetButton = TimelineModeGUIState.Disabled, + }; + mode = TimelineModes.ReadOnly; + } + + public override bool ShouldShowPlayRange(WindowState state) + { + return state.editSequence.director != null && state.playRangeEnabled; + } + + public override bool ShouldShowTimeCursor(WindowState state) + { + return state.editSequence.director != null; + } + + public override TimelineModeGUIState TrackState(WindowState state) + { + return TimelineModeGUIState.Disabled; + } + + public override TimelineModeGUIState ToolbarState(WindowState state) + { + return state.editSequence.director == null ? TimelineModeGUIState.Disabled : TimelineModeGUIState.Enabled; + } + + public override TimelineModeGUIState PreviewState(WindowState state) + { + return state.editSequence.director == null ? TimelineModeGUIState.Disabled : TimelineModeGUIState.Enabled; + } + + public override TimelineModeGUIState EditModeButtonsState(WindowState state) + { + return TimelineModeGUIState.Disabled; + } + } +} diff --git a/Library/PackageCache/com.unity.timeline@1.2.13/Editor/Window/Modes/TimelineReadOnlyMode.cs.meta b/Library/PackageCache/com.unity.timeline@1.2.13/Editor/Window/Modes/TimelineReadOnlyMode.cs.meta new file mode 100644 index 0000000..bd04969 --- /dev/null +++ b/Library/PackageCache/com.unity.timeline@1.2.13/Editor/Window/Modes/TimelineReadOnlyMode.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 3f8643c1f8dd449e85b548a14edbea2e +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: |
