Vixen
02b45cc4
csharp
public sealed class ProjectAsset

One asset, as a row of editors — what SceneEntity is for an entity.

No guide page documents this yet — the page shows what the code says about itself.

Remarks

The other half of the join, and it lives here for the same reason the first half does. The project browser knows GUIDs and the inspector knows objects with members; something has to be the object, and putting it in the application is what keeps Vixen.Editor.Inspector from knowing what an asset database is. Selecting a file used to set EditorProject.Selection and stop there — the selection was a dead end with nothing reading it, so a click in the Project panel changed a highlight and nothing else.

⚠ The envelope, not the importer's settings. AssetEntry is deliberately what the database knows without parsing a sidecar — its own remarks say why — and this shows exactly that. Import settings are a document with an undo stack and an apply/revert of its own, which is what double-clicking opens; showing an editable copy of them here would be a second writer to the same file with no idea the first exists.

⚠ Every row is read-only, and that is a statement rather than an omission. Renaming an asset moves a file and rewrites every reference to it — EditorContext.Touch exists for precisely that operation — and there is no command for it yet. A writable Name box here would rename the object in memory and leave the file where it was.

⚠ Nothing is cached: every read goes back to the database. Two of these over one GUID therefore cannot disagree, and a rescan that re-indexed the file is seen rather than painted over. An asset that has gone reads as blanks rather than throwing, for the reason SceneEntity gives about dead entities: a selection outlives the thing it names, and an inspector that threw while drawing a row takes the editor down with it.

Fields and properties (13)

  • public AssetId Asset

    Which asset.

  • public bool Exists

    Whether the database still has an entry for it.

  • public string Name

    What the file is called.

  • public string Path

    Where it is, project-relative.

  • public bool IsFolder

    Whether it is a folder rather than a file.

  • public string FileSize

    How big the file is.

  • public string Importer

    Which importer claims it.

  • public string Identity

    Its identity, as the thirty-two characters a sidecar holds.

  • public int ReferencedBy

    How many assets refer to it.

  • public string Address

    What a build ships this asset under, or empty for its path.

  • public string Group

    Which bundle group it belongs to, or empty to inherit its folder's.

  • public string Labels

    Labels for bulk loading, comma separated.

  • public bool Excluded

    Whether to keep it out of the build entirely.

Methods (2)

  • public ProjectAsset(EditorProject project, AssetId asset)

    Views an asset.

  • public override string ToString()

    Renders it as its name.

Used by (3)

  • Describes_Vixen_Editor_App_ProjectAssetVixen.Editor.App
  • EditorApplicationVixen.Editor.App
  • SelectionTestsVixen.Editor.App.Tests