Quantcast
Browsing latest articles
Browse All 6 View Live

Answer by Dave-Carlile

One of the [AddComponent][1] overloads takes a class name instead of a type. So just call it with the name of the class from your list. [1]:...

View Article


Answer by _Gkxd

Instead of storing the names of the classes, you can just store the list of components: Include this line at the top of your script using System.Collections.Generic; Somewhere inside the class List...

View Article


Answer by cjdev

You can do it but it's not pretty, you need to use the types and reflection like this: List componentList = new List(); componentList.Add(typeof(Rigidbody)); componentList.Add(typeof(Animator));...

View Article
Browsing latest articles
Browse All 6 View Live


<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>