Example #1
0
        public override void SearchGameObject(SearchJob job, GameObject go)
        {
            job.assetData.searchExecuted = true;
            //We only do this search if its a game object AND its a search (NOT a replace).
            if (searchAsGameObject != null && job.options.searchType == SearchType.Search && subsearch == null)
            {
                // if(searchAsGameObject == go)
                // {
                //   Debug.Log("[SearchItemGlobal] FOUND THING");
                // }
#if UNITY_2018_2 || UNITY_2018_3 || UNITY_2018_4
                UnityEngine.Object goPrefab = PrefabUtility.GetCorrespondingObjectFromSource(go);
#else
                UnityEngine.Object goPrefab = PrefabUtility.GetPrefabParent(go);
#endif

                // Debug.Log("[SearchItemGlobal] goPrefab:"+goPrefab);
                if (goPrefab != null && goPrefab == searchAsGameObject)
                {
                    SearchResult result = new SearchResult();
                    result.strRep      = "";
                    result.pathInfo    = PathInfo.GetPathInfo(go, job);
                    result.actionTaken = SearchAction.InstanceFound;
                    job.MatchFound(result, this);
                }
            }
            typeField.SearchGameObject(job, this, go);
        }