Skip to content
This repository has been archived by the owner on Feb 16, 2024. It is now read-only.

'Subscribe' and 'Do' don't work in 'SceneManager.LoadSceneAsync(scene).AsAsyncOperationObservable()' #501

Open
ORibn-dev opened this issue Sep 21, 2021 · 2 comments

Comments

@ORibn-dev
Copy link

ORibn-dev commented Sep 21, 2021

I'm trying to execute certain actions while loading the scene and after it's loaded, but everything inside Do and Subscribe is not executed. So it loades the scene, but there are no messages in Console or methods executed no matter what I try.

Example:

SceneManager.LoadSceneAsync(sceneIndex)
.AsAsyncOperationObservable()
.Do(x => {
Debug.Log("progress: " + x.progress);
}).Subscribe(
=> { Debug.Log("loaded"); })
.AddTo(this);

@studentutu
Copy link

studentutu commented Sep 30, 2021

@ORibn-dev I would go with a plain Unitask -> they have a better support and overall experience with Tasks, Task Asynchronous patterns.

@ORibn-dev
Copy link
Author

@studentutu thank you, I'll give it a try.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants