summaryrefslogtreecommitdiff
path: root/Library/PackageCache/com.unity.timeline@1.2.13/Runtime/Playables/TimeControlPlayable.cs
diff options
context:
space:
mode:
authorAndrew Lee <alee14498@protonmail.com>2020-08-20 23:40:50 -0400
committerAndrew Lee <alee14498@protonmail.com>2020-08-20 23:40:50 -0400
commit3af4c218c0e70167db23a6303d2af30aff37d2fe (patch)
tree927f29edcf54ab562f40f3d1c6cb69287c7f5980 /Library/PackageCache/com.unity.timeline@1.2.13/Runtime/Playables/TimeControlPlayable.cs
parentb6daed0af784f4e9bc13329dd87c671b06ee1c65 (diff)
downloadProject-Sandbox-3af4c218c0e70167db23a6303d2af30aff37d2fe.tar.gz
Project-Sandbox-3af4c218c0e70167db23a6303d2af30aff37d2fe.tar.bz2
Project-Sandbox-3af4c218c0e70167db23a6303d2af30aff37d2fe.zip
Removed a bunch of stuff; Changes
Diffstat (limited to 'Library/PackageCache/com.unity.timeline@1.2.13/Runtime/Playables/TimeControlPlayable.cs')
-rw-r--r--Library/PackageCache/com.unity.timeline@1.2.13/Runtime/Playables/TimeControlPlayable.cs85
1 files changed, 0 insertions, 85 deletions
diff --git a/Library/PackageCache/com.unity.timeline@1.2.13/Runtime/Playables/TimeControlPlayable.cs b/Library/PackageCache/com.unity.timeline@1.2.13/Runtime/Playables/TimeControlPlayable.cs
deleted file mode 100644
index 68ec80d..0000000
--- a/Library/PackageCache/com.unity.timeline@1.2.13/Runtime/Playables/TimeControlPlayable.cs
+++ /dev/null
@@ -1,85 +0,0 @@
-using UnityEngine.Playables;
-
-namespace UnityEngine.Timeline
-{
- /// <summary>
- /// A PlayableBehaviour that manages a component that implements the ITimeControl interface
- /// </summary>
- public class TimeControlPlayable : PlayableBehaviour
- {
- ITimeControl m_timeControl;
-
- bool m_started;
-
- /// <summary>
- /// Creates a Playable with a TimeControlPlayable behaviour attached
- /// </summary>
- /// <param name="graph">The PlayableGraph to inject the Playable into.</param>
- /// <param name="timeControl"></param>
- /// <returns></returns>
- public static ScriptPlayable<TimeControlPlayable> Create(PlayableGraph graph, ITimeControl timeControl)
- {
- if (timeControl == null)
- return ScriptPlayable<TimeControlPlayable>.Null;
-
- var handle = ScriptPlayable<TimeControlPlayable>.Create(graph);
- handle.GetBehaviour().Initialize(timeControl);
- return handle;
- }
-
- /// <summary>
- /// Initializes the behaviour
- /// </summary>
- /// <param name="timeControl">Component that implements the ITimeControl interface</param>
- public void Initialize(ITimeControl timeControl)
- {
- m_timeControl = timeControl;
- }
-
- /// <summary>
- /// This function is called during the PrepareFrame phase of the PlayableGraph.
- /// </summary>
- /// <param name="playable">The Playable that owns the current PlayableBehaviour.</param>
- /// <param name="info">A FrameData structure that contains information about the current frame context.</param>
- public override void PrepareFrame(Playable playable, FrameData info)
- {
- Debug.Assert(m_started, "PrepareFrame has been called without OnControlTimeStart being called first.");
- if (m_timeControl != null)
- m_timeControl.SetTime(playable.GetTime());
- }
-
- /// <summary>
- /// This function is called when the Playable play state is changed to Playables.PlayState.Playing.
- /// </summary>
- /// <param name="playable">The Playable that owns the current PlayableBehaviour.</param>
- /// <param name="info">A FrameData structure that contains information about the current frame context.</param>
- public override void OnBehaviourPlay(Playable playable, FrameData info)
- {
- if (m_timeControl == null)
- return;
-
- if (!m_started)
- {
- m_timeControl.OnControlTimeStart();
- m_started = true;
- }
- }
-
- /// <summary>
- /// This function is called when the Playable play state is changed to PlayState.Paused.
- /// </summary>
- /// <param name="playable">The playable this behaviour is attached to.</param>
- /// <param name="info">A FrameData structure that contains information about the current frame context.</param>
- public override void OnBehaviourPause(Playable playable, FrameData info)
- {
- if (m_timeControl == null)
- return;
-
- if (m_started)
- {
- m_timeControl.OnControlTimeStop();
- m_started = false;
- }
- }
- }
-}