Beispiel #1
0
 public override void SearchProperty(SearchJob job, SearchItem item, SerializedProperty prop)
 {
     if (isCollection())
     {
         //Time for some freakish magic!
         SerializedProperty iterator = prop.Copy();
         iterator.Next(true);
         iterator.Next(true);
         int count = iterator.intValue;
         for (int i = 0; i < count; i++)
         {
             iterator.Next(false);
             typeField.SearchProperty(job, item, iterator);
         }
     }
 }
Beispiel #2
0
 public override void SearchProperty(SearchJob job, SerializedProperty prop)
 {
     // Debug.Log("[SearchItemProperty] Searching:"+prop.serializedObject.targetObject);
     //if the type of object we are searching matches the target object's type
     // then search the property. For example, if we're searching for MyBehaviour
     // require that this is searchable by that type.
     if (searchProperty.fieldData.objectType.IsAssignableFrom(prop.serializedObject.targetObject.GetType()))
     {
         job.assetData.searchExecuted = true;
         List <SerializedProperty> foundProps = searchProperty.fieldData.findProperties(prop);
         foreach (SerializedProperty foundProp in foundProps)
         {
             propertyCriteria.SearchProperty(job, this, foundProp);
         }
     }
     else
     {
         // Debug.Log("[SearchItemProperty] not assignable:"+searchProperty.fieldData.objectType + " to  "+ prop.serializedObject.targetObject);
     }
 }
Beispiel #3
0
        public override void SearchProperty(SearchJob job, SearchItem item, SerializedProperty prop)
        {
            //Time for some freakish magic!
            SerializedProperty iterator = prop.Copy();

            while (iterator.NextVisible(true))
            {
                if (typeField.PropertyType() == iterator.propertyType)
                {
                    //might need to add a guard against collections or something?
                    typeField.SearchProperty(job, item, iterator);
                }
            }
            // iterator.Next(true);
            // iterator.Next(true);
            // int count = iterator.intValue;
            // for(int i=0;i < count; i++)
            // {
            //   iterator.Next(false);
            //   typeField.SearchProperty(job, item, iterator);
            // }
        }
Beispiel #4
0
        public override void SearchProperty(SearchJob job, SearchItem item, SerializedProperty prop)
        {
            //Time for some freakish magic!
            SerializedProperty iterator = prop.Copy();

            while (iterator.NextVisible(true))
            {
                if (typeField.PropertyType() == iterator.propertyType)
                {
                    if (isSearchByName)
                    {
                        // path = prop.propertyPath + .data[x].second
                        var path = iterator.propertyPath;
                        // path = data[x].second
                        path = path.Substring(prop.propertyPath.Length + 1);
                        // path = data[x]
                        const string endOfPath = "].";
                        path = path.Substring(0, path.LastIndexOf(endOfPath) + endOfPath.Length);
                        if (prop.FindPropertyRelative(path + "first").stringValue != searchByNameValue)
                        {
                            continue;
                        }
                    }
                    //might need to add a guard against collections or something?
                    typeField.SearchProperty(job, item, iterator);
                }
            }
            // iterator.Next(true);
            // iterator.Next(true);
            // int count = iterator.intValue;
            // for(int i=0;i < count; i++)
            // {
            //   iterator.Next(false);
            //   typeField.SearchProperty(job, item, iterator);
            // }
        }