title: Hiding a UI panel from script in unity
body: <p>I have a UI <code>Panel</code> containing a <code>Button</code> as a child. The button has a script as a component. The script is as follows:</p>
  
  <pre><code>public GameObject Panel ;
  OnMouseDown()
  {
    Panel.setActive(false);
  
    StartCoroutine(takeShot());
  }
  private IEnumerator takeShot()
  {
     Application.CaptureScreenshot("my_img.png");
   }
  </code></pre>
  
  <p>I am having a problem saying the coroutine can't start because the button is inactive.</p>
  
  <p>How can I fix this problem? Can I hide the panel without using <code>SetActive(false)</code>?</p>