ClutterGridSystem
public sealed class ClutterGridSystem : GameObjectSystem Game object system that manages clutter generation. Handles infinite streaming layers and executes generation jobs.
Constructors
ClutterGridSystem(Scene scene) Properties
| Name | Type | Description |
|---|---|---|
Storage | ClutterStorage | Storage for painted clutter model instances. Serialized with the scene - this is the source of truth for painted clutter. |
Methods
Void ClearComponent(ClutterComponent component) Clears all tiles for a specific component.
Void InvalidateTileAt(ClutterComponent component, Vector3 worldPosition) Invalidates the tile at the given world position for a component, causing it to regenerate.
Void InvalidateTilesInBounds(ClutterComponent component, BBox bounds) Invalidates all tiles within the given bounds for a component, causing them to regenerate.
Void InvalidateTilesInBounds(BBox bounds) Invalidates all tiles within the given bounds for ALL infinite clutter components. Useful for terrain painting where you want to refresh all clutter layers.
Void Paint(ClutterEntry entry, Vector3 pos, Rotation rot, Single scale = 1) Paint instance. Rebuilds on next frame update. Models are batched, Prefabs become GameObjects.
Void Erase(Vector3 pos, Single radius) Erase instances. Rebuilds on next frame update. Erases both model batches and prefab GameObjects.
Void ClearAllPainted() Clears all painted clutter (both model instances from storage and prefab GameObjects). Does not affect clutter owned by ClutterComponent volumes.
Void Flush() Flush painted changes and rebuild visual batches immediately.