hello here,
I made a individual pause Function using UGUI( i made it into a perfab), it works well in all projects except projects using timeline animations.
I use timeline api for pause and resume, it can pause the graphs but when i trigger the proceed button, the next graphs( at the same clip) acts oddly, for example, in an explosion scene clip, some models should have been blown up and fallen down, but the fact is the models becomes relatively static and remain in the scene all the time, just like they are locked, untill the next timeline clip triggered, they are still there, the next timeline clip acts well.
the following code is what i made to realize pause and resume play functions, i have wasted a whole afternoon tring to fix it, but not solve it yet. is there any resolutions? Thanks for your help.
`private PlayableDirector[] Pd = null;
void Start()
{
Pd = Resources.FindObjectsOfTypeAll(typeof(PlayableDirector)) as PlayableDirector[];
}
void PauseButtonFunc()
{
if (currentVideoPlayer != null && currentVideoPlayer.isPlaying)
{
currentVideoPlayer.Pause();
}
AudioListener.pause = true;
if (Pd != null)
{
for (int i = 0; i < Pd.Length; i++)
{
if (Pd[i].isActiveAndEnabled)
{
Pd[i].Pause();
}
}
}
The unity-technology gave me a solution and my current problems were solved, but i still don't know how playabledirector.pause() and playabledirector.play() works. Are there bugs exited?
hello here, I made a individual pause Function using UGUI( i made it into a perfab), it works well in all projects except projects using timeline animations. I use timeline api for pause and resume, it can pause the graphs but when i trigger the proceed button, the next graphs( at the same clip) acts oddly, for example, in an explosion scene clip, some models should have been blown up and fallen down, but the fact is the models becomes relatively static and remain in the scene all the time, just like they are locked, untill the next timeline clip triggered, they are still there, the next timeline clip acts well.
the following code is what i made to realize pause and resume play functions, i have wasted a whole afternoon tring to fix it, but not solve it yet. is there any resolutions? Thanks for your help.
`private PlayableDirector[] Pd = null;
void Start() { Pd = Resources.FindObjectsOfTypeAll(typeof(PlayableDirector)) as PlayableDirector[]; }
void PauseButtonFunc() { if (currentVideoPlayer != null && currentVideoPlayer.isPlaying) {
}
void ProceedButtonFunc() {
if (currentVideoPlayer!=null && !currentVideoPlayer.isPlaying) { currentVideoPlayer.Play(); } AudioListener.pause = false; Time.timeScale = 1;
}`