Access loading screen scene components from Main Menu?

Hey you all! I can’t find anything that’d help me achieve this so I’m resorting to ask.
I have a Main Menu setup with a script that controls the buttons, and I’m looking to implement something like this:

void LoadScene(string sceneToLoad)
{
 SceneManager.LoadScene("LoadingScreen");
 loadingScr.GetComponent<SceneLoader>().LoadAsync(sceneToLoad);
}

loadingScr would be the reference to the game object that contains the SceneLoader script inside of the “LoadingScreen” scene, which then has a coroutine that actually loads the desired scene.

Okay, the whole problem here is that there doesn’t seem to be any way of linking a scene from the inspector. Accessing the contents of it via the GetRootGameObjects() requires me to somehow pre-load it first into memory, and also, figure a way to access any of the gameobjects inside of the array with like FindWithTag or something, which is something I also haven’t figured out how to do.
So I guess the main questions are:

  • Is there a way to reference a specific scene or to preload it to be able to use GetSceneByName()?
  • How do you handle the array that is returned by GetRootGameObjects()? How do you find a specific game object by string, by tag or by whatever?

I hope I was clear. I’d appreciate any kind of input you might be able to give me.
Thanks in advance!

If anyone’s interested, I solved it in the following manner:

I made a GlobalGameManager object, using DontDestroyOnLoad() Which appears on a startup scene, and this object holds the SceneLoader script and the global game management script itself.
When anything that needs a loading screen is triggered from a button or whatever I call the LoadScene function inside SceneLoader which starts a coroutine that loads asynchronously the loading screen, and in turn starts another coroutine inside that loads the desired scene. This desired scene is previously stored in the global game object and directly accessed from there.

public class SceneLoader : MonoBehaviour {

    GlobalGameManager globalGM;

    private void Start()
    {
        globalGM = gameObject.GetComponent<GlobalGameManager>();
    }

    public void LoadScene(string sceneName)
    {
        globalGM.TempSceneLoader = sceneName;

        StartCoroutine(LoadingScreen());

    }


    IEnumerator LoadingScreen()
    {
        SceneManager.LoadSceneAsync("LoadingScreen");

        StartCoroutine(LoadAsync(globalGM.TempSceneLoader));

        yield return null;
    }

    IEnumerator LoadAsync(string sceneName)

   {      
        AsyncOperation op = SceneManager.LoadSceneAsync(sceneName);
        

        while (!op.isDone)
        {
            float progress = Mathf.Clamp01(op.progress / .9f);
            Debug.Log(progress);
            yield return null;
        }
        
        
   }

   
}

So… yeah. I guess that’s that.