title: How to download image from firebase database, and load it into image in unity
body: <p>I use Firebase Realtime database to handle some of the UI in my Unity mobile application. I save and retrieve data from my database without any problems. 
  The problem comes when i want to load an image from Firebase Storage.
  I have saved the URL's and names of the images' on my server, and now i try to Instantiate a prefab. 
  This prefab contains a panel with text and an image for each Firebase-child.
  The structure of the image i try to load from my database looks like this:</p>
  
  <p><a href="https://i.stack.imgur.com/KcJXv.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/KcJXv.png" alt="enter image description here"></a></p>
  
  <p>So in my code I go to the child "Byer", find the first name and add the key as the name of my newly instantiated prefab works fine. But when I try to load the imageURL into the image, I get the trouble - my code looks like this:</p>
  
  <pre><code>DatabaseReference reference = FirebaseDatabase.DefaultInstance.RootReference;
  FirebaseDatabase.DefaultInstance.GetReference("Byer").ChildAdded += Handle_ChildAdded;
  
  
   void Handle_ChildAdded(object sender, ChildChangedEventArgs e)
      {
          if (e.Snapshot.Value != null)
          {
              var dict = e.Snapshot.Value as Dictionary&lt;string, object&gt;;
  
  
             Transform scrollViewObj = Instantiate(prefab, new Vector3(0, (downSize * Global.citiesCount) - firstY, 0), Quaternion.identity);
             scrollViewObj.transform.Find("Text").gameObject.GetComponent&lt;Text&gt;().text = e.Snapshot.Key;
                 scrollViewObj.name = e.Snapshot.Key;
  
  //HERE I TRY TO LOAD IMAGE FROM URL (This is my problem)
              string data_URL = dict["ImageURL"] as string;
              //Start coroutine to download image
              StartCoroutine(AccessURL(data_URL, scrollViewObj.transform.Find("Image").gameObject.GetComponent&lt;Image&gt;()));
  
                  }
              }
  
  //Function to download (This could might also be my problem)
        IEnumerator AccessURL(string url, Image img)
          {
  
  
          //Debug.Log("Accessing texture URL in database");
          using (WWW www = new WWW(url))
          {
  
              yield return www;
              Renderer r = GetComponent&lt;Renderer&gt;();
              r.material.mainTexture = www.texture;
              img.material.mainTexture = www.texture;
              Debug.Log("Texture URL: " + www.url);
          }
      }
  </code></pre>
  
  <p>Can anyone see what I am doing wrong?</p>