Scripting API
Scripting API
PrefabUnpack
Class in Abyss.Core.Scenes, from Abyss.Core.
An instance of a prefab made the scene's own entities: unpacked, each instance it held is left an instance of its own prefab; unpacked completely, nothing under it is one.
public static class PrefabUnpackRemarks
Nothing is built again: the entities stay the entities they were, drawn and placed as they are, with what the scene changed in them. What goes is what made them an instance's — the mark on the root saying of what, the mark on each part saying whose, and the names the prefab gave its parts. Those names are the prefab's, the same in every instance of it, so a scene with two instances unpacked would hold two entities of each name; taken, each part is given a name of its own the next time the scene is written, as a copy is (Copied).
An instance it held stays one, unless completely. Its root is marked with its own prefab, as an instance in the scene is, and given a name of its own; what is under it keeps the names its prefab gave, which is how a scene says what it changed in it. So does an instance the scene added inside it, which was one of its own already; unpacked completely, that one is too.
What the scene added inside it is the scene's already, and keeps its name.
Methods
Unpack
public static Unpacked? Unpack(World world, ulong root, bool completely, IPrefabSource prefabs)Unpacks the instance whose root is root.
Parameters
world: The world it is in.root: The instance's root.completely: Whether the instances it holds are unpacked too.prefabs: Where its prefab is read, to find which of its parts are instances it holds.
Returns What it took and gave, or null where root is no instance's root.
Repack
public static void Repack(World world, ulong root, Unpacked unpacked, Func<ulong, ulong>? now = null)Makes what unpacked unpacked an instance again, as it was.
Parameters
world: The world it is in.root: The instance's root.unpacked: What unpacking it took and gave.now: The entity each is now, where it was made again since as another.
