Scripting API

Scripting API

IPrefabSource

Interface in Abyss.Core.Scenes, from Abyss.Core.

Where a prefab reference gets the document it names.

public interface IPrefabSource

Remarks

A seam rather than a file read, because the thing being read is a scene. Expanding an instance is a document-to-document transformation, and keeping the reading behind an interface is what lets every test of it describe a prefab in a few lines instead of writing one to a temporary folder — the same reason InspectionSnapshot is a value.

It is also the seam an asset pack will arrive through. A shipped game reads prefabs out of the engine's own binary dictionary rather than out of the project folder, and that is another implementation of this and nothing else.

Methods

Open

SceneDocument? Open(AssetGuid id, string? path, out string why)

The document a reference names, or null with a reason it could not be read.

Parameters

  • id: The prefab's identity, which wins where it is known.
  • path: Where it was when the reference was written, which is the fallback.
  • why: Why nothing came back, in words for a note. Empty on success.