fix: NetworkSceneManager add do not load during callback note in xml documentation [MTT-3495]#1974
Conversation
| /// delegate type <see cref="NetworkSceneManager.SceneEventDelegate"/> uses this class to provide | ||
| /// scene event status.<br/> | ||
| /// <em>Note: This is only when <see cref="NetworkConfig.EnableSceneManagement"/> is enabled.</em><br/> | ||
| /// <em>*** Do not start new scene events within scene event notification callbacks.</em><br/> |
There was a problem hiding this comment.
Should we have (or is there) any mechanism to detect and prevent such scene events ?
There was a problem hiding this comment.
Why yes there is!
Both NetworkSceneManager.LoadScene and NetworkSceneManager.UnloadScene return a SceneEventProgressStatus.
If you invoke that in the middle of a scene event NetworkSceneManager will return SceneEventProgressStatus.SceneEventInProgress which tells/reminds the user "You are in the middle of a scene event, let it finish completely before trying to start a new one".
The same thing would happen if you tried to load (n) scenes all at the same time and called NetworkSceneManager.LoadScene within some method. The first call (iteration 0) it would return SceneEventProgressStatus.Started and then for every other call (up to n) it would return SceneEventProgressStatus.SceneEventInProgress.
So, this is PR is just to remind users when they are looking through the API that you can't start a new scene event until any current scene events are still in progress.
…ceneManager.cs Co-authored-by: Fatih Mar <mfatihmar@gmail.com>
This should fix the edge case scenario exposed on Mac Desktop. This PR originally only modified comments, but it continued to fail in the one spot we were not using a WaitForConditionOrTimeOut.
…add-do-not-load-during-callback-note
This pertains to #1942 and was determined that the API documentation needs to be updated to let users know not to start new scene events within a scene event callback. This PR adds the additional XML documentation.
MTT-3495
Testing and Documentation