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
| Member | What it is |
|---|
SceneStaticObjectCombiner() | Unity makes components itself; use AddComponent or spawn a prefab instead of new. |
Fields
3 private and internal fields
| Member | What it is |
|---|
private GameObject androidBakedCache | Pre-baked prefab used on Android. |
private GameObject bakedCache | Pre-baked prefab used on other platforms. |
private bool isSettingToTerrainLayer | Backing field for IsSettingToTerrainLayer. Default true. |
Properties
| Member | What 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
| Member | What 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
| Member | What 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. |