Hi, I’ve been working on the xbox suspend issue. It requires the game to respond to suspend within 1 second. And now there is some heavy operations in some update() calls in some manager class, which is not easy to break down to coroutines.
I have a flag called ‘needSuspend’, and it’s value will be true when the game got the event to suspend. I need to call the XboxOnePLM.AmReadyToSuspendNow() to finish the suspend operation. In my test, it will effect after all scripts’ update(). I put the ‘if (needSuspend)’ check between the heavy operations codes. When the condition is true, is there any way to stop the current update() function of Monobehaviour immediately and abort all the code below to execute.
I have an idea to approach this effect, but it’s not good to cause an error…
if (needSuspend)
{
XboxOnePLM.AmReadyToSuspendNow();
int zero = 0;
int forceBreakOut = 10 / zero;
}