- Home /
Question by
Blankzz · Jul 16, 2011 at 03:21 PM ·
listgenericgetcomponents
Storing return of get components in List
Sorry for the really simple question but how do you store the array returned from get components in a generic list? I've tried the following but none of them work for me.
List<Action> actions = new List<Action>();
actions = GetComponents<Action>();
actions = GetComponents(Action);
actions = new List(GetComponents(Action));
actions = new List(GetComponents<Action>());
actions = new List(GetComponents<Action>(Action));
Comment
Best Answer
Answer by Blankzz · Jul 16, 2011 at 03:24 PM
damn I meant to put
actions = new List<Action>(GetComponents<Action>());
My bad. Sorry
you should have the option below your question. if you don't, it's possible that the site is stopping you in order to archive your answer