Vixen
dd8b0a81
csharp
public sealed class AssetCollections

Doc 20 § B1's collections: named sets of assets, kept with the project.

Read the guide page for this →

Remarks

⚠ Per project and not per user, which is the one thing a saved filter got the other way round. EditorPreferences is user-wide — one file across every project somebody opens — and a collection holds AssetIds, which mean nothing in another project. So this is a settings asset under ProjectSettings/, read and written through ProjectSettingsStore like every other one.

⚠ Library/ would have been the wrong per-project home even though it is the per-project one that is not committed. Everything under it is reproducible from a source file plus its .meta — that is what makes deleting it safe — and a collection is authored data that nothing can rebuild. Storing one there is storing it somewhere the editor is allowed to throw away.

⚠ And the ids are the point. A collection holding paths breaks the first time somebody moves a file, which is the move a content browser exists to make cheap; an AssetId is what the database's identity is for and survives it. BrowserCollectionTests moves a file on disk and finds it in its collection afterwards, which is the assertion a path-keyed store cannot pass.

Fields and properties (1)

  • public List<SavedAssetSet> Collections

    The collections, in the order they were made.

Methods (4)

  • public SavedAssetSet? Find(string? name)

    The collection of a name, or .

  • public bool Add(string name, IReadOnlyList<AssetId> assets)

    Puts assets into a collection, making it if it is not there yet.

  • public bool Remove(string name, IReadOnlyList<AssetId> assets)

    Takes assets out of a collection, leaving the collection itself.

  • public bool Forget(string name)

    Forgets a whole collection.

Used by (2)

  • EditorApplicationVixen.Editor.App
  • TypeRegistrationVixen.Editor.App