first commit
This commit is contained in:
@@ -0,0 +1,89 @@
|
||||
using System;
|
||||
using JetBrains.Annotations;
|
||||
using UnityEngine;
|
||||
using UnityEngine.Timeline;
|
||||
|
||||
namespace UnityEditor.Timeline
|
||||
{
|
||||
[CustomTrackDrawer(typeof(AnimationTrack)), UsedImplicitly]
|
||||
class AnimationTrackDrawer : TrackDrawer
|
||||
{
|
||||
static class Styles
|
||||
{
|
||||
public static readonly GUIContent AvatarMaskActiveTooltip = L10n.TextContent(string.Empty, "Enable Avatar Mask");
|
||||
public static readonly GUIContent AvatarMaskInactiveTooltip = L10n.TextContent(string.Empty, "Disable Avatar Mask");
|
||||
}
|
||||
|
||||
public override void DrawTrackHeaderButton(Rect rect, WindowState state)
|
||||
{
|
||||
var animTrack = track as AnimationTrack;
|
||||
if (animTrack == null) return;
|
||||
|
||||
var style = DirectorStyles.Instance.trackAvatarMaskButton;
|
||||
var tooltip = animTrack.applyAvatarMask ? Styles.AvatarMaskInactiveTooltip : Styles.AvatarMaskActiveTooltip;
|
||||
|
||||
using (var check = new EditorGUI.ChangeCheckScope())
|
||||
{
|
||||
var toggle = GUI.Toggle(rect, animTrack.applyAvatarMask, tooltip, style);
|
||||
if (check.changed)
|
||||
{
|
||||
animTrack.applyAvatarMask = toggle;
|
||||
if (state != null)
|
||||
state.rebuildGraph = true;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public override void DrawRecordingBackground(Rect trackRect, TrackAsset trackAsset, Vector2 visibleTime, WindowState state)
|
||||
{
|
||||
base.DrawRecordingBackground(trackRect, trackAsset, visibleTime, state);
|
||||
DrawBorderOfAddedRecordingClip(trackRect, trackAsset, visibleTime, (WindowState)state);
|
||||
}
|
||||
|
||||
static void DrawBorderOfAddedRecordingClip(Rect trackRect, TrackAsset trackAsset, Vector2 visibleTime, WindowState state)
|
||||
{
|
||||
if (!state.IsArmedForRecord(trackAsset))
|
||||
return;
|
||||
|
||||
AnimationTrack animTrack = trackAsset as AnimationTrack;
|
||||
if (animTrack == null || !animTrack.inClipMode)
|
||||
return;
|
||||
|
||||
// make sure there is no clip but we can add one
|
||||
TimelineClip clip = null;
|
||||
if (trackAsset.FindRecordingClipAtTime(state.editSequence.time, out clip) || clip != null)
|
||||
return;
|
||||
|
||||
float yMax = trackRect.yMax;
|
||||
float yMin = trackRect.yMin;
|
||||
|
||||
double startGap = 0;
|
||||
double endGap = 0;
|
||||
|
||||
trackAsset.GetGapAtTime(state.editSequence.time, out startGap, out endGap);
|
||||
if (double.IsInfinity(endGap))
|
||||
endGap = visibleTime.y;
|
||||
|
||||
if (startGap > visibleTime.y || endGap < visibleTime.x)
|
||||
return;
|
||||
|
||||
|
||||
startGap = Math.Max(startGap, visibleTime.x);
|
||||
endGap = Math.Min(endGap, visibleTime.y);
|
||||
|
||||
float xMin = state.TimeToPixel(startGap);
|
||||
float xMax = state.TimeToPixel(endGap);
|
||||
|
||||
var r = Rect.MinMaxRect(xMin, yMin, xMax, yMax);
|
||||
ClipDrawer.DrawClipSelectionBorder(r, ClipBorder.Recording(), ClipBlends.kNone);
|
||||
}
|
||||
|
||||
public override bool HasCustomTrackHeaderButton()
|
||||
{
|
||||
var animTrack = track as AnimationTrack;
|
||||
if (animTrack == null) return false;
|
||||
|
||||
return animTrack != null && animTrack.avatarMask != null;
|
||||
}
|
||||
}
|
||||
}
|
@@ -0,0 +1,11 @@
|
||||
fileFormatVersion: 2
|
||||
guid: cb281723220c9964094e6c52e0ece792
|
||||
MonoImporter:
|
||||
externalObjects: {}
|
||||
serializedVersion: 2
|
||||
defaultReferences: []
|
||||
executionOrder: 0
|
||||
icon: {instanceID: 0}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
File diff suppressed because it is too large
Load Diff
@@ -0,0 +1,11 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 63118a0c9ee42ac46b7f30e793177a76
|
||||
MonoImporter:
|
||||
externalObjects: {}
|
||||
serializedVersion: 2
|
||||
defaultReferences: []
|
||||
executionOrder: 0
|
||||
icon: {instanceID: 0}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
@@ -0,0 +1,87 @@
|
||||
using UnityEngine;
|
||||
using UnityEngine.Timeline;
|
||||
|
||||
namespace UnityEditor.Timeline
|
||||
{
|
||||
class InfiniteTrackDrawer : TrackDrawer
|
||||
{
|
||||
readonly IPropertyKeyDataSource m_DataSource;
|
||||
Rect m_TrackRect;
|
||||
|
||||
public InfiniteTrackDrawer(IPropertyKeyDataSource dataSource)
|
||||
{
|
||||
m_DataSource = dataSource;
|
||||
}
|
||||
|
||||
public bool CanDraw(TrackAsset track, WindowState state)
|
||||
{
|
||||
var keys = m_DataSource.GetKeys();
|
||||
var isTrackEmpty = track.clips.Length == 0;
|
||||
|
||||
return keys != null || (state.IsArmedForRecord(track) && isTrackEmpty);
|
||||
}
|
||||
|
||||
static void DrawRecordBackground(Rect trackRect)
|
||||
{
|
||||
var styles = DirectorStyles.Instance;
|
||||
|
||||
EditorGUI.DrawRect(trackRect, styles.customSkin.colorInfiniteTrackBackgroundRecording);
|
||||
|
||||
Graphics.ShadowLabel(trackRect,
|
||||
DirectorStyles.Elipsify(DirectorStyles.recordingLabel.text, trackRect, styles.fontClip),
|
||||
styles.fontClip, Color.white, Color.black);
|
||||
}
|
||||
|
||||
public override bool DrawTrack(Rect trackRect, TrackAsset trackAsset, Vector2 visibleTime, WindowState state)
|
||||
{
|
||||
m_TrackRect = trackRect;
|
||||
|
||||
if (!CanDraw(trackAsset, state))
|
||||
return true;
|
||||
|
||||
if (state.recording && state.IsArmedForRecord(trackAsset))
|
||||
DrawRecordBackground(trackRect);
|
||||
|
||||
if (m_DataSource.GetKeys() != null && m_DataSource.GetKeys().Length > 0 || state.recording)
|
||||
GUI.Box(trackRect, GUIContent.none, DirectorStyles.Instance.infiniteTrack);
|
||||
|
||||
var shadowRect = trackRect;
|
||||
shadowRect.yMin = shadowRect.yMax;
|
||||
shadowRect.height = 15.0f;
|
||||
if (Event.current.type == EventType.Repaint)
|
||||
DirectorStyles.Instance.bottomShadow.Draw(shadowRect, false, false, false, false);
|
||||
|
||||
var keys = m_DataSource.GetKeys();
|
||||
if (keys != null && keys.Length > 0)
|
||||
{
|
||||
foreach (var k in keys)
|
||||
DrawKeyFrame(k, state);
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
void DrawKeyFrame(float key, WindowState state)
|
||||
{
|
||||
var x = state.TimeToPixel(key);
|
||||
var bounds = new Rect(x, m_TrackRect.yMin + 3.0f, 1.0f, m_TrackRect.height - 6.0f);
|
||||
|
||||
if (!m_TrackRect.Overlaps(bounds))
|
||||
return;
|
||||
|
||||
var iconWidth = DirectorStyles.Instance.keyframe.fixedWidth;
|
||||
var iconHeight = DirectorStyles.Instance.keyframe.fixedHeight;
|
||||
|
||||
var keyframeRect = bounds;
|
||||
keyframeRect.width = iconWidth;
|
||||
keyframeRect.height = iconHeight;
|
||||
keyframeRect.xMin -= iconWidth / 2.0f;
|
||||
keyframeRect.yMin = m_TrackRect.yMin + ((m_TrackRect.height - iconHeight) / 2.0f);
|
||||
|
||||
// case 890650 : Make sure to use GUI.Label and not GUI.Box since the number of key frames can vary while dragging keys in the inline curves causing hotControls to be desynchronized
|
||||
GUI.Label(keyframeRect, GUIContent.none, DirectorStyles.Instance.keyframe);
|
||||
|
||||
EditorGUI.DrawRect(bounds, DirectorStyles.Instance.customSkin.colorInfiniteClipLine);
|
||||
}
|
||||
}
|
||||
}
|
@@ -0,0 +1,11 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 5ea6a8a826704f743b3b0ce3e9d3c9a9
|
||||
MonoImporter:
|
||||
externalObjects: {}
|
||||
serializedVersion: 2
|
||||
defaultReferences: []
|
||||
executionOrder: 0
|
||||
icon: {instanceID: 0}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
@@ -0,0 +1,8 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 16388ae022a89264b84107f0c1b44680
|
||||
folderAsset: yes
|
||||
DefaultImporter:
|
||||
externalObjects: {}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
@@ -0,0 +1,63 @@
|
||||
using System.Collections.Generic;
|
||||
using UnityEngine;
|
||||
using UnityEngine.Timeline;
|
||||
|
||||
namespace UnityEditor.Timeline
|
||||
{
|
||||
class ClipsLayer : ItemsLayer<TimelineClipGUI>
|
||||
{
|
||||
static readonly GUIStyle k_ConnectorIcon = DirectorStyles.Instance.connector;
|
||||
|
||||
public ClipsLayer(Layer layerOrder, IRowGUI parent) : base(layerOrder)
|
||||
{
|
||||
var track = parent.asset;
|
||||
track.SortClips();
|
||||
TimelineClipGUI previousClipGUI = null;
|
||||
|
||||
foreach (var clip in track.clips)
|
||||
{
|
||||
var oldClipGUI = ItemToItemGui.GetGuiForClip(clip);
|
||||
var isInvalid = oldClipGUI != null && oldClipGUI.isInvalid; // HACK Make sure to carry invalidy state when refereshing the cache.
|
||||
|
||||
var currentClipGUI = new TimelineClipGUI(clip, parent, this) { isInvalid = isInvalid };
|
||||
if (previousClipGUI != null) previousClipGUI.nextClip = currentClipGUI;
|
||||
currentClipGUI.previousClip = previousClipGUI;
|
||||
AddItem(currentClipGUI);
|
||||
previousClipGUI = currentClipGUI;
|
||||
}
|
||||
|
||||
//adjust zOrder based on current clip selection
|
||||
foreach (var clipGUI in items)
|
||||
{
|
||||
if (clipGUI.IsSelected())
|
||||
clipGUI.MoveToTop();
|
||||
}
|
||||
}
|
||||
|
||||
public override void Draw(Rect rect, WindowState state)
|
||||
{
|
||||
base.Draw(rect, state); //draw clips
|
||||
DrawConnector(items);
|
||||
}
|
||||
|
||||
static void DrawConnector(List<TimelineClipGUI> clips)
|
||||
{
|
||||
if (Event.current.type != EventType.Repaint)
|
||||
return;
|
||||
|
||||
foreach (var clip in clips)
|
||||
{
|
||||
if (clip.previousClip != null && clip.visible && clip.treeViewRect.width > 14 &&
|
||||
(DiscreteTime)clip.start == (DiscreteTime)clip.previousClip.end)
|
||||
{
|
||||
// draw little connector widget
|
||||
var localRect = clip.treeViewRect;
|
||||
localRect.x -= Mathf.Floor(k_ConnectorIcon.fixedWidth / 2.0f);
|
||||
localRect.width = k_ConnectorIcon.fixedWidth;
|
||||
localRect.height = k_ConnectorIcon.fixedHeight;
|
||||
GUI.Label(localRect, GUIContent.none, k_ConnectorIcon);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
@@ -0,0 +1,11 @@
|
||||
fileFormatVersion: 2
|
||||
guid: a809a4b50addbf44b9023b5e7f9fd4d2
|
||||
MonoImporter:
|
||||
externalObjects: {}
|
||||
serializedVersion: 2
|
||||
defaultReferences: []
|
||||
executionOrder: 0
|
||||
icon: {instanceID: 0}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
@@ -0,0 +1,133 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using UnityEngine;
|
||||
using UnityEngine.Timeline;
|
||||
|
||||
namespace UnityEditor.Timeline
|
||||
{
|
||||
enum Layer : byte
|
||||
{
|
||||
Clips,
|
||||
ClipHandles,
|
||||
Markers,
|
||||
MarkerHeaderTrack,
|
||||
MarkersOnHeader
|
||||
}
|
||||
|
||||
struct LayerZOrder : IComparable<LayerZOrder>
|
||||
{
|
||||
Layer m_Layer;
|
||||
int m_ZOrder;
|
||||
|
||||
public LayerZOrder(Layer layer, int zOrder)
|
||||
{
|
||||
m_Layer = layer;
|
||||
m_ZOrder = zOrder;
|
||||
}
|
||||
|
||||
public int CompareTo(LayerZOrder other)
|
||||
{
|
||||
if (m_Layer == other.m_Layer)
|
||||
return m_ZOrder.CompareTo(other.m_ZOrder);
|
||||
return m_Layer.CompareTo(other.m_Layer);
|
||||
}
|
||||
|
||||
public static LayerZOrder operator ++(LayerZOrder x)
|
||||
{
|
||||
return new LayerZOrder(x.m_Layer, x.m_ZOrder + 1);
|
||||
}
|
||||
|
||||
public LayerZOrder ChangeLayer(Layer layer)
|
||||
{
|
||||
return new LayerZOrder(layer, m_ZOrder);
|
||||
}
|
||||
}
|
||||
|
||||
interface ILayerable
|
||||
{
|
||||
LayerZOrder zOrder { get; }
|
||||
}
|
||||
|
||||
interface IZOrderProvider
|
||||
{
|
||||
LayerZOrder Next();
|
||||
}
|
||||
|
||||
interface ILayer : IZOrderProvider
|
||||
{
|
||||
void Draw(Rect rect, WindowState state);
|
||||
}
|
||||
|
||||
abstract class ItemsLayer<T> : ILayer where T : TimelineItemGUI
|
||||
{
|
||||
// provide a buffer for time-based culling to allow for UI that extends slightly beyond the time (e.g. markers)
|
||||
// prevents popping of marker visibility.
|
||||
const int kVisibilityBufferInPixels = 10;
|
||||
|
||||
int m_PreviousLayerStateHash = -1;
|
||||
LayerZOrder m_LastZOrder;
|
||||
|
||||
public LayerZOrder Next()
|
||||
{
|
||||
m_NeedSort = true;
|
||||
return m_LastZOrder++;
|
||||
}
|
||||
|
||||
readonly List<T> m_Items = new List<T>();
|
||||
bool m_NeedSort = true;
|
||||
|
||||
public virtual void Draw(Rect rect, WindowState state)
|
||||
{
|
||||
if (m_Items.Count <= 0) return;
|
||||
|
||||
Sort();
|
||||
|
||||
// buffer to prevent flickering of markers at boundaries
|
||||
var onePixelTime = state.PixelDeltaToDeltaTime(kVisibilityBufferInPixels);
|
||||
var visibleTime = state.timeAreaShownRange + new Vector2(-onePixelTime, onePixelTime);
|
||||
var layerViewStateHasChanged = GetLayerViewStateChanged(rect, state);
|
||||
|
||||
foreach (var item in m_Items)
|
||||
{
|
||||
item.visible = item.end > visibleTime.x && item.start < visibleTime.y;
|
||||
if (!item.visible)
|
||||
continue;
|
||||
|
||||
item.Draw(rect, layerViewStateHasChanged, state);
|
||||
}
|
||||
}
|
||||
|
||||
public List<T> items => m_Items;
|
||||
|
||||
protected void AddItem(T item)
|
||||
{
|
||||
m_Items.Add(item);
|
||||
m_NeedSort = true;
|
||||
}
|
||||
|
||||
protected ItemsLayer(Layer layerOrder)
|
||||
{
|
||||
m_LastZOrder = new LayerZOrder(layerOrder, 0);
|
||||
}
|
||||
|
||||
void Sort()
|
||||
{
|
||||
if (!m_NeedSort)
|
||||
return;
|
||||
|
||||
m_Items.Sort((a, b) => a.zOrder.CompareTo(b.zOrder));
|
||||
m_NeedSort = false;
|
||||
}
|
||||
|
||||
bool GetLayerViewStateChanged(Rect rect, WindowState state)
|
||||
{
|
||||
var layerStateHash = rect.GetHashCode().CombineHash(state.viewStateHash);
|
||||
var layerViewStateHasChanged = layerStateHash != m_PreviousLayerStateHash;
|
||||
|
||||
if (Event.current.type == EventType.Layout && layerViewStateHasChanged)
|
||||
m_PreviousLayerStateHash = layerStateHash;
|
||||
|
||||
return layerViewStateHasChanged;
|
||||
}
|
||||
}
|
||||
}
|
@@ -0,0 +1,11 @@
|
||||
fileFormatVersion: 2
|
||||
guid: ef97f39912c138b4cabdccedfb24093b
|
||||
MonoImporter:
|
||||
externalObjects: {}
|
||||
serializedVersion: 2
|
||||
defaultReferences: []
|
||||
executionOrder: 0
|
||||
icon: {instanceID: 0}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
@@ -0,0 +1,80 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using UnityEngine.Timeline;
|
||||
|
||||
namespace UnityEditor.Timeline
|
||||
{
|
||||
class MarkersLayer : ItemsLayer<TimelineItemGUI>
|
||||
{
|
||||
public MarkersLayer(Layer layerOrder, IRowGUI parent) : base(layerOrder)
|
||||
{
|
||||
CreateLists(parent);
|
||||
}
|
||||
|
||||
void CreateLists(IRowGUI parent)
|
||||
{
|
||||
var markerCount = parent.asset.GetMarkerCount();
|
||||
if (markerCount == 0) return;
|
||||
|
||||
var accumulator = new List<IMarker>();
|
||||
var sortedMarkers = new List<IMarker>(parent.asset.GetMarkers());
|
||||
var vm = TimelineWindowViewPrefs.GetTrackViewModelData(parent.asset);
|
||||
|
||||
sortedMarkers.Sort((lhs, rhs) =>
|
||||
{
|
||||
// Sort by time first
|
||||
var timeComparison = lhs.time.CompareTo(rhs.time);
|
||||
if (timeComparison != 0)
|
||||
return timeComparison;
|
||||
|
||||
// If there's a collision, sort by edit timestamp
|
||||
var lhsObject = lhs as object;
|
||||
var rhsObject = rhs as object;
|
||||
|
||||
if (lhsObject.Equals(null) || rhsObject.Equals(null))
|
||||
return 0;
|
||||
|
||||
var lhsHash = lhsObject.GetHashCode();
|
||||
var rhsHash = rhsObject.GetHashCode();
|
||||
|
||||
if (vm.markerTimeStamps.ContainsKey(lhsHash) && vm.markerTimeStamps.ContainsKey(rhsHash))
|
||||
return vm.markerTimeStamps[lhsHash].CompareTo(vm.markerTimeStamps[rhsHash]);
|
||||
|
||||
return 0;
|
||||
});
|
||||
|
||||
foreach (var current in sortedMarkers)
|
||||
{
|
||||
// TODO: Take zoom factor into account?
|
||||
if (accumulator.Count > 0 && Math.Abs(current.time - accumulator[accumulator.Count - 1].time) > TimeUtility.kTimeEpsilon)
|
||||
ProcessAccumulator(accumulator, parent);
|
||||
|
||||
accumulator.Add(current);
|
||||
}
|
||||
|
||||
ProcessAccumulator(accumulator, parent);
|
||||
}
|
||||
|
||||
void ProcessAccumulator(List<IMarker> accumulator, IRowGUI parent)
|
||||
{
|
||||
if (accumulator.Count == 0) return;
|
||||
|
||||
if (accumulator.Count == 1)
|
||||
{
|
||||
AddItem(new TimelineMarkerGUI(accumulator[0], parent, this));
|
||||
}
|
||||
else
|
||||
{
|
||||
// Ensure that the cluster is always considered *below* the markers it contains.
|
||||
var clusterZOrder = Next();
|
||||
AddItem(
|
||||
new TimelineMarkerClusterGUI(
|
||||
accumulator.Select(m => new TimelineMarkerGUI(m, parent, this)).ToList(),
|
||||
parent, this, clusterZOrder));
|
||||
}
|
||||
|
||||
accumulator.Clear();
|
||||
}
|
||||
}
|
||||
}
|
@@ -0,0 +1,11 @@
|
||||
fileFormatVersion: 2
|
||||
guid: bea62e1faac8f9a48a4cb919ea05cb6a
|
||||
MonoImporter:
|
||||
externalObjects: {}
|
||||
serializedVersion: 2
|
||||
defaultReferences: []
|
||||
executionOrder: 0
|
||||
icon: {instanceID: 0}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
@@ -0,0 +1,50 @@
|
||||
using System;
|
||||
using UnityEngine;
|
||||
using UnityEngine.Timeline;
|
||||
namespace UnityEditor.Timeline
|
||||
{
|
||||
class TrackDrawer : GUIDrawer
|
||||
{
|
||||
internal WindowState sequencerState { get; set; }
|
||||
|
||||
|
||||
public static TrackDrawer CreateInstance(TrackAsset trackAsset)
|
||||
{
|
||||
if (trackAsset == null)
|
||||
return Activator.CreateInstance<TrackDrawer>();
|
||||
|
||||
TrackDrawer drawer;
|
||||
|
||||
try
|
||||
{
|
||||
drawer = (TrackDrawer)Activator.CreateInstance(TimelineHelpers.GetCustomDrawer(trackAsset.GetType()));
|
||||
}
|
||||
catch (Exception)
|
||||
{
|
||||
drawer = Activator.CreateInstance<TrackDrawer>();
|
||||
}
|
||||
|
||||
drawer.track = trackAsset;
|
||||
return drawer;
|
||||
}
|
||||
|
||||
protected TrackAsset track { get; private set; }
|
||||
|
||||
public virtual bool HasCustomTrackHeaderButton()
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
public virtual void DrawTrackHeaderButton(Rect rect, WindowState state) { }
|
||||
|
||||
public virtual bool DrawTrack(Rect trackRect, TrackAsset trackAsset, Vector2 visibleTime, WindowState state)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
public virtual void DrawRecordingBackground(Rect trackRect, TrackAsset trackAsset, Vector2 visibleTime, WindowState state)
|
||||
{
|
||||
EditorGUI.DrawRect(trackRect, DirectorStyles.Instance.customSkin.colorTrackBackgroundRecording);
|
||||
}
|
||||
}
|
||||
}
|
@@ -0,0 +1,11 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 9a0f991b6c2f45b44b92e163f9969e8e
|
||||
MonoImporter:
|
||||
externalObjects: {}
|
||||
serializedVersion: 2
|
||||
defaultReferences: []
|
||||
executionOrder: 0
|
||||
icon: {instanceID: 0}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
@@ -0,0 +1,38 @@
|
||||
using System.Collections.Generic;
|
||||
using UnityEngine;
|
||||
|
||||
namespace UnityEditor.Timeline
|
||||
{
|
||||
struct TrackItemsDrawer
|
||||
{
|
||||
List<ILayer> m_Layers;
|
||||
ClipsLayer m_ClipsLayer;
|
||||
|
||||
public List<TimelineClipGUI> clips => m_ClipsLayer.items;
|
||||
|
||||
public TrackItemsDrawer(IRowGUI parent)
|
||||
{
|
||||
m_Layers = null;
|
||||
m_ClipsLayer = null;
|
||||
BuildGUICache(parent);
|
||||
}
|
||||
|
||||
void BuildGUICache(IRowGUI parent)
|
||||
{
|
||||
m_ClipsLayer = new ClipsLayer(Layer.Clips, parent);
|
||||
m_Layers = new List<ILayer>
|
||||
{
|
||||
m_ClipsLayer,
|
||||
new MarkersLayer(Layer.Markers, parent)
|
||||
};
|
||||
}
|
||||
|
||||
public void Draw(Rect rect, WindowState state)
|
||||
{
|
||||
foreach (var layer in m_Layers)
|
||||
{
|
||||
layer.Draw(rect, state);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
@@ -0,0 +1,11 @@
|
||||
fileFormatVersion: 2
|
||||
guid: c7137daaeb11e8647bf1ade9b7e9aa97
|
||||
MonoImporter:
|
||||
externalObjects: {}
|
||||
serializedVersion: 2
|
||||
defaultReferences: []
|
||||
executionOrder: 0
|
||||
icon: {instanceID: 0}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
Reference in New Issue
Block a user