SelectAllLights

From Unify Community Wiki
Revision as of 03:13, 1 July 2006 by Aarku (Talk | contribs)

(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to: navigation, search

Author: Jonathan Czeck (aarku)

Description

This editor script sets the current selection to all the lights in your scene.

Usage

Place this script in YourProject/Assets/Editor and a menu item will automatically appear in the Custom menu after it is compiled.

C# - SelectAllLights.cs

<csharp>using UnityEngine; using UnityEditor;

public class SelectAllLights : ScriptableObject {

   [MenuItem ("Custom/Select All Lights")]
   static void SelectLights()
   {
       Light[] lights = FindObjectsOfType(typeof(Light)) as Light[];
       GameObject[] gos = new GameObject[lights.Length];
       
       for (int i=0; i < lights.Length; i++)
       {
           gos[i] = (lights[i]).gameObject;
       }
       
       Selection.objects = gos;
   }

}</csharp>

Personal tools
Namespaces

Variants
Actions
Navigation
Extras
Toolbox