I
I
i__egor2020-06-25 19:46:26
Unity
i__egor, 2020-06-25 19:46:26

How to use a variant of the AddComponent function in unity without generics?

Tell me how to use the variant of the AddComponent function without generalization. I write like this: AClass ac = go.AddComponent(typeof(CClass)) as AClass; - everything is fine, it works. but i want to take componentType from array. like this: go.AddComponent(mas[0]) as AClass; where mas of Type doesn't work

Answer the question

In order to leave comments, you need to log in

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question