x


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));
more ▼

asked Jul 16 '11 at 03:21 PM

Blankzz gravatar image

Blankzz
246 19 20 23

(comments are locked)
10|3000 characters needed characters left

1 answer: sort voted first

damn I meant to put

actions = new List<Action>(GetComponents<Action>());

My bad. Sorry

more ▼

answered Jul 16 '11 at 03:24 PM

Blankzz gravatar image

Blankzz
246 19 20 23

Is it possible to delete the question?

Jul 16 '11 at 03:28 PM Blankzz

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

May 08 at 02:00 PM Captain_Dando
(comments are locked)
10|3000 characters needed characters left
Your answer
toggle preview:

Up to 2 attachments (including images) can be used with a maximum of 524.3 kB each and 1.0 MB total.

Follow this question

By Email:

Once you sign in you will be able to subscribe for any updates here

By RSS:

Answers

Answers and Comments

Topics:

x382
x37
x12

asked: Jul 16 '11 at 03:21 PM

Seen: 928 times

Last Updated: May 08 at 02:00 PM