title: Why can't a Texture2D be assigned through a method without 'out'?
body: <p>I've got a class that holds a Texture2D like so:</p>
  
  <pre><code>public class TextureData
  {
      public Texture2D texture;
  }
  </code></pre>
  
  <p>When I load all of my textures, I handle it through methods like this:</p>
  
  <pre><code>public void LoadAllTextures()
  {
      foreach(string s in texturesToBeLoaded)
      {
          TextureData data = new TextureData();
          LoadTexture(s, data.texture);
          // data.texture is still null.
      }
  }
  public void LoadTexture(string filename, Texture2D texture)
  {
      texture = content.Load&lt;Texture2D&gt;(filename);
      // texture now holds the texture information but it doesn't
      // actually retain it when the method ends...why?
  }
  </code></pre>
  
  <p>Am I missing something here?  If I change </p>
  
  <pre><code>public void LoadTexture(string filename, Texture2D texture)
  </code></pre>
  
  <p>To</p>
  
  <pre><code>public void LoadTexture(string filename, out Texture2D texture)
  </code></pre>
  
  <p>It works fine.</p>
  
  <hr>
  
  <p>EDIT:  Alright so the way I understand it now is this...</p>
  
  <pre><code>public void LoadAllTextures()
  {
      foreach(string s in texturesToBeLoaded)
      {
          TextureData data = new TextureData();
          // here, data.texture's memory address == 0x0001
          LoadTexture(s, data.texture /*0x0001*/);
      }
  }
  public void LoadTexture(string filename, Texture2D texture /* this is now 0x0001 */)
  {
      texture = content.Load&lt;Texture2D&gt;(filename);
      // now the PARAMETER is set to 0x0002, not data.texture itself.
  }
  </code></pre>