SelectMainCamera

From Unify Community Wiki
(Difference between revisions)
Jump to: navigation, search
 
(Description)
Line 6: Line 6:
 
Author: Jonathan Czeck (aarku)
 
Author: Jonathan Czeck (aarku)
 
==Description==
 
==Description==
This editor script sets the current selection your main camera.  More technically, it sets the current selection to the first object it finds in your scene that has the tag "MainCamera" on it.  This is usually the object titled "Main Camera" that is in your scene by default.
+
This editor script sets the current selection to your main camera.  More technically, it sets the current selection to the first object it finds in your scene that has the tag "MainCamera" on it.  This is usually the object titled "Main Camera" that is in your scene by default.
  
 
==Usage==
 
==Usage==

Revision as of 03:19, 1 July 2006

Author: Jonathan Czeck (aarku)

Description

This editor script sets the current selection to your main camera. More technically, it sets the current selection to the first object it finds in your scene that has the tag "MainCamera" on it. This is usually the object titled "Main Camera" that is in your scene by default.

Usage

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

C# - SelectMainCamera.cs

<csharp>using UnityEngine; using UnityEditor;

public class SelectMainCamera : ScriptableObject { [MenuItem ("Custom/Select Main Camera ^c")] static void Select() { if (Camera.main != null) Selection.activeObject = Camera.main.gameObject; } } </csharp>

Personal tools
Namespaces

Variants
Actions
Navigation
Extras
Toolbox