Here are the examples of the csharp api UnityEngine.Timeline.AnimationTrack.ApplyTrackOffset(UnityEngine.Playables.PlayableGraph, UnityEngine.Playables.Playable, UnityEngine.GameObject, UnityEngine.Timeline.AppliedOffsetMode) taken from open source projects. By voting up you can indicate which examples are most useful and appropriate.
4 Examples
19
View Source File : AnimationTrack.cs
License : MIT License
Project Creator : BattleDawnNZ
License : MIT License
Project Creator : BattleDawnNZ
Playable CompileTrackPlayable(PlayableGraph graph, Trackreplacedet track, GameObject go, IntervalTree<RuntimeElement> tree, AppliedOffsetMode mode)
{
var mixer = AnimationMixerPlayable.Create(graph, track.clips.Length);
for (int i = 0; i < track.clips.Length; i++)
{
var c = track.clips[i];
var replacedet = c.replacedet as Playablereplacedet;
if (replacedet == null)
continue;
var animationreplacedet = replacedet as AnimationPlayablereplacedet;
if (animationreplacedet != null)
animationreplacedet.appliedOffsetMode = mode;
var source = replacedet.CreatePlayable(graph, go);
if (source.IsValid())
{
var clip = new RuntimeClip(c, source, mixer);
tree.Add(clip);
graph.Connect(source, 0, mixer, i);
mixer.SetInputWeight(i, 0.0f);
}
}
return ApplyTrackOffset(graph, mixer, go, mode);
}
19
View Source File : AnimationTrack.cs
License : MIT License
Project Creator : BattleDawnNZ
License : MIT License
Project Creator : BattleDawnNZ
Playable CreateInfiniteTrackPlayable(PlayableGraph graph, GameObject go, IntervalTree<RuntimeElement> tree, AppliedOffsetMode mode)
{
if (m_InfiniteClip == null)
return Playable.Null;
var mixer = AnimationMixerPlayable.Create(graph, 1);
// In infinite mode, we always force the loop mode of the clip off because the clip keys are offset in infinite mode
// which causes loop to behave different.
// The inline curve editor never shows loops in infinite mode.
var playable = AnimationPlayablereplacedet.CreatePlayable(graph, m_InfiniteClip, m_InfiniteClipOffsetPosition, m_InfiniteClipOffsetEulerAngles, false, mode, infiniteClipApplyFootIK, AnimationPlayablereplacedet.LoopMode.Off);
if (playable.IsValid())
{
tree.Add(new InfiniteRuntimeClip(playable));
graph.Connect(playable, 0, mixer, 0);
mixer.SetInputWeight(0, 1.0f);
}
return ApplyTrackOffset(graph, mixer, go, mode);
}
19
View Source File : AnimationTrack.cs
License : Creative Commons Zero v1.0 Universal
Project Creator : Madalaski
License : Creative Commons Zero v1.0 Universal
Project Creator : Madalaski
Playable CompileTrackPlayable(PlayableGraph graph, AnimationTrack track, GameObject go, IntervalTree<RuntimeElement> tree, AppliedOffsetMode mode)
{
var mixer = AnimationMixerPlayable.Create(graph, track.clips.Length);
for (int i = 0; i < track.clips.Length; i++)
{
var c = track.clips[i];
var replacedet = c.replacedet as Playablereplacedet;
if (replacedet == null)
continue;
var animationreplacedet = replacedet as AnimationPlayablereplacedet;
if (animationreplacedet != null)
animationreplacedet.appliedOffsetMode = mode;
var source = replacedet.CreatePlayable(graph, go);
if (source.IsValid())
{
var clip = new RuntimeClip(c, source, mixer);
tree.Add(clip);
graph.Connect(source, 0, mixer, i);
mixer.SetInputWeight(i, 0.0f);
}
}
if (!track.AnimatesRootTransform())
return mixer;
return ApplyTrackOffset(graph, mixer, go, mode);
}
19
View Source File : AnimationTrack.cs
License : Creative Commons Zero v1.0 Universal
Project Creator : Madalaski
License : Creative Commons Zero v1.0 Universal
Project Creator : Madalaski
Playable CreateInfiniteTrackPlayable(PlayableGraph graph, GameObject go, IntervalTree<RuntimeElement> tree, AppliedOffsetMode mode)
{
if (m_InfiniteClip == null)
return Playable.Null;
var mixer = AnimationMixerPlayable.Create(graph, 1);
// In infinite mode, we always force the loop mode of the clip off because the clip keys are offset in infinite mode
// which causes loop to behave different.
// The inline curve editor never shows loops in infinite mode.
var playable = AnimationPlayablereplacedet.CreatePlayable(graph, m_InfiniteClip, m_InfiniteClipOffsetPosition, m_InfiniteClipOffsetEulerAngles, false, mode, infiniteClipApplyFootIK, AnimationPlayablereplacedet.LoopMode.Off);
if (playable.IsValid())
{
tree.Add(new InfiniteRuntimeClip(playable));
graph.Connect(playable, 0, mixer, 0);
mixer.SetInputWeight(0, 1.0f);
}
if (!AnimatesRootTransform())
return mixer;
var rootTrack = isSubTrack ? (AnimationTrack)parent : this;
return rootTrack.ApplyTrackOffset(graph, mixer, go, mode);
}