title: How could i get struct as generic from type?
body: <p>Hi i made type array for search type in object, if object has that struct(or component) then delete struct(or component) from object.</p>
  
  <p>This is concept of my code but i got error that "'structure' is a variable but 
  is used like a type" from the line</p>
  
  <pre><code>if (entityManager.HasComponent&lt;structure&gt;(entity))
  </code></pre>
  
  <p>Below is my script.</p>
  
  <pre><code>public struct ECS : IComponentData{}
  ...
  
  
  static Type[] componentArray = new Type[] { typeof(ECS), typeof(JECS), typeof(JECS2), typeof(JECS3), typeof(JECS4) };
  
  static void ResetComponent(Entity entity, EntityManager entityManager) {
  
      foreach (Type structure in componentArray)
      {
          if (entityManager.HasComponent&lt;structure&gt;(entity))
          {
              entityManager.RemoveComponent(entity, structure);
          }
      }
  
  }
  </code></pre>
  
  <p>In my opinion, i need to convert type to generic but i don't know how.</p>
  
  <p>Please figure out my problem.</p>