fr.jeanf.eventsystem 0.1.120 → 0.1.121
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.
|
@@ -30,7 +30,7 @@ namespace jeanf.EventSystem
|
|
|
30
30
|
|
|
31
31
|
[SerializeField] private TimelineTriggerEventChannelSO _channel;
|
|
32
32
|
[SerializeField] private PlayableDirector _playableDirectorToControl;
|
|
33
|
-
private PlayState
|
|
33
|
+
private PlayState _lastKnownPlayableState;
|
|
34
34
|
|
|
35
35
|
[Tooltip("Use this if you want to override the timeline assigned to the playable director.")]
|
|
36
36
|
[SerializeField] private bool assignTimelineToPlayableDirector = true;
|
|
@@ -66,14 +66,14 @@ namespace jeanf.EventSystem
|
|
|
66
66
|
_playableDirectorToControl.RebuildGraph();
|
|
67
67
|
_playableDirectorToControl.Play();
|
|
68
68
|
isStop = false;
|
|
69
|
-
|
|
69
|
+
_lastKnownPlayableState = _playableDirectorToControl.state;
|
|
70
70
|
if(isDebug) Debug.Log($"received timeline: playing {timeline.name}, isStop: {isStop}, _playableDirectorToControl.state {_playableDirectorToControl.state}");
|
|
71
71
|
}
|
|
72
72
|
else
|
|
73
73
|
{
|
|
74
74
|
isStop = true;
|
|
75
75
|
_playableDirectorToControl.Stop();
|
|
76
|
-
|
|
76
|
+
_lastKnownPlayableState = _playableDirectorToControl.state;
|
|
77
77
|
if(isDebug) Debug.Log($"received timeline: stoping {timeline.name}, isStop: {isStop}, _playableDirectorToControl.state {_playableDirectorToControl.state}");
|
|
78
78
|
}
|
|
79
79
|
|
|
@@ -82,17 +82,18 @@ namespace jeanf.EventSystem
|
|
|
82
82
|
|
|
83
83
|
private void Pause(bool state) // true = pause ... false = unpause
|
|
84
84
|
{
|
|
85
|
+
if(isDebug) Debug.Log($"isStop = {isStop}, state {state}, _lastPlayableState {_lastKnownPlayableState}");
|
|
85
86
|
if(isStop) return;
|
|
86
87
|
|
|
87
|
-
switch (
|
|
88
|
+
switch (_lastKnownPlayableState)
|
|
88
89
|
{
|
|
89
90
|
case PlayState.Playing:
|
|
90
91
|
if (state)
|
|
91
92
|
{
|
|
92
93
|
_playableDirectorToControl.Pause();
|
|
93
|
-
|
|
94
|
+
_lastKnownPlayableState = _playableDirectorToControl.state;
|
|
94
95
|
|
|
95
|
-
if(isDebug) Debug.Log($"_lastPlayableState =
|
|
96
|
+
if(isDebug) Debug.Log($"_lastPlayableState = {_lastKnownPlayableState} : pausing the timeline");
|
|
96
97
|
}
|
|
97
98
|
break;
|
|
98
99
|
|
|
@@ -101,8 +102,8 @@ namespace jeanf.EventSystem
|
|
|
101
102
|
{
|
|
102
103
|
isStop = false;
|
|
103
104
|
_playableDirectorToControl.Play();
|
|
104
|
-
|
|
105
|
-
if(isDebug) Debug.Log($"_lastPlayableState =
|
|
105
|
+
_lastKnownPlayableState = _playableDirectorToControl.state;
|
|
106
|
+
if(isDebug) Debug.Log($"_lastPlayableState = {_lastKnownPlayableState} : continuing playing the timeline");
|
|
106
107
|
}
|
|
107
108
|
break;
|
|
108
109
|
case PlayState.Delayed:
|
package/package.json
CHANGED