public record class NewAssetKindOne line in Create ▸: what it is called, what it writes, and whether it opens.
Remarks
⚠ F3: this was a literal tuple array in EditorWorlds. A plugin that introduced an asset type could not put it in Create ▸ at all — the menu was a list in the application of every kind the application knew about, which is the same shape of problem as an editor that hard-references its own features.
Here rather than in Vixen.Editor.App because a contribution has to be declarable by something that does not reference the application — which is every plugin, and every feature assembly once P3 moves the built-ins to the front door.
Fields and properties (8)
public string IdThe command id. Prefix a plugin's with the plugin's own id.
public string TitleWhat the menu line says.
public string ExtensionWhat the new file is called after the dot, including it.
public string DefaultNameWhat it is called before the dot, before a number is appended.
public string ContentsWhat to write into it. Empty is a zero-byte file, which is what a kind whose editor opens an empty one as a sensible new document wants; anything else is a starter document, which a kind read by an importer needs — an empty file that the importer deserialises and validates arrives with a warning beside it rather than as a new asset.
public bool OpensWhether to open it after creating it, which needs an editor claiming the extension.
public int OrderWhere among the lines, low first. Ties keep registration order.
public Func<string>? BuildProduces the contents per file, or to use Contents.
Methods (2)
public NewAssetKind(string Id, string Title, string Extension, string DefaultName, string Contents = "", bool Opens = true, int Order = 0)One line in Create ▸: what it is called, what it writes, and whether it opens.
public string NewContents()What to write into a new one.
Used by (3)
- DeclaredContributionTestsVixen.Editor.App.Tests
- DeclaredContributionsVixen.Editor.App
- EditorApplicationVixen.Editor.App