Scripting API

Scripting API

PrefabRefresh

Class in Abyss.Core.Scenes, from Abyss.Core.

Brings a scene's instances up to date with prefabs that changed since they were built, keeping what the scene changed in each.

public static class PrefabRefresh

Remarks

Each instance is written down and built again. What the scene changed inside it is read against the prefab as the instance was built of it — the one thing that tells a change of the scene's from one of the prefab's — and the instance is built again of the prefab as it is now, with those changes, where it was among its siblings, under the id it had. Its parts keep their ids too, being the prefab's, so each entity of it still there is told as the entity it was and the one it is now, which is what an editor's undo and its pick follow.

An instance of a prefab that holds the changed one is built again too, since what it holds is part of it; and one inside an instance built again is built with it.

An entity is told by its names from the instance's root down, not by its own alone: one prefab put inside an instance of itself names its parts as the outer instance names its own.

Methods

Refresh

public static PrefabRefreshed Refresh(World world, SceneId scene, IReadOnlyCollection<AssetGuid> changed, IPrefabSource before, IPrefabSource now, AssetDatabase database)

Builds again every instance in a scene of a prefab that changed, or of one holding one.

Parameters

  • world: The world the scene is in.
  • scene: The scene.
  • changed: The prefabs that changed.
  • before: The prefabs as the instances were built of them; see BuiltPrefabs.Before.
  • now: The prefabs as they are now.
  • database: What every file under the asset root is called.

Rebuild

public static PrefabRefreshed Rebuild(World world, ulong root, SceneDocument instance, AssetDatabase database, IPrefabSource prefabs)

Builds the instance whose top is root again, as instance says it — a scene's file of it alone, its top first — in its place among its siblings, each of its entities still there told as the entity it was and the one it is now: what taking back one change of an instance does, and putting it back.

Parameters

  • world: The world it is in.
  • root: The instance's top entity.
  • instance: What it is built again as.
  • database: What every file under the asset root is called.
  • prefabs: Where its prefab, and what it holds, are read.