Check out example codes for "unity how to see what scen you are in". It will help you in understanding the concepts better.

Code Example 1

void Update()
     {
     if (SceneManager.GetActiveScene () == SceneManager.GetSceneByName ("scene1")) 
         {
         SceneManager.LoadScene ("scene2");
         }
 
  else if (SceneManager.GetActiveScene () == SceneManager.GetSceneByName ("scene2"))
         {
         SceneManager.LoadScene ("scene1");
         }
     }

Learn ReactJs, React Native from akashmittal.com