You cannot select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
29 lines
886 B
C#
29 lines
886 B
C#
|
3 years ago
|
using UnityEngine.Formats.Alembic.Importer;
|
||
|
|
using UnityEngine.Playables;
|
||
|
|
|
||
|
|
namespace UnityEngine.Formats.Alembic.Timeline
|
||
|
|
{
|
||
|
|
internal class AlembicShotPlayable : PlayableBehaviour
|
||
|
|
{
|
||
|
|
public AlembicStreamPlayer streamPlayer { get; set; }
|
||
|
|
|
||
|
|
public override void ProcessFrame(Playable playable, FrameData info, object playerData)
|
||
|
|
{
|
||
|
|
if (streamPlayer == null)
|
||
|
|
return;
|
||
|
|
|
||
|
|
var duration = streamPlayer.Duration;
|
||
|
|
var time = playable.GetTime();
|
||
|
|
streamPlayer.CurrentTime = (float)(time >= duration ? duration : time % duration);
|
||
|
|
if (info.evaluationType == FrameData.EvaluationType.Playback)
|
||
|
|
{
|
||
|
|
streamPlayer.Update();
|
||
|
|
}
|
||
|
|
else
|
||
|
|
{
|
||
|
|
streamPlayer.UpdateImmediately(streamPlayer.CurrentTime);
|
||
|
|
}
|
||
|
|
}
|
||
|
|
}
|
||
|
|
}
|