title: how to make the GameObject have a parameter in unity (c#)?
body: <p>please help me how to get the value of "currentPeople.timeCount;"
  for example i have a script:</p>
  
  <pre><code>public class BuildingPlacement : MonoBehaviour 
  {
      public GameObject currentPeople;public int DelayTime;private int timeCount;
  }
  </code></pre>
  
  <p>if i want to say that </p>
  
  <pre><code>DelayTime = currentPeople.timeCount;
  </code></pre>
  
  <p>i try this code below and it says nullreferenceexception object reference not set to an instance of an object:</p>
  
  <pre><code>DelayTime = (BuildingPlacement)currentPeople.GetComponent(typeof(BuildingPlacement).timeCount);
  </code></pre>
  
  <p>How do I get the value of <code>currentPeople.timeCount</code> ? is it possible?</p>