unity check if a scene is loaded code example
Example: unity check if current scene is being unloaded
//If the scene is being unloaded, this will return false
SceneManager.GetActiveScene().isLoaded
//If the scene is being unloaded, this will return false
SceneManager.GetActiveScene().isLoaded