Deselect

From Unify Community Wiki
(Difference between revisions)
Jump to: navigation, search
m (C# - SelectMainCamera.cs)
Line 10: Line 10:
 
Place this script in ''YourProject/Assets/Editor'' and a menu item will automatically appear in the Custom menu after it is compiled.
 
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==
+
==C# - DeselectAll.cs==
 
<csharp>using UnityEngine;
 
<csharp>using UnityEngine;
 
using UnityEditor;
 
using UnityEditor;
  
public class Deselect : ScriptableObject
+
public class DeselectAll : ScriptableObject
 
{
 
{
     [MenuItem ("Custom/Deselect _a")]
+
     [MenuItem ("Custom/Deselect All _a")]
 
     static void DoDeselect()
 
     static void DoDeselect()
 
     {
 
     {
         Selection.objects = null;
+
         Selection.objects = new UnityEngine.Object[0];
 
     }
 
     }
 
}
 
}
 
</csharp>
 
</csharp>

Revision as of 08:42, 11 October 2008

Author: Jonathan Czeck (aarku)

Description

This editor script sets the current selection to nothing. It deselects.

Usage

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

C# - DeselectAll.cs

<csharp>using UnityEngine; using UnityEditor;

public class DeselectAll : ScriptableObject {

   [MenuItem ("Custom/Deselect All _a")]
   static void DoDeselect()
   {
       Selection.objects = new UnityEngine.Object[0];
   }

} </csharp>

Personal tools
Namespaces

Variants
Actions
Navigation
Extras
Toolbox