title: Can you have generic create method for Zenject
body: <p>So I have a base class and some derived classes, I want to have just one factory with generic create method witch will create appropriate instances and inject all dependencies. Is this possible using Zenject?
  Something like.</p>
  
  <pre><code>factory.Create&lt;Archer&gt;()
  </code></pre>
  
  <p>For now I am doing this but as you see this is not very clean solution.</p>
  
  <pre><code> public class CustomFactory : IFactory&lt;Type, BaseUnit&gt;
  {
      private DiContainer _container;
  
      public CustomFactory(DiContainer container)
      {
          _container = container;
      }
      public BaseUnit Create&lt;Type&gt;()
      {
          return null;
      }
  
      public BaseUnit Create(Type type)
      {
          if (type.BaseType != typeof(BaseUnit))
          {
              Debug.LogError("you cant create objects that are not derrived from base unit");
              return null;
          }
  
          object obj = _container.Resolve(type) ;
          return _container.InstantiatePrefabForComponent(type, obj as UnityEngine.Object, null, new object[0]) as BaseUnit;
      }
  }
  </code></pre>