Cancelling SceneManager.LoadSceneAsync() / .UnloadSceneAsync() that has been converted to UniTask #513
Unanswered
HenrysHouses
asked this question in
Q&A
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
I've tried reading the documentation, I looked through the discussions here and googled it but i couldn't find an answer to this. So I'll just have to ask it here.
I am making a scene managing solution for my projects so my question is: How does UniTask handle cancellation of scene loading?
for a little context. In normal unity behavior it is impossible to cancel loading and unloading. And in async the async methods, if the scenes are loaded and not enabled the
AsyncOperation
will still be active since the scenes are not enabled and stays on 0.9 completion. Only way to complete the operation is to enable the scenes, and then let theAsyncOperation
complete. Until the operation is done the scene can not be unloaded. which means it has to become enabled before it can be unloaded.UniTask can convert these methods and let them be handled with cancellation tokens. But the question still remains, is the rest of the default unity scene handling functioning as before or does UniTask handle the cancelled scene? unloading it if it was supposed to load, or loading it back in if it was unloading?
Either way I'm questioning if cancelling loading is a feature i even need or if it would even be used. But I've seen how useful UniTask can be so i was curious on if it could work.
Thanks!
Beta Was this translation helpful? Give feedback.
All reactions