title: How to send Class type to another class and create instance of this class?
body: <p>I'm working on library that will help implement dedicated servers for all sorts of applications (mainly my goal is games). I'm working with sockets and I want to implement some sort of command system, where users will be able to invoke functions on the server. 
  I have a problem because I wanna let a user implement interactable command environment in a class created by him that my library will need to know about.
  I created this template example of how it's all structured:</p>
  
  <p>Implemented by me, part of library (very simplified):</p>
  
  <pre><code>public class UserInfo //class containing info about user
  {
      public int id;
  
      public UserInfo(int _id)
      {
          id = _id;
      }
  }
  
  public class UserManager
  {
      List&lt;UserInfo&gt; userInfos;
  
      public UserManager(List&lt;UserInfo&gt; _userInfos) //We get out infos from somewhere...
      {
          userInfos = _userInfos; //...and keep reference to them
  
          //SetupChildClassAndInfos();
      }
  
      //I'd like to have something like that BUT I don't know 
      //how ChildClass is called so I can't just type it like here
  
      /*
      List&lt;ChildClass&gt; childs = new List&lt;ChildClass&gt;();
  
      void SetupChildClassAndInfos()
      {
          foreach (var userInfo in userInfos)
          {
              ChildClass child = new ChildClass();
              child.someInfo = userInfo;
              childs.Add(child);
          }
      }
      */
  
  
      //I tried working with generics but failed miserably xd
      List&lt;T&gt; childs = new List&lt;T&gt;();
      public void GetChildClass&lt;T&gt;()
      {
          foreach (var userInfo in userInfos)
          {
              T child = new T();
              child.userInfo = userInfo;
              childs.Add(child);
          }
      }
      //of course it doesn't work and makes no sense xD but I hope you kinda g
      //get what I'm trying to accomplish
  }
  
  public class UserClass //Base class for further implementation containing 
                         //userInfo that user needs to know about
  {
      public UserInfo userInfo;
  }
  </code></pre>
  
  <p>Example implementation by someone else, I don't know how ChildClass will be called:</p>
  
  <pre><code>public class ChildClass : UserClass //there needs to be access to UserClass informations
  {
      CustomManager customManager;
  
      [Command] //attribute making method be called automaticly when is the right time
      public void Message(string _message) //A method made by a user BUT(!) he will never use it directly
      {
          customManager.ReceiveMessage(userInfo.id, _message);
      }
  }
  public class CustomManager
  {
      UserManager userManager; //assume we somehow have reference
  
      public CustomManager()
      {
          userManager.GetChildClass&lt;ChildClass&gt;(); //sending information in beginning to infoManager how I implemented my ChildClass (doesn't work)
      }
  
  
      public void ReceiveMessage(int _id, string _message)
      {
          Debug.Log("We got message: " + _message + " from user with id: " + _id);
      }
  }
  </code></pre>
  
  <p>So my question is how do I send a custom made class to UserManager and create instances of this class?
  Maybe what I'm writing just doesn't make any sense and my aproach is stupid, feel free to criticize.</p>