title: Call a function on AddComponent( string variable )
body: <pre><code>Type thistype = stringVar.GetType();
  thistype myScript = gameObject.AddComponent(stringVar);
  
  myScript.runCustomFunction();
  </code></pre>
  
  <p>This doesn't work, and I believe it is because I cannot cast to a variable type if I don't know the variable type at compile time (rather than run), therefore I am unable to directly access the component I just added.</p>
  
  <p>I have a gameItem class which pulls its default values from another script, then puts them into a dictionary. Based on the dictionary entry "functionScript","myScript", I need to attach myScript to the object, then pass it some dictionary entries.</p>
  
  <p>Alternatively, I could be really inefficient and ask the item class for its variables on the myScript class, which I'd rather avoid.</p>