A game about forced loneliness, made by TACStudios
at master 89 lines 4.8 kB view raw
1using System; 2using System.Collections.Generic; 3using UnityEngine; 4using UnityEngine.Playables; 5 6namespace UnityEngine.Timeline 7{ 8 /// <summary> 9 /// This class is deprecated. It is recommended to use Playable Asset and Playable Behaviour derived classes instead. 10 /// </summary> 11 [Serializable] 12 [Obsolete("For best performance use PlayableAsset and PlayableBehaviour.")] 13 public class BasicPlayableBehaviour : ScriptableObject, IPlayableAsset, IPlayableBehaviour 14 { 15 /// <summary> 16 /// The playback duration in seconds of the instantiated Playable. 17 /// </summary> 18 public virtual double duration { get { return PlayableBinding.DefaultDuration; } } 19 20 /// <summary> 21 ///A description of the outputs of the instantiated Playable. 22 /// </summary> 23 public virtual IEnumerable<PlayableBinding> outputs { get { return PlayableBinding.None; } } 24 25 /// <summary> 26 /// <para>This function is called when the PlayableGraph that owns this PlayableBehaviour starts.</para> 27 /// </summary> 28 /// <param name="playable">The Playable that owns the current PlayableBehaviour.</param> 29 public virtual void OnGraphStart(Playable playable) { } 30 31 /// <summary> 32 /// <para>This function is called when the PlayableGraph that owns this PlayableBehaviour stops.</para> 33 /// </summary> 34 /// <param name="playable">The Playable that owns the current PlayableBehaviour.</param> 35 public virtual void OnGraphStop(Playable playable) { } 36 37 /// <summary> 38 /// <para>This function is called when the Playable that owns the PlayableBehaviour is created.</para> 39 /// </summary> 40 /// <param name="playable">The Playable that owns the current PlayableBehaviour.</param> 41 public virtual void OnPlayableCreate(Playable playable) { } 42 43 /// <summary> 44 /// <para>This function is called when the Playable that owns the PlayableBehaviour is destroyed.</para> 45 /// </summary> 46 /// <param name="playable">The Playable that owns the current PlayableBehaviour.</param> 47 public virtual void OnPlayableDestroy(Playable playable) { } 48 49 /// <summary> 50 /// <para>This function is called when the Playable play state is changed to Playables.PlayState.Playing.</para> 51 /// </summary> 52 /// <param name="playable">The Playable that owns the current PlayableBehaviour.</param> 53 /// <param name="info">A FrameData structure that contains information about the current frame context.</param> 54 public virtual void OnBehaviourPlay(Playable playable, FrameData info) { } 55 56 /// <summary> 57 /// <para>This function is called when the Playable play state is changed to Playables.PlayState.Paused.</para> 58 /// </summary> 59 /// <param name="playable">The Playable that owns the current PlayableBehaviour.</param> 60 /// <param name="info">A FrameData structure that contains information about the current frame context.</param> 61 public virtual void OnBehaviourPause(Playable playable, FrameData info) { } 62 63 /// <summary> 64 /// <para>This function is called during the PrepareFrame phase of the PlayableGraph.</para> 65 /// </summary> 66 /// <param name="playable">The Playable that owns the current PlayableBehaviour.</param> 67 /// <param name="info">A FrameData structure that contains information about the current frame context.</param> 68 public virtual void PrepareFrame(Playable playable, FrameData info) { } 69 70 /// <summary> 71 /// <para>This function is called during the ProcessFrame phase of the PlayableGraph.</para> 72 /// </summary> 73 /// <param name="playable">The Playable that owns the current PlayableBehaviour.</param> 74 /// <param name="info">A FrameData structure that contains information about the current frame context.</param> 75 /// <param name="playerData">The user data of the ScriptPlayableOutput that initiated the process pass.</param> 76 public virtual void ProcessFrame(Playable playable, FrameData info, object playerData) { } 77 78 /// <summary> 79 /// Implement this method to have your asset inject playables into the given graph. 80 /// </summary> 81 /// <param name="graph">The graph to inject playables into.</param> 82 /// <param name="owner">The game object which initiated the build.</param> 83 /// <returns>The playable injected into the graph, or the root playable if multiple playables are injected.</returns> 84 public virtual Playable CreatePlayable(PlayableGraph graph, GameObject owner) 85 { 86 return ScriptPlayable<BasicPlayableBehaviour>.Create(graph, this); 87 } 88 } 89}