title: Change sprite in Prefab
body: <p>I have a class sort of managing a game's user interface.</p>
  
  <pre><code>public class GameManager : MonoBehaviour {
      ArrayList sprites;
      // Use this for initialization
      void Start () {
          sprites = new ArrayList();
          sprites.Add(Resources.Load("bettle", typeof(Sprite)));
          sprites.Add(Resources.Load("donut", typeof(Sprite)));
          sprites.Add(Resources.Load("icecream", typeof(Sprite)));
          sprites.Add(Resources.Load("letter", typeof(Sprite)));
          sprites.Add(Resources.Load("paper", typeof(Sprite)));
          sprites.Add(Resources.Load("papercup", typeof(Sprite)));
          sprites.Add(Resources.Load("puzzle", typeof(Sprite)));
          sprites.Add(Resources.Load("sock", typeof(Sprite)));
          sprites.Add(Resources.Load("tag", typeof(Sprite)));
          sprites.Add(Resources.Load("underwear", typeof(Sprite)));
  
          for(int x = 0; x &lt; 5; x++) {
              for(int y = 0; y &lt; 5; y++) {
                  GameObject go = Resources.Load("ItemPrefab") as GameObject;
                  go.GetComponent&lt;SpriteRenderer&gt;().sprite = sprites[Random.Range(0, sprites.Count)] as Sprite;
                  float fx = -2 + 1f * x;
                  float fy = -2 + 1f * y;
                  go.transform.position = new Vector3(fx, fy, 0);
  
                  Instantiate(go);
              }
          }
      }
  }
  </code></pre>
  
  <p>I used the above codes to instantiate a Prefab for multiple times on screen. The Prefab contains a <code>SpriteRenderer</code>, which by default the sprite is set to "tag" (just a name).</p>
  
  <p>As you can see above, I get a random sprite from the <code>ArrayList</code> and set the <code>SpriteRenderer</code>'s sprite value. But on screen, the sprite remains "tag". </p>
  
  <p>What did I miss?</p>
  
  <p>Note:</p>
  
  <ul>
  <li>the sprites in the <code>ArrayList</code> are loaded successfully</li>
  <li>no error is shown in runtime / compile time</li>
  </ul>