Skip to main content

PlatformObjects

A class in Root.Township, the global namespace.

Build-time bake step that turns chosen child objects on or off depending on the platform, and destroys objects listed for removal.

Constructors​

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

Fields​

MemberWhat it is
List<GameObject> childTargetsToDestroyObjects to destroy when baking.
2 private and internal fields
MemberWhat it is
private static Logger loggerNLog logger for this class.
private PlatformObjects.PlatformObjectSetup[] platformObjectsGroups of objects and the platforms they stay active on.

Methods​

MemberWhat it is
override void Bake(bool isSaving)Applies each setup (active on matching platforms, inactive elsewhere), destroys childTargetsToDestroy and clears missing LOD renderers.
void Bake()Applies each setup (active on matching platforms, inactive elsewhere), destroys childTargetsToDestroy and clears missing LOD renderers.
2 private and internal methods
MemberWhat it is
private void DestroyLostChildren()Destroys each object in childTargetsToDestroy, handing it to a parent PlatformObjects if the editor can't destroy it.
private static void TryMoveTargetToParent(GameObject root, GameObject target)Adds the object to a parent PlatformObjects destroy list, or just deactivates it if there is none.