"add selected" editor script

Hi,
I´d like to know if there´s a command to get the currently selected object(s) in the “hierarchy” tab within an editor script.

I´d like to be able to add these objects to an array in my editor script.

any suggestions? Thanks!

-Juanelo

1 Answer

1

Use the Selection class. You can access all selected gameobject, all selected non-assets, all top level transforms or the one transform shown in the inspector.

Thanks! That was exactly what I needed!