Skip to content

Latest commit

 

History

History
903 lines (766 loc) · 63.7 KB

CHANGELOG.MD

File metadata and controls

903 lines (766 loc) · 63.7 KB

Changelog

All notable changes to this project will be documented in this file.

The format is based on Keep a Changelog, and this project adheres to Semantic Versioning.

[3.0.0] - 11/21/2026

Removed

  • The 64-bit bitmask match path. Target sets are small, so the mask saved little time, and it meant two match paths that had to agree. This is a breaking change for code that uses the removed API:
    • CollectionItemMask64, with the ToItemMask64 and FromItemMask64 extension methods.
    • CollectionItemPicker<T>.CanUseBitmask, CachedMask, MaskCollection, MaskItemCount and both CountMatchesIn overloads.
    • ScriptableObjectCollection.SupportsBitmaskIndexing. Delete any override of it.
    • CollectionItemQuery<T>.Matches(CollectionItemPicker<T>) and its out int variant. A call that passes a picker still compiles and now binds to Matches(IEnumerable<T>).

Changed

  • CollectionItemQuery<T>.Matches always matches by item GUID. Results are the same as before. Pickers are no longer limited to 64 items or to one collection.
  • The GUID match compares GUIDs in a plain loop instead of filling two HashSet<LongGuid> on every call. Target sets are small, so the loop is faster and the query holds less state.

[2.8.0] - 11/13/2026

Added

  • CollectionItemQuery<T>.MatchType.AtLeast: the set passes when the target has at least MinimumCount of the picked items, for "at least N of these" checks the other match types cannot express. Each QuerySet has a new serialized minimumCount field (default 1) that only AtLeast reads. CollectionItemQueryRule.Passes takes it as an optional fourth parameter, and a value below 1 counts as 1.
  • CollectionItemQuerySatisfiability.Rule carries the minimum count, so the drawer's conflict check covers AtLeast. Above 16 distinct items, the fallback check now also flags a single rule that can never pass (such as AtLeast 3 of 2 items) and AtLeast conflicts with NotAny and NotAll. The brute-force test suite covers AtLeast with every count.
  • CollectionItemQueryPropertyDrawer shows a count field next to an AtLeast rule, and the summary describes it. "Add Rule" resets the count to 1 instead of copying the previous rule's.

Changed

  • The match types have sentence labels in the inspector through [InspectorName]: "Has any of", "Has all of", "Has none of", "Is missing one of" and "Has at least". The enum names and serialized values are unchanged.
  • The match type in CollectionItemQueryPropertyDrawer is a dropdown button sized to the longest label. Its menu greys out the match types that would make the query never match, instead of hiding them.
  • The summary describes Any with more than one item as "requires objects to contain at least one of", instead of "allows objects that contain".
  • A query with no picked items shows "(matches everything)" after its label.

Fixed

  • The GUID match path counts an item picked twice in one set once, like the bitmask path. Before, AtLeast 2 of [A, A] passed for a target holding only A.
  • CollectionItemQueryPropertyDrawer no longer indents its rows a second time when the query is drawn inside an indented parent.
  • Help box heights use the width they are drawn at, so long messages are not clipped in narrow or nested inspectors.
  • The match type and count fields support prefab overrides (bold label, right-click revert) and show a mixed value when the selected objects differ.

2.7.1 - 11/05/2026

Fixed

  • package.json now declares "unity": "6000.2". 2.7.0 already needed Unity 6000.2, because it calls Object.GetEntityId(), but it still declared 6000.0, so the Package Manager allowed installing it on editors where it does not compile.
  • The README System Requirements now say Unity 6000.2 or later, instead of 2018.4.
  • The 2.7.0 changelog entries are complete. The 2.7.0 tag shipped without the entries for its last fixes.

No code changes since 2.7.0.

2.7.0 - 11/05/2026

Added

  • New CONTEXT/ScriptableObjectCollection/Sort Items By Name context menu item on the collection inspector, next to Create Generator and Create Indirect Reference file. It calls the existing ScriptableObjectCollection.OrderByName(), is undoable, and is disabled for collections that override ShouldProtectItemOrder (the same collections that already forbid drag reordering).
  • CollectionItemQuery<T>.Matches(IReadOnlyList<T>) overload (plus an out int variant) and matching CollectionItemMask64.From<T>(IReadOnlyList<T>, ...) overloads. List and array targets are walked by index, so matching them allocates no enumerator.
  • CollectionItemPickerPropertyDrawer now 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 CollectionItemQueryRule static class — the single source of truth for evaluating one MatchType rule (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 an out int variant). 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 the IEnumerable<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; null when empty or mixed) and MaskItemCount (distinct items represented in CachedMask — unlike Count, unaffected by duplicate or unresolvable serialized entries).
  • New editor-side CollectionItemQuerySatisfiability helper: 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

  • Requires Unity 6000.2 or newer. ScriptableObjectCollection and CollectionItemQueryPropertyDrawer now use Object.GetEntityId(), which Unity 6000.0 and 6000.1 do not have. The query drawer's memo key uses it in place of GetInstanceID(). This release's package.json still declared "unity": "6000.0"; 2.7.1 corrects it.
  • SOCItemGuidProcessor now adds every imported item to the collection its collectionGUID points 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-element FirstOrDefault scan.
  • CollectionItemQuery<T>.Matches now skips rules whose picker has no (resolvable) items instead of evaluating them. Previously an empty Any/NotAll rule — e.g. a freshly added, not-yet-configured row — made the whole query permanently return false. Empty rules are now inert, which also makes IsEmpty() == true imply Matches(...) == true, consistent with callers that use IsEmpty() as a "no filter configured" guard.
  • CollectionItemPicker<T>.CanUseBitmask now 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).
  • CollectionItemQueryPropertyDrawer improvements: the MatchType dropdown 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 in GetPropertyHeight and OnGUI.

