public List <T> GetComponentsByPath <T>(string path, List <string> except, RangeValue matchChildrenRange) where T : Component
        {
            var components = _behaviour.GetComponentsInChildrenWithSelf <T>(matchChildrenRange);

            return(components
                   .Where(arg =>
            {
                var componentPath = GetComponentPath(arg);
                if (except != null && except.Any(ex => componentPath.EqualsWildcard(ex)))
                {
                    return false;
                }
                return componentPath.EqualsWildcard(path);
            })
                   .ToList());
        }
Beispiel #2
0
 public List <T> GetComponents <T>(IBehaviourComponent component)
     where T : Component
 {
     if (!String.IsNullOrEmpty(Path))
     {
         return(component.GetComponentsByPath <T>(Path, ExceptPath, !String.IsNullOrEmpty(MatchChildrenRange) ? RangeValue.Parse(MatchChildrenRange) : null));
     }
     else if (!String.IsNullOrEmpty(Field))
     {
         return(component.GetComponentsByField <T>(Field));
     }
     else
     {
         return(component.GetComponentsByType <T>(!String.IsNullOrEmpty(MatchChildrenRange) ? RangeValue.Parse(MatchChildrenRange) : null));
     }
 }
 public List <T> GetComponentsByType <T>(RangeValue matchChildrenRange) where T : Component
 {
     return(_behaviour.GetComponentsInChildrenWithSelf <T>(matchChildrenRange).ToList());
 }