Skip to main content

ChunkingPrefabReplace

A class in Root.Township, the global namespace.

Obsolete editor bake helper that swaps this object for an instance of a prefab's root, at the same transform.

Constructors​

MemberWhat it is
ChunkingPrefabReplace()Unity makes components itself; use AddComponent or spawn a prefab instead of new.

Fields​

1 private and internal field
MemberWhat it is
private GameObject prefabBacking field for Prefab. Moved up to the prefab's root on replace.

Properties​

MemberWhat it is
bool IsBaked { get; set; }Set to true by Bake.
GameObject Prefab { get; set; }The prefab to swap in.

Methods​

MemberWhat it is
static void CheckReplace(ref GameObject target, bool isChunkingPrefabFolderForced = false)Replaces the target if it has this component, or walks a ChunkingPrefabFolder's children and replaces those.
GameObject ReplaceWithPrefab()Instantiates the prefab's root object, copies this transform to it, destroys this object, and returns the new one.
bool ValidatePrefab()Always returns false and does nothing.
1 private and internal method
MemberWhat it is
private void IBakeable.Bake()Marks it baked and runs ReplaceWithPrefab.