Skip to content

Commit

Permalink
bugfix
Browse files Browse the repository at this point in the history
  • Loading branch information
lejeanf committed Aug 29, 2024
1 parent e87c864 commit fba1516
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 6 deletions.
11 changes: 6 additions & 5 deletions Runtime/Listeners/TimelineTriggerEventListener.cs
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,8 @@ public bool isDebug

[SerializeField] private TimelineTriggerEventChannelSO _channel;
[SerializeField] private PlayableDirector _playableDirectorToControl;
private PlayState _lastPlayableState;

[Tooltip("Use this if you want to override the timeline assigned to the playable director.")]
[SerializeField] private bool assignTimelineToPlayableDirector = true;
[Space(10)]
Expand All @@ -40,15 +42,13 @@ public bool isDebug

private void OnEnable()
{
if (_channel != null)
_channel.OnEventRaised += Respond;
if (_channel != null) _channel.OnEventRaised += Respond;
if (generalPauseEvent) generalPauseEvent.OnEventRaised += Pause;
}

private void OnDisable()
{
if (_channel != null)
_channel.OnEventRaised -= Respond;
if (_channel != null) _channel.OnEventRaised -= Respond;
if (generalPauseEvent) generalPauseEvent.OnEventRaised -= Pause;
}

Expand All @@ -65,10 +65,11 @@ private void Respond(PlayableAsset timeline, bool value)
{
_playableDirectorToControl.Stop();
}

_lastPlayableState = _playableDirectorToControl.state;
if(isDebug) Debug.Log($" timeline-bool event raised: <{timeline},{value}>");
}

private PlayState _lastPlayableState;
private void Pause(bool state)
{
switch (state)
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "fr.jeanf.eventsystem",
"version": "0.1.115",
"version": "0.1.116",
"displayName": "Event System",
"description": "This package contains a basic Event System based on Scriptable Objects as communication medium",
"unity": "2021.3",
Expand Down

0 comments on commit fba1516

Please sign in to comment.