Hi, I’ve been wondering whether is it possible to add two components of the same type in my game object when I add my script to it. I would like to add two edge colliders 2D to my gameObject when I assign my script to this same gameObject. Something like this:
[RequireComponent(typeof(EdgeCollider2D))]
[RequireComponent(typeof(EdgeCollider2D))]
public class Foo
{
...
}
I know there is a way of adding these two components via script by using AddComponent, but how about adding at the moment I assign my script?