Search Unity

[Workaround] Unity5 AddComponent from a string!

Discussion in 'Scripting' started by hesa2020, Mar 6, 2015.

  1. hesa2020

    hesa2020

    Joined:
    Jul 27, 2011
    Posts:
    261
    Hello people here a work arround to AddComponent from a string in Unity 5
    It extend the GameObject class, so you can use gameObject.AddComponentFromString("MyComponent");

    Enjoy !


    http://pastebin.com/CeYeTbx7