title: Unity "SceneManager.activeSceneChanged" getting called when "LoadSceneAsync" and load other scene
body: <p>first, there is a singleton object simply is subscribed to <code>activeSceneChanged</code></p>
  
  <p>SomeSingleton.cs</p>
  
  <pre><code>void Awake ()
  {
      Debug.LogError ("AWAKE");
  
      if (instance == null) {
          Debug.LogError ("instance == null");
  
          instance = this;
          MusicController.instance = this;
          SceneManager.activeSceneChanged += OnSceneChanged;
          DontDestroyOnLoad (this.gameObject);
      } else {
          Debug.LogError ("destroy");
  
          Destroy (this.gameObject);
      }
  }
  
  
  void OnSceneChanged (Scene previousScene, Scene changedScene)
  {
      Debug.LogError ("OnSceneChanged changedScene = " + changedScene.name);
  }
  </code></pre>
  
  <ol>
  <li>from Lobby Scene player moves to Room Scene.</li>
  <li>in <code>room scene</code>.</li>
  </ol>
  
  <p>the "Arena" Scene gets preloaded for better game experience.</p>
  
  <pre><code>LoadSceneAsync("Arena")
  </code></pre>
  
  <p>with <code>allowSceneActivation = false</code></p>
  
  <p>when player clicks play button, sets <code>allowSceneActivation = true</code></p>
  
  <p>but when user decides to go back and clicks Leave Button, <code>LoadScene("Lobby")</code> gets called.</p>
  
  <p>At this time in console, it will Log</p>
  
  <p>LOGS</p>
  
  <pre><code>OnSceneChanged changedScene = Lobby // time : 0.793
  OnSceneChanged changedScene = Room // time : 3.982
  </code></pre>
  
  <p>[when player clicks Leave Button]</p>
  
  <pre><code>OnSceneChanged changedScene = Arena // time : 7.583
  OnSceneChanged changedScene = Lobby // time : 7.583
  </code></pre>
  
  <p>like this...</p>
  
  <p>it just gets activated but wont actually load the scene. why is Arena getting activatd? how to solve this problem???
  should i do some <code>unload</code> thing to the <code>AsyncLoading</code>?</p>
  
  <p>==== EDITED =====</p>
  
  <p>when leave button clicked</p>
  
  <pre><code>public void LeaveRoom ()
  {
      print ("Leave Room And Move To Lobby");
      SetCanStartIfMasterClient (false);
      PhotonNetwork.LeaveRoom ();
      AdmobController.DestroyBanner ();
      Waiting.instance.StartWaiting (waitingForLeaveRoomData);
      SceneFader.instance.LoadSceneWhenFadingComplete (SceneType.Lobby);
  }
  </code></pre>
  
  <p>in SceneFader.cs</p>
  
  <pre><code>public enum SceneFadeType
  {
      FadeIn = 1,
      FadeOut = -1
  }
  
  
  public class SceneFader : MonoBehaviour
  {
  
      public static SceneFader instance;
      void Awake ()
      {
          instance = this;
  
          // StartFadeOut
          StartFading (SceneFadeType.FadeOut, null);
  
      }
  
  
      public void LoadSceneWhenFadingComplete (SceneType sceneType)
      {
          // 1. start Fading
          // 2. on fading complete, LoadScene
          StartFading
          (
              fadeType: SceneFadeType.FadeIn,
              onFadingComplete: () =&gt; {
                  SceneManager.LoadScene (sceneType.ToString ());
              }
          );
  
      }
  
      public void LoadSceneWhenFadingCompleteAsync (ScenePreloader scenePreloader)
      {
          // 1 start preloading scene
          // 2 on preloading complete, start fading
          // 3 on fading complete LoadScene
  
  
          scenePreloader.AddOnPreloadCompleteAndTriggerIfLoaded (
              onPreloadComplete: () =&gt; {
                  StartFading (
                      fadeType: SceneFadeType.FadeIn,
                      onFadingComplete: () =&gt; {
                          scenePreloader.ActivateSceneWhenReady ();
                      }
                  );
              }
          );
  
      }
  
      private void StartFading (SceneFadeType fadeType, Action onFadingComplete)
      {
          Debug.LogWarning ("StartFAding ");
          ScreenFader.instance.BeginFade (fadeType, onFadingComplete);
          AudioMasterController.instance.StartFading (fadeType, null);
      }
  
  
  }
  </code></pre>
  
  <p>in ScenePreloader.cs</p>
  
  <pre><code>public class ScenePreloader : MonoBehaviour
  {
  
      Action&lt;float&gt; onPreloadRateChanged;
      Action onPreloadComplete;
      public AsyncOperation sceneLoader;
      public bool isPreloadCompleted;
  
  
      public void StartPreloadingScene (SceneType sceneType, LoadSceneMode loadSceneMode, Action&lt;float&gt; onPreloadRateChanged = null, Action onPreloadComplete = null)
      {
          this.onPreloadComplete = onPreloadComplete;
          this.onPreloadRateChanged = onPreloadRateChanged;
          StartCoroutine (PreloadSceneOperation (sceneType, loadSceneMode));
      }
  
  
      public IEnumerator PreloadSceneOperation (SceneType sceneType, LoadSceneMode loadSceneMode = LoadSceneMode.Single)
      {
          print ("PreloadSceneOperation sceneType = " + sceneType.ToString ());
          sceneLoader = SceneManager.LoadSceneAsync (sceneType.ToString (), loadSceneMode);
          sceneLoader.allowSceneActivation = false;
  
          while (!sceneLoader.isDone) {
              yield return null;
              if (sceneLoader.progress &gt;= 0.9f) {
                  print ("onPreloadComplete");
                  isPreloadCompleted = true;
                  if (onPreloadComplete != null) {
                      onPreloadComplete ();
                  }
                  break;
              } else {
                  if (onPreloadRateChanged != null) {
                      onPreloadRateChanged (sceneLoader.progress);
                  }
              }
          }
      }
  
      public void ActivateSceneWhenReady ()
      {
  
          sceneLoader.allowSceneActivation = true;
  
      }
  
  
      public void AddOnPreloadCompleteAndTriggerIfLoaded (Action onPreloadComplete)
      {
          AddOnPreloadComplete (onPreloadComplete);
          if (isPreloadCompleted) {
              print ("isAlreadyLoadedTrigeringCallback");
              onPreloadComplete ();
          }
      }
  
      public void AddOnPreloadComplete (Action onPreloadComplete)
      {
          this.onPreloadComplete += onPreloadComplete;
      }
  
      public void SetOnLoadProgressValueChanged (Action&lt;float&gt; onLoadProgressValueChanged)
      {
          this.onPreloadRateChanged = onLoadProgressValueChanged;
      }
  
  
  }
  </code></pre>