16 public class EventClip : PlayableAsset, ITimelineClipAsset {
25 [Header(
"Event Argument")]
26 [SerializeField, OnEditorChange(
"argumentType")]
33 _argumentType = value;
34 if (!_userSetScrubType) {
54 [Header(
"Scrubbing Behavior (Play-mode Only, Optional)")]
55 [SerializeField, OnEditorChange(
"eventScrubType")]
56 [Tooltip(
"This field only affects event-firing behavior when moving the playhead "
57 +
"backwards across an event clip. Trigger events, such as sound effects, will "
58 +
"only fire when the playhead moves forward past a clip's start time. "
59 +
"State changes, such as setting an object's Color or a Text value, will fire "
60 +
"the previous event when the playhead scrubs backward across a given event's "
61 +
"start time, reflecting the state of the object since the last state change. "
62 +
"Cumulative State Change events work like State Change events, but fire "
63 +
"all events from the first event up to and including the previous event.")]
67 return _eventScrubType;
70 _userSetScrubType =
true;
71 _eventScrubType = value;
74 [SerializeField, HideInInspector]
75 private bool _userSetScrubType =
false;
82 get {
return ClipCaps.None; }
91 #region PlayableAsset Implementation
93 public override Playable
CreatePlayable(PlayableGraph graph, GameObject owner) {
94 var playable = ScriptPlayable<EventPlayableBehaviour>.Create(graph, inputCount: 0);
95 this.behaviour = playable.GetBehaviour();
98 this.behaviour.
argument = getArgument();
103 private object getArgument() {
104 switch (_argumentType) {
128 #region Public Methods
131 if (this.behaviour ==
null) {
132 Debug.LogError(
"Unable to fire event: PlayableBehaviour has not been constructed. "
133 +
"Are you attempting to invoke the clip from outside a PlayableGraph "
EventPlayableBehaviour behaviour
EventScrubType eventScrubType
ExposedReference< GameObject > recipient
override Playable CreatePlayable(PlayableGraph graph, GameObject owner)
SerializedArgumentType argumentType