ZMWSLI0-SL2021-GR11/cw1/clock/Library/PackageCache/com.unity.timeline@1.2.18/Runtime/Evaluation/InfiniteRuntimeClip.cs

47 lines
1.1 KiB
C#
Raw Normal View History

2021-04-10 17:27:42 +02:00
using System;
using UnityEngine.Playables;
namespace UnityEngine.Timeline
{
/// <summary>
/// Runtime clip customized for 'infinite' tracks playables.
/// Used for clips whose time needs to match the timelines exactly
/// </summary>
class InfiniteRuntimeClip : RuntimeElement
{
private Playable m_Playable;
private static readonly Int64 kIntervalEnd = DiscreteTime.GetNearestTick(TimelineClip.kMaxTimeValue);
public InfiniteRuntimeClip(Playable playable)
{
m_Playable = playable;
}
public override Int64 intervalStart
{
get { return 0; }
}
public override Int64 intervalEnd
{
get { return kIntervalEnd; }
}
public override bool enable
{
set
{
if (value)
m_Playable.Play();
else
m_Playable.Pause();
}
}
public override void EvaluateAt(double localTime, FrameData frameData)
{
m_Playable.SetTime(localTime);
}
}
}