x


Unity Editor Scripts: GameObject Added / Removed Event?

Does Unity provide an editor script event for GameObjects being added or removed from the scene/hierarchy? I've been looking through the Editor Classes and haven't found anything that does what I want.

I want to detect when the user adds/removes any GameObject to/from the scene and handle it in an editor script.

more ▼

asked Mar 03 '12 at 11:09 AM

oscarsweatman gravatar image

oscarsweatman
16 1 1 1

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

1 answer: sort voted first

check out

EditorApplication.hierarchyWindowChanged

EditorApplication.projectWindowChanged

There isn't much documentation on these, so have at look at this forum thread:

Forum - EditorApplication.hierarchyWindowChanged

Basically, you are assigning a delegate somewhere in your editor code that fires off when either the hierarchy or project windows change.

more ▼

answered Mar 27 '12 at 06:34 PM

echo17 gravatar image

echo17
76 3 3 5

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

x5059
x2075
x1664
x347
x47

asked: Mar 03 '12 at 11:09 AM

Seen: 1216 times

Last Updated: Mar 27 '12 at 06:35 PM