Adding a particle emitter to every tree

Hey,
I’ve got about 5000 trees here, so doing this manually is out of the question. Basically, I have this falling leaves particle emitter (the new Shuriken system sure is nice!) and I want to add it to very tree in the scene. Simply adding the particles to the prefab doesn’t work.
How would you guys handle this?

But… That doesn’t tell me how many trees there are, only where they are.

for(how many trees there are){
spawn a particle emitter
set the position where the current tree is + something
}

And I have no idea how to fill that in.

lol You’ve got an answer to everything. :b

That should be enough, do either Unityscript or C# have an Array length function?

Do you want a “Let me search Unity Docs for you” button?

Figured I was here already, but I could just as easily have Googled it :wink: Tried and didn’t actually find the first two answers, but I bet I could find out about the arrays.

arrayFieldName.Length is perhaps what you are looking for? You may want to bookmark this page, http://msdn.microsoft.com/en-us/library/618ayhy6(v=VS.71).aspx, on top of the Unity Script Reference.