private static void Menu_Search(MenuCommand cmnd) { if (cmnd.context == null) { return; } if (_defaultSearchTool == null) { _defaultSearchTool = new FindReferencesToObjectMenu(); } GameObject go = GameObjectUtil.GetGameObjectFromSource(cmnd.context); if (go == null) { return; } int iid = go.GetInstanceID(); var arr = _defaultSearchTool.Search_Imp(iid); //Selection.objects = arr; foreach (var obj in arr) { Debug.Log(obj.GetType().FullName, obj); if (obj is Component) { EditorGUIUtility.PingObject(obj.gameObject.GetInstanceID()); } } }
private static void Menu_Search(MenuCommand cmnd) { if (cmnd.context == null) { return; } if (_defaultSearchTool == null) { _defaultSearchTool = new FindReferencesToObjectMenu(); } int iid = cmnd.context.GetInstanceID(); var arr = _defaultSearchTool.Search_Imp(iid); Selection.objects = arr; //foreach(var obj in arr) //{ // EditorGUIUtility.PingObject(obj.GetInstanceID()); //} }