Repository navigation
Improvements and QoL
Highlights
- Requires Unity 6000.2 or newer. The package now uses
Object.GetEntityId(), which Unity 6000.0 and 6000.1 do not have. Stay on 2.6.0 for older editors. - Picker multi-object editing:
CollectionItemPickerfields can be edited across several selected objects without overwriting each object's own items. - Faster queries:
CollectionItemQuery<T>.Matchesuses bitmask matching against pickers and lists, and the query drawer now detects every impossible rule combination exactly. - Collection integrity fixes: swapping an item's script no longer duplicates it, and two assets sharing one GUID no longer cost the original its place in the collection.
- Sort Items By Name in the collection inspector context menu.
Added
- New
CONTEXT/ScriptableObjectCollection/Sort Items By Namecontext menu item on the collection inspector, next toCreate GeneratorandCreate Indirect Reference file. It calls the existingScriptableObjectCollection.OrderByName(), is undoable, and is disabled for collections that overrideShouldProtectItemOrder(the same collections that already forbid drag reordering). CollectionItemQuery<T>.Matches(IReadOnlyList<T>)overload (plus anout intvariant) and matchingCollectionItemMask64.From<T>(IReadOnlyList<T>, ...)overloads. List and array targets are walked by index, so matching them allocates no enumerator.CollectionItemPickerPropertyDrawernow fully supports editing multiple selected objects at once: the popup shows the union of items across all selected objects, items present on only some of them render dimmed with a "Value differs across selected objects" tooltip, toggling an item adds/removes exactly that item on every selected object (preserving each object's other items), and creating a new item from the picker appends it to every selected target instead of only the first.- New non-generic
CollectionItemQueryRulestatic class — the single source of truth for evaluating oneMatchTyperule (Passes(matchType, matchCount, pickerCount)). Both runtime match paths, the property drawer's validation, and the new test suite share it, so their semantics can no longer drift apart. CollectionItemQuery<T>.Matches(CollectionItemPicker<T> targetPicker)overload (plus anout intvariant). When the query's pickers and the target picker are bitmask-compatible on the same collection, matching is pure bit arithmetic on cached masks — zero allocation and no enumeration. Existing call sites that pass a picker (e.g. a tag list) bind to it automatically; anything else falls back to theIEnumerable<T>path.CollectionItemMask64.From<T>(items, expectedCollection, out bool fits)overload that flags (and excludes) items belonging to a different collection, since bit positions are only meaningful per-collection.CollectionItemPicker<T>.MaskCollection(the single collection all picked items share;nullwhen empty or mixed) andMaskItemCount(distinct items represented inCachedMask— unlikeCount, unaffected by duplicate or unresolvable serialized entries).- New editor-side
CollectionItemQuerySatisfiabilityhelper: exact satisfiability analysis of a query's rule set by enumerating presence assignments over the (few) referenced items, with a smallest-conflicting-subset finder for error attribution and a pairwise fallback above 16 distinct items. Covered by a brute-force EditMode test suite (Tests/Editor) that verifies agreement with the runtime semantics over every rule pair (4-item universe) and every rule triple (3-item universe).
Changed
- Minimum Unity version is now 6000.2 (
package.json"unity": "6000.2").ScriptableObjectCollectionandCollectionItemQueryPropertyDrawernow useObject.GetEntityId(), which Unity 6000.0 and 6000.1 do not have. The query drawer's memo key uses it in place ofGetInstanceID(). SOCItemGuidProcessornow adds every imported item to the collection itscollectionGUIDpoints to. Items restored from version control or created outside the inspector show up in their collection without a manual refresh. Items already in the collection are left as they are.- Picker popup selections now apply immediately per item toggle (via
OnItemSelectedEvent) instead of once when the popup closes — each click lands on the targets right away and repaints the inspector, which is what makes per-item multi-object application possible. - Picker stale-reference validation (
ValidateIndirectReferencesInProperty) now runs against every selected target and attributes the "Missing collection item reference" error log to the specific owning object; popup selection sync resolves items through a GUID dictionary instead of a per-elementFirstOrDefaultscan. CollectionItemQuery<T>.Matchesnow skips rules whose picker has no (resolvable) items instead of evaluating them. Previously an emptyAny/NotAllrule — e.g. a freshly added, not-yet-configured row — made the whole query permanently returnfalse. Empty rules are now inert, which also makesIsEmpty() == trueimplyMatches(...) == true, consistent with callers that useIsEmpty()as a "no filter configured" guard.CollectionItemPicker<T>.CanUseBitmasknow additionally requires every picked item to belong to the same collection (masks built from mixed collections would let unrelated items collide on the same bit).CollectionItemQueryPropertyDrawerimprovements: theMatchTypedropdown shows semantic hints ("Any (has at least one)", "Not All (missing at least one)", …); the query summary uses singular phrasing for one-item rules ("forbids objects that contain Frozen"); validation results are memoized per serialized content instead of recomputed twice per repaint; help box heights use the same width basis inGetPropertyHeightandOnGUI.
Fixed
- Changing an item's script on disk (an
m_Scriptedit followed by a reimport) no longer duplicates the item in its collection.Addnow matches entries byEntityIdand replaces a stale reference in place. The newRemoveRepeatedEntries()collapses repeated entries for the same asset, keeping the first index; it runs at the start ofRefreshCollectionand before the GUID pass inCollectionsRegistry.ValidateCollections. Previously the duplicate made the nextValidateCollectionsgive the live item a newLongGuid, which broke every reference stored by GUID. RefreshCollectionno longer drops the original when two distinct item assets share oneLongGuid. Its last dedupe loop walked from the end using the GUID-basedEquals, so it kept the later copy and orphaned the original: the original still pointed at the collection, butAddrefused it. Both entries now stay, andValidateCollectionsgives the later copy a new GUID while the original keeps its index and GUID.RefreshCollectionno longer callsRemoveAttwice for an entry that belongs to another collection and is also of the wrong item type. The second call removed an already-checked neighbour, or threw when the entry was last in the list.CollectionItemPickerPropertyDrawernow tracks its height per property path instead of in one shared field, so several pickers drawn by the same drawer (for example list elements) no longer take each other's height. A height change is applied on Repaint and triggers a repaint.- The collection inspector's "Add New" menu no longer lists open generic item types, which cannot be instantiated.
- Multi-editing a
CollectionItemPickerno longer overwrites every selected object's items with the first object's selection state. Previously the popup was seeded from the first target only and rebuilt the entireindirectReferencesarray from that view on close, applying it to all selected objects and silently discarding their per-object differences. SOCItemGuidProcessorduplicate detection is now keyed on Unity asset GUIDs (.metaGUIDs, which survive renames and moves) instead of asset paths, so renaming or moving a collection item asset is no longer misdetected as a duplicated asset — previously that regenerated the item'sLongGuidand broke existing indirect references to it.- The property drawer's impossible-query detection is now exact instead of pairwise, closing three verified gaps:
Any{t}+NotAll{t}on the same single item was never flagged; rules with empty pickers (which silently made the query unmatchable) were never flagged (now surfaced as an info note since they are skipped); and multi-rule conflicts invisible to any pairwise check (e.g.Any{a}+Any{b}+NotAll{a,b}) were never flagged. Error messages now name the smallest conflicting rule subset ("Rules 1 and 3 can never all be satisfied"). - The drawer's "Add Rule" button no longer clones the previous rule's picker items into the new rule (
SerializedPropertyarray growth duplicates the last element's data; only theMatchTypewas being reset). MatchesViaGuidsnow counts only resolvable picker items when evaluating a rule, matching the bitmask path (which prunes stale references). Previously a dead item reference silently madeAllrules unsatisfiable andNotAllrules always pass on the GUID path only.MatchesViaBitmaskno longer mixes target items from foreign collections into the comparison mask: targets are masked against the query's shared collection and any mismatch falls back to the GUID path (the previous behavior could report false matches when two collections of the same item type were in use).CollectionItemQuery<T>.QuerySet.ToString()no longer allocates via LINQ and no longer throws on unresolvable picker entries (delegates toCollectionItemPicker<T>.ToString()).
Full Changelog: v2.6.0...v2.7.0