title: Get Children of New Scene
body: <p>I have a <code>GameManager</code> script which manages loading scenes, putting characters in the scene, reading map information from game objects, and so on.  The <code>GameManager</code> script is set to <code>DontDestroyOnLoad</code>.</p>
  
  <p>I'm trying to figure out how to access objects within my new scene from <code>GameManager</code> after a new scene loads.  I'm using the <code>SceneManager.sceneLoaded</code> event to run my "scene initialization" code.  Here's the event handler:</p>
  
  <pre><code> void OnLevelFinishedLoading(Scene scene, LoadSceneMode mode)
   { 
      // I want to access GameObjects within the newly loaded scene here
      //
      // SceneManager.GetActiveScene().GetRootGameObjects() returns               
      // System.ArgumentException: the scene is not loaded
  
      // I want to do something like this
      foreach (MapFeature mapFeature in rootObject.GetComponentsInChildren&lt;MapFeature&gt;())
      {
         // Do something
      }
   }
  </code></pre>
  
  <p>I'm want to get the root level <code>GameObject</code> of the new scene, and then use <code>GetComponentInChildren</code> on that root object in order to dynamically grab various components in the scene and store them in <code>GameManager</code>.  However, <code>SceneManager.GetActiveScene().GetRootGameObjects()</code> returns <code>System.ArgumentException: the scene is not loaded</code></p>
  
  <p>How do I get objects from my newly loaded scene within my <code>GameManager</code>?  If there's a better method than getting the new scene's root object and using that to get its children, I'm all ears.</p>