Set 'active' state of multiple items in editor

Hi All,

We’ve developed a fairly sophisticated Unity project, and yet still feel like newbies with some of Unity’s quirks. Here’s the number bug-bear for us and I hope we’re being plain stupid…

Within a scene, why can’t we select multiple items in the Hierarchy and simply tick/untick the ‘active’ checkbox in the Inspector. I understand the Inspector only ever shows 1 item, but surely this is a simple action that should be applicable to multiple items at once. Are we missing something basic here? I hope so!

Thanks,

Simon

I’ve been using the one from the Graveck gents, the whole package of editor scripts can be found in the package at: http://unity3d.com/support/resources/unite-presentations/using-the-unity-editor-apis

why thats not the default action on clicking in the UI i’m not sure :wink:

// ©2006-2009 Graveck Interactive LLC.  See the accompaning license for usage information.

/*
	ToggleActiveRecursively.cs
	© Mon May 22 11:52:02 CDT 2006 Graveck Interactive
	by Jonathan Czeck
*/
using UnityEngine;
using UnityEditor;

public class ToggleActiveRecursively : ScriptableObject
{
	[MenuItem ("Custom/Toggle Active Recursively of Selected %i")]
	static void DoToggle()
	{
		Object[] activeGOs = Selection.GetFiltered(typeof(GameObject), SelectionMode.Editable | SelectionMode.TopLevel);
		
		foreach (GameObject activeGO in activeGOs)
			activeGO.SetActiveRecursively(!activeGO.active);
	}
}

Thanks Dave, I’ll check this out. Just can’t believe it isn’t available in Unity as a feature!