Load level async

Hi, I’ve seen this video: How to make a LOADING BAR in Unity - YouTube And I would like, instead of changing the scene showing a load bar pressing a ui button, was with a trigger. I have created two scripts, one that shows in the above mentioned video and another one that activates the other script when passing through the trigger:

Script 1 (script of the video):

public void LoadLevel (int sceneIndex)
{
StartCoroutine(LoadAsynchronously(sceneIndex));
}
IEnumerator LoadAsynchronously (int sceneIndex)
{
AsyncOperation operation = SceneManager.LoadSceneAsync(sceneIndex);
while (!operation.isDone)
{
Debug.Log(operation.progress);
yield return null;
}
}

}

Script 2 (that activates the above script with the trigger):

public class “2nd script name” : “1st script name” {

void OnTriggerEnter ()
{
LoadLevel();
}
}

I have worked by putting the value of the sceneIndex inside the script, but I do not want to repeat the same script for each scene I will do, which I want from the inspector to be able to edit “int sceneIndex” but, I have not gotten the form to do it.

I hope someone can help me. Thank you very much.

I don’t understand the last part of your question. you want to load async in OnTriggerEnter() and you want to edit the sceneIndex via Inspector.

Is that right?