fr.jeanf.eventsystem 0.1.114 → 0.1.115

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -68,16 +68,21 @@ namespace jeanf.EventSystem
68
68
  if(isDebug) Debug.Log($" timeline-bool event raised: <{timeline},{value}>");
69
69
  }
70
70
 
71
+ private PlayState _lastPlayableState;
71
72
  private void Pause(bool state)
72
73
  {
73
- if (state)
74
+ switch (state)
74
75
  {
75
- _playableDirectorToControl.Pause();
76
- }
77
- else
78
- {
79
- _playableDirectorToControl.Play();
76
+ case true when _lastPlayableState == PlayState.Playing:
77
+ _playableDirectorToControl.Pause();
78
+ break;
79
+
80
+ case false when _lastPlayableState == PlayState.Paused:
81
+ _playableDirectorToControl.Play();
82
+ break;
80
83
  }
84
+
85
+ _lastPlayableState = _playableDirectorToControl.state;
81
86
  }
82
87
  }
83
88
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "fr.jeanf.eventsystem",
3
- "version": "0.1.114",
3
+ "version": "0.1.115",
4
4
  "displayName": "Event System",
5
5
  "description": "This package contains a basic Event System based on Scriptable Objects as communication medium",
6
6
  "unity": "2021.3",