Version: 2022.3
言語: 日本語
public Search.QueryFilterOperator AddOperator (string op);

パラメーター

op The operator identifier.

戻り値

QueryFilterOperator The added, or existing, QueryFilterOperator.

説明

Add a custom filter operator specific to the filter.

Custom operators defined on a filter take precedence over operators defined globally on the QueryEngine. This is useful if you wish to have a custom operator only for a specific filter, or if you wish to override the default behavior of a built-in operator for a specific filter. If the operator already exists, the existing operator is returned.

// Override global operators with specific operator handlers for this filter
filter.AddOperator("=").AddHandler((Vector2 ev, Vector2 fv) => ev == fv);
filter.AddOperator("!=").AddHandler((Vector2 ev, Vector2 fv) => ev != fv);

See IQueryEngineFilter for a complete example.