Fixed

  • Changing an item's script on disk (an m_Script edit followed by a reimport) no longer duplicates the item in its collection. Add now matches entries by EntityId and replaces a stale reference in place. The new RemoveRepeatedEntries() collapses repeated entries for the same asset, keeping the first index; it runs at the start of RefreshCollection and before the GUID pass in CollectionsRegistry.ValidateCollections. Previously the duplicate made the next ValidateCollections give the live item a new LongGuid, which broke every reference stored by GUID.
  • RefreshCollection no longer drops the original when two distinct item assets share one LongGuid. Its last dedupe loop walked from the end using the GUID-based Equals, so it kept the later copy and orphaned the original: the original still pointed at the collection, but Add refused it. Both entries now stay, and ValidateCollections gives the later copy a new GUID while the original keeps its index and GUID.
  • RefreshCollection no longer calls RemoveAt twice 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.
  • CollectionItemPickerPropertyDrawer now 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 CollectionItemPicker no 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 entire indirectReferences array from that view on close, applying it to all selected objects and silently discarding their per-object differences.
  • SOCItemGuidProcessor duplicate detection is now keyed on Unity asset GUIDs (.meta GUIDs, 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's LongGuid and 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 (SerializedProperty array growth duplicates the last element's data; only the MatchType was being reset).
  • MatchesViaGuids now counts only resolvable picker items when evaluating a rule, matching the bitmask path (which prunes stale references). Previously a dead item reference silently made All rules unsatisfiable and NotAll rules always pass on the GUID path only.
  • MatchesViaBitmask no 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 to CollectionItemPicker<T>.ToString()).

2.6.0 - 05/16/2026

