ProjektMWS/Projekt MWS/Library/PackageCache/com.unity.timeline@1.4.6/Editor/treeview/AnimationTrackKeyDataSource.cs

26 lines
714 B
C#
Raw Normal View History

2021-06-28 19:31:12 +02:00
using UnityEngine;
using UnityEngine.Timeline;
// Data sources for key overlays
namespace UnityEditor.Timeline
{
// Used for key overlays manipulators
class AnimationTrackKeyDataSource : BasePropertyKeyDataSource
{
readonly float m_TrackOffset;
protected override AnimationClip animationClip { get; }
public AnimationTrackKeyDataSource(AnimationTrack track)
{
animationClip = track != null ? track.infiniteClip : null;
m_TrackOffset = track != null ? (float)track.infiniteClipTimeOffset : 0.0f;
}
protected override float TransformKeyTime(float keyTime)
{
return keyTime + m_TrackOffset;
}
}
}