Esempio n. 1
0
 void searchPropertyInternal(SearchJob job, SearchItem item, SerializedProperty prop, SerializedProperty iterator)
 {
     if (iterator.propertyType == typeField.PropertyType())
     {
         // Debug.Log("[SearchItemGlobal] Searching:"+iterator.propertyPath);
         if (typeField.ValueEqualsWithConditional(iterator))
         {
             if (item.subsearch != null)
             {
                 SearchItem subItem = (SearchItem)item.subsearch;
                 subItem.SubsearchProperty(job, prop);
             }
             else
             {
                 SearchResultProperty result = new SearchResultProperty(iterator, typeField.StringValueFor(iterator), job);
                 // If the prefab type is 'instance' then only add the
                 // search result if it is a modification to the original
                 // prefab.
                 // We iterate over prefab separately and the PrefabType will simply
                 // be 'Prefab' and we should handle that before we handle scenes.
                 if (result.pathInfo.prefabType == PrefabType.PrefabInstance)
                 {
                     if (job.options.searchType == SearchType.SearchAndReplace)
                     {
                         result.actionTaken = SearchAction.InstanceReplaced;
                     }
                     else
                     {
                         result.actionTaken = SearchAction.InstanceFound;
                     }
                     // if(item.subsearch == null && PrefabUtil.isInstanceModification(iterator))
                     // {
                     //Apply change, only if change already exists!
                     typeField.ReplaceProperty(job, iterator, result);
                     // }
                     job.MatchFound(result, item);
                 }
                 else
                 {
                     if (item.subsearch == null)
                     {
                         typeField.ReplaceProperty(job, iterator, result);
                     }
                     job.MatchFound(result, item);
                 }
             }
         }
     }
 }
Esempio n. 2
0
 public override void ReplaceProperty(SearchJob job, SerializedProperty prop, SearchResult result)
 {
     typeField.ReplaceProperty(job, prop, result);
 }