It is necessary to put the index of the active scene in the variable
The next code variant throws an error.
using ... using UnityEngine.SceneManagement; byte i; i = (byte)(SceneManager.sceneLoaded());
How to correctly implement the task (using SceneManager)?
You need this:
GetActiveScene() returns the currently active Scene object, then it contains the very cherished index – Scene.buildIndex . And
name too, if you suddenly need it.