Added

  • New PreviewMode enum (Default/Inline/PropertyEditorWindow) on SOCItemEditorOptionsAttribute, plus a matching project-wide default in SOCSettings (Project Settings > Scriptable Object Collection > Item Inspector). When set to PropertyEditorWindow, the per-field Edit button opens Unity's floating Property Editor via EditorUtility.OpenPropertyEditor instead of the inline preview panel — fixes rendering issues with third-party inspectors (e.g. Odin) that don't draw correctly in the inline IMGUI drawer. Default on the attribute defers to the project setting; project setting defaults to Inline so existing behavior is unchanged.
  • New CollectionItemMask64 static helper plus IEnumerable<T>.ToItemMask64<T>() and List<T>.FromItemMask64<T>() extension methods. Provides a 64-bit bitmask representation of a set of collection items keyed on ScriptableObjectCollectionItem.Index, with Bit/Has/Add/Remove/Overlaps/IsSubsetOf helpers and a From<T>(items, out bool fits) builder that flags when any item's Index >= 64. Bit positions are per-collection — callers are responsible for only comparing masks built from items of the same collection.
  • CollectionItemPicker<T> now exposes a cached bitmask (CachedMask) and a CanUseBitmask gate (combines MaskFitsIn64 with every item collection's SupportsBitmaskIndexing flag), plus CountMatchesIn(ulong) and CountMatchesIn(IEnumerable<T>) overloads backed by a SWAR PopCount. The mask is rebuilt on OnAfterDeserialize, on every mutating operation (Add/Clear/Remove/Insert/RemoveAt/indexer set), and lazily in Edit Mode; reused without rebuild in Play Mode.
  • ScriptableObjectCollection virtual SupportsBitmaskIndexing (default true). Override to false on collections whose item ordering can change at runtime (e.g. CDN-delivered content) so the bitmask fast path is skipped — each item's Index is cached on first access and would otherwise go stale after a reorder.
  • CollectionItemPicker<T>.ToString() override returning [item1, item2, ...] (empty collection renders as []; null entries render as <null>). Uses StringBuilder to avoid per-call allocations on long pickers.
  • CollectionItemQuery<T>.IsEmpty() returns true when every QuerySet's picker contains zero items — useful for skipping the Matches evaluation on default-constructed queries.
  • CollectionItemPickerPropertyDrawer now writes itemLastKnownName and collectionLastKnownName when an entry is added to a picker, so newly added items have populated cache names immediately instead of empty strings.

Changed

  • Reverted CollectionItemQuery.MatchType enum values: SomeNot → NotAny, None → NotAll. The new names mirror Any/All and describe the actual semantics (target has none of the picker items / target is missing at least one of them). Integer values are preserved (2 and 3), so existing serialized QuerySet data deserializes unchanged.
  • Added XML documentation on MatchType values and the Matches method to surface the semantics in IntelliSense.
  • CollectionItemQuery<T>.Matches now selects between a bitmask fast path (MatchesViaBitmask) and the existing GUID-based path (MatchesViaGuids) at the start of each call. The bitmask path is used only when every QuerySet's picker reports CanUseBitmask == true; otherwise the call falls back to the original GUID comparison. Match results are unchanged — only the evaluation strategy.
  • CollectionItemPicker<T> events renamed: OnItemTypeAddedEvent → OnItemAddedEvent, OnItemTypeRemovedEvent → OnItemRemovedEvent. The old names are preserved as [Obsolete] shims with explicit add/remove accessors that forward subscriptions to the new events, so existing +=/-= call sites keep compiling with a deprecation warning pointing to the new name. The shims will be removed in a future major version. OnChangedEvent is unchanged.
  • CollectionItemIndirectReference.itemLastKnownName and collectionLastKnownName are now wrapped in #if UNITY_EDITOR and no longer compiled into player builds. Runtime resolution relies exclusively on GUIDs.
  • CollectionItemQuery<T>.Matches(IEnumerable<T> targetItems, out int) now tolerates a null targetItems — treated as empty, so Any/All sets fail and NotAny/NotAll sets pass.

Fixed

  • CollectionItemQueryPropertyDrawer.IsCombinationImpossible no longer reports false positives for Any + NotAny and All + NotAll rule pairs. Impossibility for these now requires the stricter subset relationship between pickers (not just any intersection), matching the real-world satisfiability. All + NotAny continues to be flagged on any intersection, which is correct.
  • CollectionItemPicker and CollectionItemIndirectReference<T> now implement ISerializationCallbackReceiver to invalidate their runtime caches on deserialization, so inspector edits to a picker during Play Mode take effect immediately instead of returning the stale cached Items/Ref.
  • CollectionItemIndirectReferencePropertyDrawer now re-syncs stale itemLastKnownName/collectionLastKnownName from the live asset and collection names on every draw (via ApplyModifiedPropertiesWithoutUndo), preventing the cached names from drifting when an asset is renamed outside the inspector.

Removed

  • Removed the runtime fallback in CollectionItemIndirectReference.TryGetCollectionItem that, when the stored GUIDs failed to resolve, attempted to look the collection and item back up by collectionLastKnownName/itemLastKnownName. With the names now editor-only, GUID is the single runtime lookup path; rename recovery is handled at edit time by the drawer instead.
  • Removed long-deprecated [Obsolete] API surface that has been carrying compile warnings across prior releases:
    • SOCSettings.SetDefaultNamespace(string) — use SetNamespacePrefix(string) instead.
    • The four ScriptableObjectCollectionUtility.CreateScriptableObjectOfType(...) overloads that took a parentFolder / parentFolderPath plus a createFolderForThisCollection bool. Use the overloads that take a complete path; build the path with Path.Combine at the call site if you previously relied on the auto-folder behavior.
    • DrawAsSOCItemAttribute — no longer needed since Unity 2022.2 supports PropertyDrawer on interfaces directly.
    • CollectionItemEditorOptions class — use SOCItemEditorOptionsAttribute instead.
    • CollectionsRegistry.GetCollectionByGUID(string) — use the LongGuid overload (regenerate your collection's static access class to pick up the new GUID type).
    • ScriptableObjectCollection.GetItemByGUID(string) — use the LongGuid overload (same: regenerate the static access class).

2.5.1 - 06/04/2026

Added

  • New SOCItemGuidProcessor asset postprocessor that enforces valid and unique GUIDs on collection items at import time, replacing the inline validation in CollectionsAssetsPostProcessor
  • Custom CollectionItemQueryPropertyDrawer with foldout UI, rule editing, match type constraint filtering, impossible-rule detection, and human-readable query summaries
  • GUID-based lookup caching for collections (CollectionsRegistry) and items (ScriptableObjectCollection) for faster retrieval
  • CollectionItemIndirectReference now caches resolved references with a hasCachedRef flag to avoid repeated resolution attempts
  • Enhanced error logging in CollectionItemPickerPropertyDrawer with last known names and property paths
  • DrawAdditionalIMGUI() extension point in CollectionCustomEditor for subclass customization
  • GitHub Copilot review instructions (.github/instructions.md)

Changed

  • Renamed CollectionItemQuery.MatchType enum values: NotAny → SomeNot, NotAll → None
  • Reduced GC allocations in CollectionItemQuery.Matches() by reusing a HashSet instead of creating a new one per call (by @emtony)
  • CollectionItemDropdown now redirects to the collection when the item type has derived types, instead of immediately creating an item
  • Code generation now outputs UTF-8 without BOM and handles both \r\n and \n line endings
  • Refactored new modifier detection logic in code generation with improved base type filtering
  • CollectionItemPicker now uses reverse iteration for safe removal during enumeration
  • Refactored CollectionsRegistry.ValidateCollections() to validate items within collections using HashSets for duplicate detection
  • Improved bidirectional type assignability check in CollectionsRegistry.GetCollectionsByItemType()
  • Robust UXML asset loading in CollectionCustomEditor with error handling for missing visual tree assets

Fixed

  • ScriptableObjectCollection<T>.ClearCachedValues() now calls base.ClearCachedValues() to properly clear name/GUID lookup dictionaries
  • GUID cache lookups (TryGetItemByGUID, GetCollectionByGUID) now validate the cached entry's GUID still matches before returning, evicting stale entries
  • SOCItemGuidProcessor deleted asset handling: entries are now removed by path matching instead of attempting to load already-deleted assets
  • Removed UTF-8 BOM from SOCItemGuidProcessor.cs and its .meta file
  • Fixed typo IsKnowCollection → IsKnownCollection across multiple files
  • Fixed typo collectionLastKnowName → collectionLastKnownName with FormerlySerializedAs for backward compatibility
  • Fixed method name SetUsingBaseClassForItems → SetUseBaseClassForItems
  • Improved null/destroyed Unity object equality checks in ScriptableObjectCollectionItem
  • Removed OnValidate() auto-GUID generation from ScriptableObjectCollectionItem (now handled by the processor)

2.5.0 - 04/12/2025

Changed

  • Fixed issue with the TreeView and the unity version compatibility by @RoyTheunissen #182
  • LongGuids are now displayed via their base64 string by @RoyTheunissen #184
  • IndirectReferences are not generated per item type, so it can filter what type of items can be displayed on the picker
  • Fixed issue where renaming one asset on the CollectionEditor could cause some issues
  • Fixed IndirectReference not properly saving items from the dropdown when used inside arrays
  • Fixed overall issues with the CollectionItemQuery.cs
  • Fixed Item picker not respecting the inheritance of items when displayin the picker
  • GUID are now not serialized when invalid, so it doesn't get reserialized in invalid states (#183)

Added

  • Added the option to omit labels in arrays and lists by @RoyTheunissen #181
  • Added indirect conversion between IndirectReference and Item type so they can used as regular SOCItem
  • Menu for generating Static Access for all the collection under the Tools/ScriptableObjectCollection menu
  • Menu for generating Indirect Reference file for all the collection under the Tools/ScriptableObjectCollection menu
  • Added extra validation for valid filenames when creating new collections/items

2.4.2 - 07/10/2025

Changed

  • Fixed the assembly definition search not checking for consistent fold… by @RoyTheunissen in #177
  • Set up menu paths so they update if you rename the collection by @RoyTheunissen in #178
  • Feature/small fixes by @brunomikoski in #179

2.4.1 - 21/08/2025

Changed

  • Fixed issue when creating multiple items without renaming it would cause a null reference.
  • Removed Synchronize Assets button from the Collection Editor, this is already happening multiple times
  • Renamed Generator button to Run Generator instead of Generate Items since was misleading
  • Fixed use of AssetPathExists on older Unity versions
  • Removed Syncronize Button (was not needed anymore)
  • Fixed generator not refreshing CollectionEditor after running the generator
  • Fixed unique name generation for new items

Added

  • Added new label options to make the picker smaller

2.4.0 - 24/05/2025

Changed

  • Fixed generated static access code overwriting the collection definition
  • Pre 2.3.0 collections will now be assumed to want a namespace setting that is the same namespace as its item type
  • When generating static/indirect access code using the new .g.cs suffix, existing static/indirect access code that uses the old .cs suffix is now automatically removed to prevent compile errors
  • Added Generic SetValue for Collection Generator

2.3.9 - 19/02/2025

Changed

  • Added some general fixes to validate Collection and Items have unique LongGuid
  • Fixed issues when after some operation with the context menu on the CollectionEditor items would not refresh properly
  • Fixed issue when moving items between collection would not generate unique names
  • Removed the post processing of assets that tried to assign items to collections automatically, since this was causing issue when duplicating collections, everyting now is done on the collection
  • Overall code improvement and organization

Added

  • Added new Context Menu for moving items between collections
  • Added the new PropertyDrawer that shows what Collection every item belongs to
  • Added a few more Confirmation dialog when detecting items that looks wrong

2.3.8 - 30/01/2025

Changed

  • Fixed naming issue on the new Move Items context menu introduced on 2.3.7
  • Renamed Delete Item to Remove Item on the context menu
  • Updated the Confirmation for the Removal of items, now ask if you just want to remove the reference, remove the reference and delete the asset or cancel the operation
  • Exposed OnEnable and OnDisable from the CollectionCustomEditor to be overriden by other editors

Added

  • Added new context menu to move items between collections
  • Added new Rename context menu
  • Added new CollectionItemQuery to be used with ItemPicker

Changed

  • Improved Unity 6 support
  • Fixed null ref when collections settings where not set
  • Fixed some renaming issues
  • Changed event where non automatically loaded items are removed on editor simulation
  • Fixed null ref on empty collection

Changed

  • Updated ListView to allow for multiple selection
  • Updated Context Menu functionality to support multiple selection (Copy/Paste/Duplicate/Delete)

Changed

  • Added ApplyModifiedProperties() to property drawers again, since was causing issues with the shareable picker. This was removed on 2.3.4

Changed

  • Update PickerPropertyDrawer to use PopupList from property path cache to avoid issue when rendered inside a List/Array
  • Update CollectionRegistry to search for the ScriptableObjectCollection using the AssetDatabase.FindAssets instead of the TypeCache first
  • Added confirmation popup for deleting items from the Collection
  • Fixed issue while renaming one asset could be canceled on arrow keys press
  • Fix removing wrong usages of ApplyModifiedProperties
  • Fixed issue with the CollectionItemPicker not updating the collection properly on editor mode
  • Fixed issue with check if a collection could be partial not working, and newly created collections were not being generated as partial
  • Updated the Reload of collections when entering Edit Mode to only load collections that have been removed.

Added

  • Added new plus button for ItemPicker allowing you to add new items to the collection from the Drawer itself.

Removed

  • Removed old itemsGuids that was marked as obsolete since last year. If you are upgrading from an older version, please update to a previous version before upgrading to 2.3.3.

Changed

  • Small cleanups and fixes

Added

  • Added tooltip for the Generate Addressables Method toggle

Changed

  • Changed the Save method for the SOCSettings to be less expensive
  • Fixed issue when the Addressables Settings haven't been created yet
  • Organized Methods/Properties on the Collection
  • Bumped minimum supported version to 2022.2

Added

  • Added Addressables support again, now you if addressables is available on your project and the collection is set to non auto loaded, and the collection is set to use addressables, will write some helper code on the static file to load the collectiom from the addressables.
  • Added a Addressables Sample project as well
  • Added Reset Settings context menu option
  • Added the Write Addressable Loading Methods toggle for the collection

Changed

  • Updated the visuals of the CollectionEditor again, make it a bit tighter and more readable
  • Refactored the settings again (sorry, some settings will be lost again) to make the system more extensible and easier to maintain, settings are now stored inside the .meta files, so it can be versioned but also keep changes between projects

Changed

  • Refactored CollectionCustomEditor to use UI Elements, getting rid of multiple hacks to make it work with the IMGUI and Reorderable list
  • Updated the visuals of the Collection Editor
  • Advanced Options are now exposed by default, giving more clarify of what is going on
  • Removed the editor only assets from the Collection (generateAsPartialClass, generateAsBaseClass, generateAsStaticClass), those are not stored on the SOCSettings file and versioned
  • The guid, items and automaticallyLoaded are now HideInInspector on the Collection, to avoid confusion
  • Added new USS and UXML files to the Collection Editor
  • Generated static files now contains the default .g.cs postfix
  • If you set your Default Folder for Generated Files to null on the settings, it will now use the same folder as the original collection .cs files.
  • If you now set your namespace to empty on the settings, it will now use the same namespace as the original collection .cs files.
  • Add new Context Menu on the Collection to generate the indirect file for the collection
  • Fixed GoTo button not working on the PropertyDrawer, now will probably select the collection and expand only the item you want.

Added

  • Added new Default Inspector session to the Collection Editor, where you can see the default inspector of the collection and expose more items there.
  • Collections now can be enforced to use Indirect Reference, this will show an error message if the collection is not using Indirect Reference

Know issues

  • Settings will not be automatically converted to the new SOCSettings file, settings like (custom namespace, filename, or target folder) so you have to reconfigure those settings manually

Added

  • Added Item Order Protection. Override the ShouldProtectItemOrder property in your Collection to disallow items being dragged or deleted.

Fixed

  • Fixed SOC Item property drawers not working in certain Unity versions by @RoyTheunissen in #141

Fixed

  • [SOCItemEditorOptions] now has the option to limit the displayed items to the collection selected in a given field using the ConstrainToCollectionField parameter.
  • [SOCItemEditorOptions] now has the option to fire a callback when a value is selected using the OnSelectCallbackMethod parameter.
  • Replaced the implementation of the [DidReloadScripts] by the AssetPostprocessor to deal with importing errors on newer unity version
  • Fixed issue where trying to add new custom items to a collection was not showing the create custom type properly

Fixed

  • Fixed Collection Picker wrong intiialization on a cold registry
  • Fixing Collection Picker not respecting children rules
  • Fix drawing go to button on null items.

Fixed

  • Update active editor when selecting a new item with the keyboard

Added

  • Scriptable Object Browser window

Fixed

  • Fixed scripts folder validation warning showing incorrectly when mirroring folder
  • Fixed namespaces ending with dot

Added

Changed

  • Ability to define if a class can be reordered/add/remove items by the collection
  • A few other helpers for creating SOCItems dynamically

Changed

  • Editor serialization issues with new drawing methods.
  • Added sorting options for collections
  • Added option to make the collection not reorderable
  • Fixed issue with post processing and recent imported files

Changed

  • Fixed a small typo in the package description.
  • Since 2.0.3 the collection now uses the Editor for drawing the items on the collection, but this can cause some issues depending of how customized it is inside a ReorderableList, so you now can choose the item to use it or not by toggling the Use Custom Editor inside the advanced settings
  • Upgraded the CollectionCustomEditor to use BaseEditor
  • Updated CollectionItemPicker<> to use IndirectReference<> to store the items, since also contains the LongGuid reference to the Collection, allowing to work with multiple collections of the same time (It should automatically upgrade to the new version automatically)
  • Added ability to compare CollectionItemPicker<> to a IList<> of the same type
  • Other small fixes and improvements

Changed

  • Moved EditorPreference to Runtime folder. It is safe and useful to be able to use it in runtime code.

Changed

  • Added IsValid() method for indirect references
  • Added more checks and logs for when regenerating guids and cleaning bad items from collection
  • Fixed issue with CollectionItemPicker not respecting base type as the starting type
  • Removed the Application.isPlaying check for when setting items dirt

Removed

  • Unused ScriptableObjectForPreferences

Changed

  • Reverted the change where the isExpanded property would be shared between the collection editor and the property drawer.
  • Renamed ObjectType to TObjectType to keep standardized
  • Added TryGetItemByName for the ScriptableObjectCollection.cs
  • Added extra safety methods for checking duplicated Guids on collections and collection items
  • Properly implemented CollectionItemPicker IEnumerator<TItemType> GetEnumerator()

Changed

  • Added boolean check for static generated files to improve performance
  • Changed settings to be stored on ProjectSettings folder and be shared by subversion
  • Fixed CollectionItemPickerPropertyDrawer to support multiple collections of the same type
  • Other small optimizations and code formatting

Changed

  • Collection now uses the appropriated Editor for each CollectionItem when displayed on the Collection
  • Fixed expanded state not being saved on the Collection

Changed

  • Fixed editor only icons causing issue when the project recompiles during playmode.
  • Added option to disable automatically reloading of collection on the CollectionRegistry
  • Updated Labels from CollectionItemPicker to use black as the default interface
  • Added some helpers to help project upgrade
  • Added [DrawAsSOCItem] attribute to allow drawing of custom ScriptableObjec that implements ISOCItem as a CollectionItem, this is only necessary for unity versions bellow 2022, should not affect anything else.
  • Syncronize Assets button on the Collection will also perform a reload of the collection

Changed

  • Refactored CollectionItemPicker to only use LongGUID and also the PropertyDrawer has been remade, now looks nicer 🤩
  • Added multiple helpers to CollectionItemPicker to be used more like a label system/
  • Added ISOCColorizedItem to allow coloring of the CollectionItemPicker on the inspector, I will expand this to other areas as well.

Changed

  • Fixed issue with name parser that would still treat digits as string and added to the final name
  • Fixed issue with PropertyDrawer of indirect reference without attribute would cause a null reference
  • Refactored the system to use ScriptableObject as a base class instead of ScriptableObjectCollectionItem now any ScriptableObject can be used as a collection item as long as implements the ISCOItem interface
  • Fixed issue with CollectionItemPicker that would not work properly with ScriptableObject that are not in the same assembly as the ScriptableObjectCollection
  • Added new buttons on CollectionRegistry to force guid validation on all items
  • Reduced automatic collection guid reloading to reduce performance impact on larger projects
  • Fixed issues with target scripts generation folder not being saved properly
  • Minimum supported Unity version is now 2021 (I'm DONE with 2020, its the worst unity ever 😒)

Removed

  • Removed support for Addressables, it was not working properly and it was not being used by a lot of teams, I think the addressables support should be handled elsewhere.

Breaking Changes

  • If you used the Addressables integration SOC_ADDRESSABLES_SUPPORT be extra careful when upgrading
  • The old string based guid system has been replaced for a lighter version LongGuid
  • If you are using IndirectReferences all the references will be lost, you will need to re-set them

Upgrade Guide from 1.x.x to 2.x.x

  • Update the package
  • Make sure you click on the CollectionRegistry and click on the Validate Collections button
  • Regenerate all your Static Code Files

Added

  • Initial string search support

Changed

  • Fixed issue with namespace not been updated on first usage

Added

  • Implemented the new CollectionItemPicker<ItemType> that act as a [Flag] enum, on the inspector and is a List under the hood. Thanks @RoyTheunissen for the contribution

Fixed

  • Issue where the type was not properly loaded when used as a IList

Changed

  • Fixed Compiler Warning
  • Fixed another nullreference on GetCollectionItemHeight
  • Fixed NullReference on CheckForKeyboardShortcuts()
  • Fixed reserved names C# names using IgnoreCase for comparison, now you can use reserved name as UpperCase
  • Now static generated classes will use the cached naming prefix, to avoid issues with reserved C# variables names
  • Fixed remaining Warning.

Changed

  • Fixed namespace settings not been stored properly after changing once on the Wizard
  • Fixed NullReference on GetItemHeight()

Add

  • Automatically define namespace for static collection generated file based on CollectionItem

Changed

  • Fixed static static file generation to use Type.FullName instead of Type.Name

Changed

  • Fixed compatibility issues with Unity 2021
  • Fixed Wizard settings been shared between multiple projects

Changed

  • Fixed non editor builds issue

Added

  • Added new Collection References, useful for individual collection loading, more information here thanks a lot @IkeikeP for the contribution

Changed

  • Fixed [RuntimeInitializeOnLoadMethod(RuntimeInitializeLoadType.BeforeSceneLoad)] issue with unity 2021 and generics.

Changed

  • Fix issue where entering in playmode with a missing collection reference in the CollectionRegistry would throw a nullref and not reload collections
  • Added new condition to consider an item as a "Bad Item" and for it to be cleared. This fixed an edge case where a collection can have a non existing item but it is not being cleared out from the collection
  • Added validation method as an CollectionItemEditorOptions option, you can now define a method to validate what CollectionItem can appear, like this:
[SerializeField, CollectionItemEditorOptions(ValidateMethod = nameof(IsValidConsumable))]
private Consumable onlyUnlockedHardCurrency;

public bool IsValidConsumable(Consumable consumable)
{
    if (consumable is HardCurrency hardCurrency)
        return hardCurrency.IsUnlocked;
    return true;
}

Changed

  • Added [Preseve]attribute to both ResourceScriptableObjectSingleton and CollectionsRegistry to avoid AOT errors
  • Added check if item already exist in the collection before adding it

Added

  • Renamed uses of Wizzard to Wizard
  • Wizard foldouts now work
  • The collection name is now based on the item name by default. You can still override it.
  • The script folder now mirrors the Scriptable Object folder by default
  • The namespace is now inferred from the script folder by default, with options for how it should be formatted. Can still manually override.
  • Improved wizard readability by tweaking the layout, adding a help text, adding a scrollbar and defining a reasonable minimum size
  • Settings that are serialized using Editor Prefs now use the new EditorPreference utility class

Changed

  • Renamed uses of Wizzard to Wizard
  • Wizard now focuses on Item Name by default so you can type immediately
  • Reformatted wizard to look more like a Unity built-in feature
  • Parent folders are no longer created by default in preference to mirroring the ScriptableObject hierarchy

Deprecated

  • ScriptableObjectCollectionUtils is no longer responsible for appending any parent directories. If you were using any of those methods, please use the recommended method instead.
  • ScriptableObjectCollectionSettings.SetDefaultNamespace has been renamed. Please use SetNamespacePrefix instead.

Changed

  • BREAKING CHANGE Removed Obsolete methods related to Previous Naming, if you are still on version bellow 1.5.4 consider implementing the suggested warnings before upgrading
  • ScriptableObjectCollection its now abstract to avoid issues mentioned here here
  • Fixed partial toggle been disabled when non target generated folder is set
  • Fixed issue when its not possible to read the current ScriptableObjectItem assembly @RoyTheunissen
  • Fixed a bunch of grammar mistakes on the Readme file @RoyTheunissen
  • Added more information to the faq @RoyTheunissen
  • Replaced TypeUtility by Unity TypeCache
  • Fixed issue when a broken script between a CollectionItem is missing would cause null references on the inspector

Added

  • More display options (Hide Preview button / Hide GoTo Button) @FreezyExp

Changed

  • Fixed null reference on the GoTo button on the indirect references. @FreezyExp
  • Fixed warning from ResourceLoading @FreezyExp
  • Fixed issue where CollectionRegistry would be stripped depending on the stripping level @FreezyExp
  • More small improvements and changes (#83

Changed

  • Changed the ResourceScriptableObjectSingleton to have generic type on methods again, to prevent AOT issues.

Added

  • Added Delete Collection button under advanced settings, I will delete all the related assets and unregister from the registry

Changed

  • Renamed the Settings menu on the Collection Editor to Advanced
  • Fixed an issue when drawing indirect references inside arrays.

Added

  • Added generateAsBaseClass as an option for each collection to allow the access each Collection Item as base type.

Added

  • Added arrow navigation on the Collection Editor, now you can navigate between items and expand/collapse it by left right
  • You can now expand/collapse all items by holding alt while clicking on the foldout arrow, like default unity controls

Changed

  • Refactored the ScriptableObjectCollection Custom Editor to use ReorderableList instead of the previous custom list drawer
  • Refactored the editor prefab property drawer to properly draw the SerializedProperties of the item instead of displaying the custom inspector
  • Removed some old files and methods that aren't necessary anymore.
  • When using the inline visualizer of the CollectionItem, it should now respect position (if is inside an array or custom propery drawer)

Added

  • Added context click on the items, you can now Copy Paste values between collection items and Duplicate and Delete items when right click on it on the Editor

Changed

  • Removed the asset destruction of the Collection on the OnDestroy event

Changed

  • Improved the Refreshing of the CollectionRegistry to try to refresh when items are deleted/created
  • Refactored the IndirectReference to not need a serialized version of the CollectionItem type, so avoid any serialization issues
  • Renamed some of the editor classes to match the standard

Changed

  • In order to support multiple collections of the same type the check of the Values I had to tweak how the instance of every instance its assigned, changed for the OnEnable of the collection item
  • Changed the Refresh of the collections to only find items under the same folder.
  • Fixed a lot of scripts to work properly with multiple collections of the same type
  • Added some logs when CollectionItems are added/removed from collections to help the visibility
  • CollectionType.Values now will return all the CollectionItem available on the registry, so if you have 2 Collections of the one Type this will return the content of both collections while the CollectionItem.Values when the access file is generated will only return that specific collection items

Changed

  • Removed the automatically reload of CollectionRegistry using the DidReloadScripts callback, this caused multiple issues on batch mode and on clear libraries
  • Converted the Collection reference on the CollectionItem to be a Lazy reference, since this was causing some dependency when using CollectionItem as addressables
  • Refactored the ScriptableObjectSettings this used to be a Resources object that was auto loaded, but this could also create unwanted dependencies between items. The settings for code generated are not stored inside the Collection itself. Make sure you delete the ScriptableObjectsSettings ScriptableObject inside your resources folder.
  • Added a bunch of validation and verification for the Generation of the static access, making sure it only allows partial classes when is possible and other small checks.
  • The settings are now on the Project Preferences where you can define the default folder for the Scriptable Objects and default namespace.
  • Removed the ReadOnlyList on the Collection, the casting was expensive and was an unnecessary safety measure

Changed

  • Disabled the reload of the collection after script reloading on batch mode.

Changed

  • Deleted old .meta files

Changed

  • Simplified the multiple collection display to be a single line again, showing all the available items inside the AdvancedDropdown

Changed

  • Refactored the Collectable for CollectionItem this has several changes in multiple parts of the code, I tried my best to keep compability with the old version as well.
  • Renamed the CollectableScriptableObject to ScriptableObjectCollectionItem for better naming convention, CollectableScriptableObject still exist but has the obsolete flag on it to avoid breakable changes
  • Add IsValid to IndirectReferences to check if has valid data before being used
  • Refactored ResourceScriptableObjectSingleton to fix some warnings
  • Fixed the GetEnumerator from Collection warning
  • The CollectionRegistry now will only load Collections that are inside an active Assembly.
  • Exposed the Collections list on the Registry
  • Simplified the CollectionItem Dropdown (removed the type grouping)

Added

  • A new information on the Collection custom editor to show the base class if is different from the collection type (Disabled for now)
  • Exposed the namespace to be customized by the custom static file
  • Added support of multiple collections of the same type on the registry, the CollectionItemDrawer will display a Collection dropdown if more than one collection for the same type of item is available

Changed

  • Fixed issue when using the Create Settings menu
  • Added automatically open of the selected collectable when using the goto button on the CollectableProperty Drawer
  • Added type specific GetEnumerator for the Collection

Added

  • Added quick access to the .Values from the collection, to be used without code generation, you can now use CustomCollection.Values to gett all your items
  • Added a GetValues() to the generated static file, you can quickly get a filtered list of items that you need

Changed

  • Changed Create Collection Wizzard to behave like a modal window that can loose focus.
  • Removed the TryGet static access generation, was not been used and was causing some problems

Added

  • Automatically selection of the newly created item, for renaming
  • Added keyword validation for names
  • Added ability to create new items from the selection dropdown.

Changed

  • Fixed issue when trying to play without the CollectionRegistry created

Added

  • Added basic copy/paste functionality between colelctables

Changed

  • Removed multiple AssetDatabase.SaveAssets(); to improve general performance when adding / removing objects
  • Fixed indirect reference issues with the new Advanced Dropdown search
  • Removed static .Values from the Colletion, was redundant and error prone

Added

  • Advanced dropdown for better searching on big collections;

Changed

  • Fixed issue with the Foldout issue, now showing multiple inherited collectables should work fine
  • Improved the ADD New on the collection and what is displayed, and the the creation of new types is on a subfolder.
  • Added static access to the ScriptableObjectCollection<>.Values
  • Renamed the generated Static value back to the .Values to keep in line with the static access. so you can now access by Collection.Values or Collectable.Values

Added

  • Support to create Collections / Collectables based on a Utils script, useful for another packages creating the necessary Collection.

Changed

  • Fixed issue when trying to create a new type from abstract using the new Collectable editor.

Changed

  • Fixed issue when duplicating assets caused a crash
  • Fixed issue when deleting Scripts from base Collectables
  • Fixed issue of null type when creating a new collectable with base type

Added

  • Added new inspector to create new base types from the Editor.

Changed

  • Fixed AOT issue.

Changed

  • Fixed issue with the read only lists not refreshing properly on Inspector calls on PlayMode.

Changed

  • Fixed issue where the collection view was not properly refreshing
  • Fixed general warnings on the project
  • Fixed double type usage on the ResourceScriptableObject
  • Renamed the Values to Collection on the static generated file, it makes more sense to the new Custom Static Class access

Added

  • Added a new Custom Static File to be able to generate static access files between different assemblies
  • Added warning system to help displaying issues

Changed

  • Not serializing editor fields
  • Fix read only list not storing caching

Changed

  • Fixed issue with the settings menu been displayed wrong
  • Fixed an issue while converting numbers to literal numbers would not deal properly with initial special characters

Added

  • Added system to be able to Add/Remove items from the collection at runtime (Like loading new items from addressables)
  • Added runtime / editor time fix to deal with dynamicly changed collections

Changed

  • Fixed issues with indirect references

Changed

  • Fixed issue with the wizzard that was not generating the target Scriptable Object

Added

  • New type of indirect access to collectable items, this allows you use the regular editor reference, but without storing the reference, so without creating a relationship between the items, and can be lazy loaded when is needed, like addressables references for isntance.
  • Also added an option on the wizzard to automatically create the IndirectReference for every collectable item

Changed

  • Fixed AOT compilation issue

Changed

  • Fixed mobile builds (using editor references on runtime files)

Added

  • Proper error when there's no static script folder defined
  • Default namespace on settings
  • Stored the last scripts folder as cache for the wizzard
  • Validation of null items on the Registry

Changed

  • Changed to the static file use the Colllectable Type again
  • Values on the static files now its just values not CollectableType+Values

Changed

  • Crash while changing to debug mode while having the Collection inspector open
  • Fix static generation code writing the full class name as the static class name

Changed

  • Fix possible stackoverflow on PostProcessor
  • Removed Assembly Definition Check (Was expensive and bad when working with packages)
  • Fixed issue when reloading items from the same type from different collections been added to both
  • Fixed Static genearation file using sanitized name and not class name, breaking the partial class
  • Fixed Create Collection context menu using the selected folder as target for both scrips and scriptable objects
  • Fixed some warnings
  • Fixed weird pair next name issue

Added

  • You can now set specific overwrite static files location on the CollectionSettings file
  • Settings are now displayed on the Collection itself rather than on the registry

Changed

  • Fixed issue with package version

Added

  • Added support for codacy code quality

Changed

  • Refactored settings
  • Removed settings from the Collection script to make it clear
  • Added some a way to write inside packages as well.

Changed

  • Changed the Settings file to be the main place where data is stored, not using EditorPrefs anymore
  • Added all the namespaces for individual assets as diretives on top of static generated file
  • Fixed issue with the Add New Item missing the DelayCall on the Collection Editor Window

Added

  • Added the [CreateAssetMenu] to the Collection automatic generated file

Changed

  • The Static file uses the Collection name instead of the collectable type, so you can have multiple collections of the same type and unique access to that specific collection
  • Fixed asset creation menu name to use ScriptableObject instead of Scriptable Object
  • Editor Group issues when adding new items throwing error

Added

  • Added support for non automatically loaded Collections, this allow you initialize collections when they are necessary, avoiding adding all the collectable references into the resources bundle
  • Added InitializeCollections that can initialize Collection in regular MonoBehaviours
  • New type of script static script generation for Non automatically loaded collections
  • Added new Custom Editor for the registry where you can define witch collection are auto loaded, and the static generation type
  • PreProcess that removes the non automatically loaded collections before build

Changed

  • General bug fixes and optimizations
  • Fixed issue with the dropdown on property drawer

Added

  • Support for SubClasses support for adding new items
  • Asset Modification Processor to prevent issue when deleting Collectable and Collections
    • If you delete a Collection now, all the Collectables will be deleted as well and removed from the registry

Added

  • First initial working version