Skip to main content

FlattenAndCleanEmptyAtBakeTime

A class in Root.Township, the global namespace.

Build step that flattens a prefab's hierarchy: children move up to this root and empty transforms are deleted. Runs late (order 100).

Constructors​

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

Properties​

MemberWhat it is
override int SortingOrder { get; }100, so it runs after most bake steps.

Methods​

MemberWhat it is
override void Bake(bool isSaving)Flattens the hierarchy under this transform.
1 private and internal method
MemberWhat it is
private static void Flatten(Transform transform, Transform root)Recursively bakes IPointerPrefabBakable components, reparents objects with components to the root and destroys empty ones. Stops at IIgnoreForStaticFlatten.