Initial Commit
This commit is contained in:
parent
53eb92e9af
commit
270ab7d11f
15341 changed files with 700234 additions and 0 deletions
|
@ -0,0 +1,8 @@
|
|||
namespace UnityEditor.Timeline
|
||||
{
|
||||
enum TimeReferenceMode
|
||||
{
|
||||
Local = 0,
|
||||
Global = 1
|
||||
}
|
||||
}
|
|
@ -0,0 +1,11 @@
|
|||
fileFormatVersion: 2
|
||||
guid: 34d6f60b171c1004e8335d52c65928a3
|
||||
MonoImporter:
|
||||
externalObjects: {}
|
||||
serializedVersion: 2
|
||||
defaultReferences: []
|
||||
executionOrder: 0
|
||||
icon: {instanceID: 0}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
|
@ -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;
|
||||
}
|
||||
}
|
||||
}
|
|
@ -0,0 +1,11 @@
|
|||
fileFormatVersion: 2
|
||||
guid: 67ee43b2f6148de40861b289b0e00591
|
||||
MonoImporter:
|
||||
externalObjects: {}
|
||||
serializedVersion: 2
|
||||
defaultReferences: []
|
||||
executionOrder: 0
|
||||
icon: {instanceID: 0}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
|
@ -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;
|
||||
}
|
||||
}
|
||||
}
|
|
@ -0,0 +1,11 @@
|
|||
fileFormatVersion: 2
|
||||
guid: 3477d28057cb3e4469c7ea6b8dc23046
|
||||
MonoImporter:
|
||||
externalObjects: {}
|
||||
serializedVersion: 2
|
||||
defaultReferences: []
|
||||
executionOrder: 0
|
||||
icon: {instanceID: 0}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
|
@ -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;
|
||||
}
|
||||
}
|
||||
}
|
|
@ -0,0 +1,11 @@
|
|||
fileFormatVersion: 2
|
||||
guid: 4c5eb52d37bb6714a98af73df7d9cf2c
|
||||
MonoImporter:
|
||||
externalObjects: {}
|
||||
serializedVersion: 2
|
||||
defaultReferences: []
|
||||
executionOrder: 0
|
||||
icon: {instanceID: 0}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
|
@ -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;
|
||||
}
|
||||
}
|
||||
}
|
|
@ -0,0 +1,11 @@
|
|||
fileFormatVersion: 2
|
||||
guid: 5503f95d174761548a68a901beab13c2
|
||||
MonoImporter:
|
||||
externalObjects: {}
|
||||
serializedVersion: 2
|
||||
defaultReferences: []
|
||||
executionOrder: 0
|
||||
icon: {instanceID: 0}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
|
@ -0,0 +1,91 @@
|
|||
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 state.ignorePreview ? TimelineModeGUIState.Disabled : TimelineModeGUIState.Enabled;
|
||||
}
|
||||
|
||||
public virtual TimelineModeGUIState EditModeButtonsState(WindowState state)
|
||||
{
|
||||
return TimelineModeGUIState.Enabled;
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Different mode for Timeline
|
||||
/// </summary>
|
||||
[Flags]
|
||||
public enum TimelineModes
|
||||
{
|
||||
/// <summary>
|
||||
/// A playable director with a valid timeline is selected in editor.
|
||||
/// </summary>
|
||||
Active = 1,
|
||||
/// <summary>
|
||||
/// The timeline is not editable. (the TimelineAsset file is either readonly on disk or locked by source control).
|
||||
/// </summary>
|
||||
ReadOnly = 2,
|
||||
/// <summary>
|
||||
/// The timeline cannot be played or previewed.
|
||||
/// </summary>
|
||||
Inactive = 4,
|
||||
/// <summary>
|
||||
/// Disabled Timeline.
|
||||
/// </summary>
|
||||
Disabled = 8,
|
||||
/// <summary>
|
||||
/// Timeline in AssetEditing mode.
|
||||
/// This mode is enabled when a timeline asset is selected in the project window.
|
||||
/// </summary>
|
||||
AssetEdition = 16,
|
||||
/// <summary>
|
||||
/// The timeline can be edited (either through playable director or selected timeline asset in project window).
|
||||
/// </summary>
|
||||
Default = Active | AssetEdition
|
||||
}
|
||||
}
|
|
@ -0,0 +1,11 @@
|
|||
fileFormatVersion: 2
|
||||
guid: a2cb43d6b0c226443be7e176590837a5
|
||||
MonoImporter:
|
||||
externalObjects: {}
|
||||
serializedVersion: 2
|
||||
defaultReferences: []
|
||||
executionOrder: 0
|
||||
icon: {instanceID: 0}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
|
@ -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;
|
||||
}
|
||||
}
|
||||
}
|
|
@ -0,0 +1,11 @@
|
|||
fileFormatVersion: 2
|
||||
guid: 3f8643c1f8dd449e85b548a14edbea2e
|
||||
MonoImporter:
|
||||
externalObjects: {}
|
||||
serializedVersion: 2
|
||||
defaultReferences: []
|
||||
executionOrder: 0
|
||||
icon: {instanceID: 0}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
Loading…
Add table
Add a link
Reference in a new issue