Closed omgmax closed 2 years ago
I believe after Unity launches for the first time it will continue running for the entire app session. You can minimize the impact of this by switching to an empty scene when you don't need Unity running.
there is a dispose function in flutter, when screen is off from the tree in this case unity also will be disposed as well. in other scenario you can also set PlayerLoop.setPlayerLoop to false, then it'll shut down unity entire loop to save energy, and when you want to run unity again you can just turn it back on.
@MysteryKang can you please provide some more details on how to do that ? I'm facing a lot of issues when trying to unload/dispose. A lot of crashes and freezes.
@AkhilRaja you do that in unity just fire an event from a flutter to tell unity to go into this mode https://docs.unity3d.com/ScriptReference/LowLevel.PlayerLoop.SetPlayerLoop.html and yes Unity always runs in the background after the first launch.
Just wondering if unity is running in the background all the time with this implementation.