Hi there I cant find it or it doesnt exist, i would like to see all objects in the hierachy only containing a certain tag, is this possible??
well i cannot find a way to show only particular objects in hierarchy but i found a way to see the list of objects in a custom window and select the objects using that window in the hierarchy.
using UnityEngine;
using System.Collections;
using UnityEditor;
public class TagSearcher : EditorWindow {
static TagSearcher window;
static string tagValue="";
static string oldTagValue;
static Vector2 scrollValue=Vector2.zero;
static GameObject[] searchResult;
[MenuItem("EditorUtility/TagSearcher")]
static void OpenTagSearcher()
{
window = (TagSearcher)EditorWindow.GetWindow (typeof (TagSearcher));
searchResult = GameObject.FindGameObjectsWithTag(tagValue);
}
void OnGUI()
{
oldTagValue=tagValue;
tagValue=EditorGUILayout.TagField(tagValue);
if(tagValue != oldTagValue)
{
searchResult = GameObject.FindGameObjectsWithTag(tagValue);
Selection.objects = searchResult;
}
scrollValue=EditorGUILayout.BeginScrollView(scrollValue);
if(searchResult != null)
{
foreach(GameObject obj in searchResult)
{
if(obj !=null)
{
if(GUILayout.Button(obj.name))//,GUIStyle.none))
{
Selection.activeObject = obj;
EditorGUIUtility.PingObject(obj);
}
}
else
{
searchResult = GameObject.FindGameObjectsWithTag(tagValue);
Selection.objects = searchResult;
break;
}
}
}
EditorGUILayout.EndScrollView();
}
}
By default it will select all objects with that tag. but you can select the individual objects also using the window.
You can see object by component just by adding :
t:mycomponent in the search field or you can do something like Seth said :
http://docs.unity3d.com/Documentation/ScriptReference/Selection-objects.html