Class ComponentFilterBuilder<TComponent>
Builder for configuring filters on component bindings.
public class ComponentFilterBuilder<TComponent> where TComponent : class
Type Parameters
TComponentThe type of the component being filtered.
- Inheritance
-
objectComponentFilterBuilder<TComponent>
Constructors
ComponentFilterBuilder(ComponentBinding)
Initializes a new instance of the ComponentFilterBuilder<TComponent> class.
public ComponentFilterBuilder(ComponentBinding binding)
Parameters
bindingComponentBindingThe component binding to configure.
Methods
Where(Func<TComponent, bool>)
Filter using a predicate on TComponent for custom search logic.
public ComponentFilterBuilder<TComponent> Where(Func<TComponent, bool> predicate)
Parameters
predicateFunc<TComponent, bool>The predicate function.
Returns
- ComponentFilterBuilder<TComponent>
The builder instance for fluent chaining.
WhereAnyAncestor(Func<Transform, bool>, bool, int)
Filter using a predicate on any ancestor UnityEngine.Transform of the candidate. Supports optional inclusion of the candidate itself and limiting the depth.
public ComponentFilterBuilder<TComponent> WhereAnyAncestor(Func<Transform, bool> predicate, bool includeSelf = false, int maxDepth = 2147483647)
Parameters
predicateFunc<Transform, bool>The predicate function.
includeSelfboolWhether to include the candidate itself.
maxDepthintThe maximum search depth.
Returns
- ComponentFilterBuilder<TComponent>
The builder instance for fluent chaining.
WhereAnyChild(Func<Transform, bool>)
Filter using a predicate on any direct child UnityEngine.Transform of the candidate.
public ComponentFilterBuilder<TComponent> WhereAnyChild(Func<Transform, bool> predicate)
Parameters
predicateFunc<Transform, bool>The predicate function.
Returns
- ComponentFilterBuilder<TComponent>
The builder instance for fluent chaining.
WhereAnyDescendant(Func<Transform, bool>, bool)
Filter using a predicate on any descendant UnityEngine.Transform of the candidate (recursive search). Supports optional inclusion of the candidate itself.
public ComponentFilterBuilder<TComponent> WhereAnyDescendant(Func<Transform, bool> predicate, bool includeSelf = false)
Parameters
predicateFunc<Transform, bool>The predicate function.
includeSelfboolWhether to include the candidate itself.
Returns
- ComponentFilterBuilder<TComponent>
The builder instance for fluent chaining.
WhereAnySibling(Func<Transform, bool>)
Filter using a predicate on any sibling UnityEngine.Transform of the candidate (excluding itself).
public ComponentFilterBuilder<TComponent> WhereAnySibling(Func<Transform, bool> predicate)
Parameters
predicateFunc<Transform, bool>The predicate function.
Returns
- ComponentFilterBuilder<TComponent>
The builder instance for fluent chaining.
WhereChildAt(int, Func<Transform, bool>)
Filter using a predicate on the child at a specific index.
public ComponentFilterBuilder<TComponent> WhereChildAt(int index, Func<Transform, bool> predicate)
Parameters
indexintThe child index.
predicateFunc<Transform, bool>The predicate function.
Returns
- ComponentFilterBuilder<TComponent>
The builder instance for fluent chaining.
WhereComponent(Func<Component, bool>)
Filter using a predicate on TComponent as Plugins.Saneject.Runtime.Bindings.Component for custom search logic. Useful if TComponent is an interface.
public ComponentFilterBuilder<TComponent> WhereComponent(Func<Component, bool> predicate)
Parameters
predicateFunc<Component, bool>The predicate function.
Returns
- ComponentFilterBuilder<TComponent>
The builder instance for fluent chaining.
WhereFirstChild(Func<Transform, bool>)
Filter using a predicate on the first direct child of the candidate.
public ComponentFilterBuilder<TComponent> WhereFirstChild(Func<Transform, bool> predicate)
Parameters
predicateFunc<Transform, bool>The predicate function.
Returns
- ComponentFilterBuilder<TComponent>
The builder instance for fluent chaining.
WhereGameObject(Func<GameObject, bool>)
Filter using a predicate on the candidate’s own UnityEngine.GameObject.
public ComponentFilterBuilder<TComponent> WhereGameObject(Func<GameObject, bool> predicate)
Parameters
predicateFunc<GameObject, bool>The predicate function.
Returns
- ComponentFilterBuilder<TComponent>
The builder instance for fluent chaining.
WhereLastChild(Func<Transform, bool>)
Filter using a predicate on the last direct child of the candidate.
public ComponentFilterBuilder<TComponent> WhereLastChild(Func<Transform, bool> predicate)
Parameters
predicateFunc<Transform, bool>The predicate function.
Returns
- ComponentFilterBuilder<TComponent>
The builder instance for fluent chaining.
WhereParent(Func<Transform, bool>)
Filter using a predicate on the candidate’s immediate parent UnityEngine.Transform.
public ComponentFilterBuilder<TComponent> WhereParent(Func<Transform, bool> predicate)
Parameters
predicateFunc<Transform, bool>The predicate function.
Returns
- ComponentFilterBuilder<TComponent>
The builder instance for fluent chaining.
WhereRoot(Func<Transform, bool>)
Filter using a predicate on the candidate’s root UnityEngine.Transform.
public ComponentFilterBuilder<TComponent> WhereRoot(Func<Transform, bool> predicate)
Parameters
predicateFunc<Transform, bool>The predicate function.
Returns
- ComponentFilterBuilder<TComponent>
The builder instance for fluent chaining.
WhereTransform(Func<Transform, bool>)
Filter using a predicate on the candidate’s own UnityEngine.Transform.
public ComponentFilterBuilder<TComponent> WhereTransform(Func<Transform, bool> predicate)
Parameters
predicateFunc<Transform, bool>The predicate function.
Returns
- ComponentFilterBuilder<TComponent>
The builder instance for fluent chaining.