Re: Fade from Black not triggering
Posted: Thu Jul 08, 2021 9:35 am
Hi Rob,
Can you send a reproduction project to tony (at) pixelcrushers.com?
If not, can you try this debug version of StandardSceneTransitionManager.cs?
Debug_StandardSceneTransitionManager_2021-07-08.unitypackage
It will log frame-by-frame animator activity similar to:
You may see a frame or two at the beginning of the Enter Scene Transition animation where it's not in the animator state yet, so the progress is off. But then it should start near zero. When it's done, the logs will start showing the Nothing state. Make sure your Standard Scene Transition Manager's Enter Scene Transition > Animation Duration is at least 1 (the duration of the animation clip) for this test.
Other notes:
Your code looks fine. UsePortal() calls SaveSystem.LoadScene(), which starts the coroutine that handles fading and scene loading.
Side note: In a C# script, you don't have to use:
SaveSystemMethods is a wrapper for the SaveSystem class. It's useful to hook into SaveSystem in inspector UnityEvents. In C#, you can call SaveSystem directly:
Can you send a reproduction project to tony (at) pixelcrushers.com?
If not, can you try this debug version of StandardSceneTransitionManager.cs?
Debug_StandardSceneTransitionManager_2021-07-08.unitypackage
It will log frame-by-frame animator activity similar to:
Code: Select all
Leave Scene Transition ended on frame 1205
Enter Scene Transition started on frame 1216. Triggering Hide.
Enter Scene Transition frame 1218: state=Fade From Black, progress=0.1220562
Enter Scene Transition frame 1219: state=Fade From Black, progress=0.2312012
...
Enter Scene Transition ended on frame 1423
Other notes:
Your code looks fine. UsePortal() calls SaveSystem.LoadScene(), which starts the coroutine that handles fading and scene loading.
Side note: In a C# script, you don't have to use:
Code: Select all
GetComponent<SaveSystemMethods>().LoadFromSlot(0);
Code: Select all
SaveSystem.LoadFromSlot(0);