UnityScreenNavigator icon indicating copy to clipboard operation
UnityScreenNavigator copied to clipboard

Can we have a public method to terminate async handle task of pop/push immediately for sync usage, like unity job system Complete?

Open burakkurkcu opened this issue 8 months ago • 1 comments

Hi, first of all thanks for this package.

Today I updated package from 1.7.0 to 1.7.3 and it broke my sync usage like:

mainPageContainer.Pop(blabla); mainPageContainer.Push(blabla, loadAsync:false);

I believe due to refactorings made in 1.7.2, now it throws exception as new assert for checking if transition handler is still transitioning. And in the new async handle flow, handle task won't be terminated before next line like it would in sync.

I think it would be nice to have a public method to terminate async handle task immediately to be able to use it as sync, like unity job system Complete method. I could make a custom workaround tweaks maybe but it prevents using this package as git package in unity package manager.

What do you think?

burakkurkcu avatar May 16 '25 02:05 burakkurkcu

Thank you for your message.

First of all, the kind of synchronous usage you mentioned was never officially supported, even from the initial release. Since the lifecycle events of each screen are asynchronous, a synchronous interface cannot be supported. Please make sure to always use await when calling these methods.

Regarding the transition check, the previous implementation had issues, so I’ve corrected it in the recent updates.

Thank you for your understanding and for checking this.

Haruma-K avatar May 16 '25 08:05 Haruma-K