title: make value of the variable A = B unity
body: <p>Someone here is a gallows.
  I have the following problem. I have two classes. .a class ListPainel.
  and the class Items Requirements.</p>
  
  <p>in class ListPainel I have the following:</p>
  
  <pre><code>[System.Serializable]
  public class Item
  {
  public GameObject slotPrafab;
  public int numeroDeItensDisp;
  public int numeroDeItensTotal;
  }
  public List&lt;Item&gt; itemList;
  </code></pre>
  
  <p>etc etc...</p>
  
  <p>and in the class RequirementsItems I have the following:
  Only public variables so that I can change in the inspector unity.</p>
  
  <pre><code>public Sprite imageNewItem;
  public Image imageItem;
  public Text req;
  public string barra;
  public int numberReqDisp;
  public int numberReqTotal;
  public static Item painel;
  </code></pre>
  
  <p>etc etc...</p>
  
  <p>and I need the value of the variable / numberReqDisp; be = number of items; of the class listPainel ... so I'll delude this way:</p>
  
  <pre><code>numberReqDisp = painel.numeroDeItensDisp;
  </code></pre>
  
  <p>and what happens. in my unity. the values do not change. and it gives error "Object reference not set to an instance of an object"</p>
  
  <p>.. and to make clear the class items required is attached to a prefab.</p>