ToggleActiveRecursivelyAllGameObjects

From Unify Community Wiki
Jump to: navigation, search

Author: Martin Schultz (MartinSchultz)

Contents

Description

This little helper scripts toggles the active status of all selected game objects to the opposite and does as well for any linked children of the selected game objects, so a full recursive active toggle for all selected GOs.

The script can be found under the menu Custom→Toggle Active All Active Selected GO's.

Usage

You must place the script in a folder named Editor in your project's Assets folder for it to work properly.

Select some game objects and call select this script from the menu. It will toggle the active state instantly.

Screenshot

Toggleactivego.jpg


JavaScript - ToggleActiveAllSelectedGO.js

@MenuItem ("Custom/Toggle Active All Selected GO's")
static function ToggleAllSelected() {
	for (t in Selection.transforms) {
		t.gameObject.SetActiveRecursively(! t.gameObject.active);
	}
}
Personal tools
Namespaces

Variants
Actions
Navigation
Extras
Toolbox