Skip to content

Auto-pause particle mesh update and bake when off-screen #377

@zhiyangyou

Description

@zhiyangyou

Automatically pause the particle system's mesh updates when all of its associated UIParticleRenderer components are off-screen (culled by the Canvas or RectMask2D).

This auto-pause feature should be optional and controllable via a toggle/checkbox in the UIParticle's Inspector panel.

A possible implementation approach could be:

  1. The UIParticle component subscribes to the onCullStateChanged event of each of its UIParticleRenderers.

  2. When the CanvasRenderer.cull property of a UIParticleRenderer changes, this event would trigger a check within the UIParticle component (e.g., a method like CheckOffScreen).

3.If all renderers are culled, the UIParticle would then pause the particle system's mesh updates and the baking process. When at least one renderer becomes visible again, the updates would resume.

Metadata

Metadata

Assignees

Labels

enhancementNew feature or request

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions