title: How do I check if a List contains an object of a certain type? C#
body: <p>I have a list (called <code>Within</code>), and it contains objects of type <code>GameObject</code>.
  <code>GameObject</code> is a parent class to many others, including <code>Dog</code> and <code>Ball</code>. I want to make a method that returns true if Within contains any object of type <code>Ball</code>, but I don't know how to do this.</p>
  
  <p>I've tried using <code>Count&lt;&gt;</code>, <code>Any&lt;&gt;</code>, <code>Find&lt;&gt;</code> and a few other methods provided within C#, but I couldn't get them to work. </p>
  
  <pre><code>public bool DetectBall(List&lt;GameObject&gt; Within)
  {
      //if Within contains any object of type ball:
      {
          return true;
      }
  }
  </code></pre>