Selection Detective for Unity

Link to GitHub page

Selection Detective is a tool for viewing and selecting contents of a GameObject and its children. With this tool you can easily select or find all the GameObjects that are using specific:

  • Components
  • Layers
  • Materials
  • Shaders
  • Names
  • Tags
  • Serialized/Public fields

Installation

You can clone this repository directly into your Packages folder in your project, add the git URL through Unity’s package manager, or through OpenUPM

Git + Unity Package Manager

Add this URL to your Unity Package manager as a git package

https://github.com/BedtimeDigitalGames/Unity-Selection-Detective.git#1.3.3

image

OpenUPM

$ openupm add com.bedtime.selection-detective

UnityPackage

Download

How to use

Right click any GameObject(s) in your scene and click “Selection Detective” to get started!

image

From here you can see what the entire contents of the selection and their hierarchy contains. Clicking on an item will select all the GameObjects using the item you clicked. This can be extremely useful to for example locate all the objects that use a specific shader, etc.

Examples

In these examples, A GameObject with thousands of children has been selected to showcase the various possible modes.

Components

Shows all the components used in this hierarchy. Clicking an item from the list will set your selection to all the GameObjects with this component attached.

1

Layers

Shows all the layers used in this hierarchy. Clicking an item from the list will set your selection to all the GameObjects using this layer.

2

Materials

Shows all the materials used in this hierarchy. Clicking an item from the list will set your selection to all the GameObjects with a renderer using this material.

3

Names

Shows all the GameObject names in this hierarchy. Clicking an item from the list will set your selection to all the GameObjects with this name.

4

Shaders

Shows all the shaders used in this hierarchy. Clicking an item from the list will set your selection to all the GameObjects with a renderer using this shader.

5

Tags

Shows all the tags used in this hierarchy. Clicking an item from the list will set your selection to all the GameObjects with this tag.

6

Serialized/Public Fields

Shows the names of all serialized fields of all the components of your selection hierarchy. Clicking an item from the list will set your selection to all the GameObjects with a component that has this specific field.

7