x


Add script to selection

Hey guys,

Is there a way to add the same script from the library to multiple objects in the editor at once?

I'm not talking about prefabs, these won't suit my needs.

more ▼

asked Mar 28 '11 at 01:48 PM

PitchBlackCat gravatar image

PitchBlackCat
98 2 3 9

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

2 answers: sort voted first

To add script YourScript to a bunch of objects:

Select all the game objects you want to apply the script to
Go to Component->Scripts->Your Script
Tada!

Lemme know it that works for you. Worked for me.

more ▼

answered Apr 10 '11 at 04:34 AM

Alex Leone gravatar image

Alex Leone
32

simply amazing :)

Aug 24 '12 at 04:44 PM PitchBlackCat
(comments are locked)
10|3000 characters needed characters left

I am afraid you would need to make your own editor script for that. Perhaps check all gameObjects in the current Selection and apply some type to those. You'd probably have to use reflection (advanced) to list all the available component types as well. Perhaps you could start off with ReplaceSelection wizard and edit it to instead add a component? To make it easy you could just use a string when adding components instead of toying with reflection.

more ▼

answered Mar 28 '11 at 01:57 PM

Statement gravatar image

Statement ♦♦
20.1k 35 70 175

(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:

x323
x323
x292

asked: Mar 28 '11 at 01:48 PM

Seen: 1143 times

Last Updated: Aug 24 '12 at 04:44 PM