public void GetRootGameObjects(List<GameObject> rootGameObjects)
{
    if (rootGameObjects.Capacity < rootCount)
        rootGameObjects.Capacity = rootCount;
  
    rootGameObjects.Clear();
  
    if (!IsValid())
        throw new System.ArgumentException("The scene is invalid.");
  
    if (!Application.isPlaying && !isLoaded)
        throw new System.ArgumentException("The scene is not loaded.");
  
    if (rootCount == 0)
        return;
  
    GetRootGameObjectsInternal(handle, rootGameObjects);
}