title: How to edit Active scene's GameObject from another script?
body: <p>I am making a Unity project and I need to edit Text of some UI of current active scene from another different script (not linked to that active scene).</p>
  
  <p>What I do is </p>
  
  <pre><code>            Scene scene = SceneManager.GetActiveScene();
              Debug.Log (scene.name);
              if (scene.name == "RangeView") 
              {
                  List&lt;GameObject&gt; activeObjects = new List&lt;GameObject&gt;();
                  scene.GetRootGameObjects( activeObjects );
                  for (int i = 0; i &lt; activeObjects.Count; ++i)
                  {
                      GameObject gameObject = activeObjects[ i ];
                      if (gameObject.name == "Clubdigit") {
                          gameObject.GetComponent&lt;Text&gt; ().text = 10.ToString ();
                      } 
                      else if (gameObject.name == "Balldigit") {
                          gameObject.GetComponent&lt;Text&gt;().text = 10.ToString ();
                      } else if (gameObject.name == "Distancedigit") {
                          gameObject.GetComponent&lt;Text&gt; ().text = 10.ToString ();
                      } else if (gameObject.name == "Ballspeeddigit") {
                          gameObject.GetComponent&lt;Text&gt; ().text = 10.ToString ();
                      } else if (gameObject.name == "Distancedigit2") {
                          gameObject.GetComponent&lt;Text&gt; ().text = 10.ToString ();
                      } else if (gameObject.name == "Backspindigit") {
                          gameObject.GetComponent&lt;Text&gt; ().text = 10.ToString ();
                      } else if (gameObject.name == "Sidespindigit") {
                          gameObject.GetComponent&lt;Text&gt; ().text = 10.ToString ();
                      }else if (gameObject.name == "Launchangleindigit") {
                          gameObject.GetComponent&lt;Text&gt; ().text = 10.ToString ();
                      }
                  }
  
              }
  </code></pre>
  
  <p>The update is not reflected on the scene.
  How can I update to the active scene?</p>