title: Assets\FPS\Audio\Soundtrack\MusicManager.cs(35,70): error CS0841: Cannot use local variable 'currentScene' before it is declared
body: <p>I'm building this game, and I've been trying to fix a bug for very long, so I came here for some help...</p>
  <p>These are the errors I'm getting:</p>
  <ol>
  <li>error CS0841: Cannot use local variable 'currentScene' before it is declared</li>
  <li>The Type or namespace 'Scene' could not be found (are you missing a using directive or an 3. assembly reference?)</li>
  <li>The name 'SceneManager' does not exist in the current context</li>
  </ol>
  <pre><code>using System.Collections.Generic;
  using UnityEngine;
  using UnityEngine.SceneManager;
  
  public class MusicManager : MonoBehaviour
  {
      private AudioSource audiosource;
      public AudioClip[] songs;
      public float volume;
      [SerializeField] private float songsPlayed;
      [SerializeField] private bool[] beenPlayed;
  
      List&lt;string&gt; DontChangeSongScenes = new List&lt;string&gt;();
  
      // Start is called before the first frame update
      void Start()
      {
          Scene currentScene = SceneManager.GetActiveScene();
  
          audiosource = GetComponent&lt;AudioSource&gt;();
  
          beenPlayed = new bool[songs.Length];
  
          if (!audiosource.isPlaying || !DontChangeSongScenes.Contains(currentScene.name))
              ChangeSong(Random.Range(0, songs.Length));
  
          DontChangeSongScenes.Add(&quot;Scene_1&quot;); /*just copy and paste this line and instead 
          of &quot;Scene_1&quot; write the name of the scene that shouldnt change the current playing song. */
          DontChangeSongScenes.Add(&quot;Scene_2&quot;);
      }
  
      // Update is called once per frame
      void Update()
      {
          audiosource.volume = volume;
  
          if (!audiosource.isPlaying || !DontChangeSongScenes.Contains(currentScene.name))
              ChangeSong(Random.Range(0, songs.Length));
  
          if (songsPlayed == songs.Length)
          {
              songsPlayed = 0;
              for (int i = 0; i &lt; songs.Length; i++)
              {
                  if (i == songs.Length)
                      break;
                  else
                      beenPlayed[i] = false;
              }
          }
  
  
  
      }
  
  
  
      public void ChangeSong(int songPicked)
      {
  
          if (!beenPlayed[songPicked])
          {
              songsPlayed++;
              beenPlayed[songPicked] = true;
              audiosource.clip = songs[songPicked];
              audiosource.Play();
          }
          else
              audiosource.Stop();
      }
  
      void Awake()
      {
          DontDestroyOnLoad(transform.gameObject);
      }
  }
    
  </code></pre>