Skip to main content

SceneStaticObjectCombiner

A class in Root.Township, the global namespace.

A StaticObjectCombiner for scene objects that can swap itself for a pre-baked cache prefab, with a separate cache for Android.

Constructors​

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

Fields​

3 private and internal fields
MemberWhat it is
private GameObject androidBakedCachePre-baked prefab used on Android.
private GameObject bakedCachePre-baked prefab used on other platforms.
private bool isSettingToTerrainLayerBacking field for IsSettingToTerrainLayer. Default true.

Properties​

MemberWhat it is
GameObject BakedCache { get; set; }The pre-baked prefab for the current platform: androidBakedCache on Android, bakedCache elsewhere.
protected override bool IsSettingToTerrainLayer { get; }Whether combined objects go on the terrain layer. Returns isSettingToTerrainLayer.

Methods​

MemberWhat it is
override void Bake()If a baked cache exists, spawns it in place and destroys this object. Otherwise removes child combiners and bakes normally.
2 private and internal methods
MemberWhat it is
private void InstantiatePreBakedObject()Spawns the baked cache under the same parent with this object's local transform, then destroys this object.
private void RemoveChildrenStaticCombiners()Destroys any other StaticObjectCombiner in the children so only this one bakes.