title: (Unity) How to get generic component class from GameObject?
body: <p>How to get a generic component from spawned GameObject In Unity?</p>
  
  <p>I.e i have a base generic class:</p>
  
  <pre><code>class Base&lt;T&gt; : MonoBehaviour where T : MonoBehaviour 
  {
      public Foo() {}
  }
  </code></pre>
  
  <p>and derived class:</p>
  
  <pre><code>class Example : Base&lt;Example&gt;
  {
  
  }
  </code></pre>
  
  <p>And I wonder to get this class from spawned GameObject where I attached it as a component.</p>
  
  <p>I was tried this but my result was null so I decided to ask for some help :)</p>
  
  <pre><code>// @object - Spawned before and exists.
  Base&lt;MonoBehaviour&gt; tmp = @object.GetComponent&lt;Base&lt;MonoBehaviour&gt;&gt;();
  </code></pre>