using System;
using System.Collections.Generic;
using UnityEngine;
using UnityEngine.Playables;
namespace UnityEngine.Timeline
{
///
/// This class is deprecated. It is recommended to use Playable Asset and Playable Behaviour derived classes instead.
///
[Serializable]
[Obsolete("For best performance use PlayableAsset and PlayableBehaviour.")]
public class BasicPlayableBehaviour : ScriptableObject, IPlayableAsset, IPlayableBehaviour
{
public BasicPlayableBehaviour() {}
///
/// The playback duration in seconds of the instantiated Playable.
///
public virtual double duration { get { return PlayableBinding.DefaultDuration; } }
///
///A description of the outputs of the instantiated Playable.
///
public virtual IEnumerable outputs { get { return PlayableBinding.None; } }
///
/// This function is called when the PlayableGraph that owns this PlayableBehaviour starts.
///
/// The Playable that owns the current PlayableBehaviour.
public virtual void OnGraphStart(Playable playable) {}
///
/// This function is called when the PlayableGraph that owns this PlayableBehaviour stops.
///
/// The Playable that owns the current PlayableBehaviour.
public virtual void OnGraphStop(Playable playable) {}
///
/// This function is called when the Playable that owns the PlayableBehaviour is created.
///
/// The Playable that owns the current PlayableBehaviour.
public virtual void OnPlayableCreate(Playable playable) {}
///
/// This function is called when the Playable that owns the PlayableBehaviour is destroyed.
///
/// The Playable that owns the current PlayableBehaviour.
public virtual void OnPlayableDestroy(Playable playable) {}
///
/// This function is called when the Playable play state is changed to Playables.PlayState.Playing.
///
/// The Playable that owns the current PlayableBehaviour.
/// A FrameData structure that contains information about the current frame context.
public virtual void OnBehaviourPlay(Playable playable, FrameData info) {}
///
/// This function is called when the Playable play state is changed to Playables.PlayState.Paused.
///
/// The Playable that owns the current PlayableBehaviour.
/// A FrameData structure that contains information about the current frame context.
public virtual void OnBehaviourPause(Playable playable, FrameData info) {}
///
/// This function is called during the PrepareFrame phase of the PlayableGraph.
///
/// The Playable that owns the current PlayableBehaviour.
/// A FrameData structure that contains information about the current frame context.
public virtual void PrepareFrame(Playable playable, FrameData info) {}
///
/// This function is called during the ProcessFrame phase of the PlayableGraph.
///
/// The Playable that owns the current PlayableBehaviour.
/// A FrameData structure that contains information about the current frame context.
/// The user data of the ScriptPlayableOutput that initiated the process pass.
public virtual void ProcessFrame(Playable playable, FrameData info, object playerData) {}
///
/// Implement this method to have your asset inject playables into the given graph.
///
/// The graph to inject playables into.
/// The game object which initiated the build.
/// The playable injected into the graph, or the root playable if multiple playables are injected.
public virtual Playable CreatePlayable(PlayableGraph graph, GameObject owner)
{
return ScriptPlayable.Create(graph, this);
}
}
}