How to load scenes Asynchronously?

I want to load my scenes asynchronously, I have 3 levels, when the player reaches some point the loading appears and waits till the next scene is done loading, this works only once (going from level 1 to 2).
But it doesn’t work properly when switching from level 2 to level 3.

IEnumerator LoadLevelAsynchronously(int sceneIndex)
  {
    AsyncOperation operation = SceneManager.LoadSceneAsync(sceneIndex);
    operation.allowSceneActivation = false;
    while (!operation.isDone)
    {
      if(operation.progress >= 0.9f)
      {
        operation.allowSceneActivation = true;
      }
      yield return null;
    }
  }

I assume the script is attached to a game object?
This game object is destroyed when the new level loads.
Add this script and I think this should solve the problem.

using UnityEngine;
using System.Collections;

public class DontDestroy : MonoBehaviour {

    // Use this for initialization
    void Awake () {

        DontDestroyOnLoad(gameObject);
    
    }
}

Could you copy the entire code in to the answer AryaMh. I am also have trouble getting scenes to load async, and if you have it so that it loads from scene one to 2 then I would like to give it a try. If you would share that I would greatly appreciate it!

I dont know if your code is activated trough trigger or button but mine is trough button. Here is the code:

//Reference to the loading screen
public GameObject LoadingScreen;
//Reference to the loading bar
public Slider slider;

    //The button function
public void LoadLevel(int sceneIndex)
{
    StartCoroutine(LoadAsynchronously(sceneIndex));
}

IEnumerator LoadAsynchronously(int sceneIndex)
{
    AsyncOperation operation = SceneManager.LoadSceneAsync(sceneIndex);

    //activate the load screen
    LoadingScreen.SetActive(true);

    while (!operation.isDone)
    {
        float progress = Mathf.Clamp01(operation.progress / 9f);

        //Set the slider value = to the progress
        slider.value = progress;

        yield return null;
    }
}