Scripting API
Scripting API
UiDocumentDraft
Class in Abyss.Core, from Abyss.Core.
A UI document opened to be edited: built from its file into a draft scene, which an editor lists and edits as it does a scene's entities, and written back to its file from there.
public static class UiDocumentDraftRemarks
Built as a scene is, by the same pieces (SceneFile.Apply), into a scene made a draft before anything is put in it, so no element is ever seen by a query — not even for the frame it is built in. See World.SetSceneDraft.
Written as a scene is, its class kept. What the scene's writer captures is the elements as they are; the class the build makes of the document is the file's, not an element's, so it is carried from the file opened to the file written.
Methods
Open
public static (SceneId Scene, string? Class) Open(World world, string path, AssetDatabase database, IPrefabSource prefabs)Builds the document at path into a new draft scene, named as its file is.
Parameters
world: The world to build it in.path: The document, on the ordinary filesystem.database: What every file under the asset root is called.prefabs: Where the prefabs it instances come from.
Returns The scene it was built into, and the class its file names.
Exceptions
SceneFormatException: The file is not a document this build reads.
Save
public static SceneCapture Save(World world, SceneId scene, string path, AssetDatabase database, IPrefabSource prefabs, SceneWriting writing, string? uiClass)Writes the draft scene scene to path as a UI document of the class uiClass.
Parameters
world: The world it is in.scene: The draft scene.path: Where to write, on the ordinary filesystem.database: What every file under the asset root is called.prefabs: Where the prefabs it instances come from.writing: Whether every field is written, as the project writes its scenes.uiClass: The class the build makes of it; null for none.
Returns What was written.
