Skip to content

Commit 560cec6

Browse files
committed
fix: tagquery preview
1 parent c0bf4a5 commit 560cec6

1 file changed

Lines changed: 2 additions & 10 deletions

File tree

Scripts/Editor/PropertyDrawers/CollectionItemQueryPropertyDrawer.cs

Lines changed: 2 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -453,24 +453,16 @@ private static bool HasItemIntersection(HashSet<(long, long)> a, HashSet<(long,
453453

454454
private static bool IsCombinationImpossible(int matchA, int matchB)
455455
{
456-
// Based on CollectionItemQuery.MatchType enum:
457-
// 0 = Any, 1 = All, 2 = NotAny, 3 = NotAll
456+
// 0 = Any, 1 = All (positive) | 2 = SomeNot, 3 = None (negative)
457+
// Invalid only when the same tag is in a positive and a negative rule.
458458
bool aPositive = matchA is 0 or 1;
459459
bool bPositive = matchB is 0 or 1;
460-
461460
bool aNegative = matchA is 2 or 3;
462461
bool bNegative = matchB is 2 or 3;
463462

464-
// Treat any combination of positive and negative on overlapping items as impossible.
465-
// Examples:
466-
// - Any + NotAny
467-
// - Any + NotAll
468-
// - All + NotAny
469-
// - All + NotAll
470463
if ((aPositive && bNegative) || (aNegative && bPositive))
471464
return true;
472465

473-
// Positive+positive and negative+negative are allowed.
474466
return false;
475467
}
476468
}

0 commit comments

Comments
 (0)