Vixen
02b45cc4
csharp
public struct VfxEmitter

An entity that emits particles.

Read the guide page for this →

As a scene component

Size
24 bytes — 455 rows in a 16 KB chunk, alone on the archetype

Remarks

One reference and four numbers. Which effect, whether it is running, what its randomness is derived from, and how far its particles reach. Where it emits from is the transform's, exactly as a mesh's placement is — VfxExtractionSystem reads WorldTransform and writes it into VfxSystem.Origin, so the same .vxvfx on twenty entities is one asset and twenty emitters.

The whole point of the [AssetType] line. It is what makes the row in the inspector a picker for effects rather than for anything in the project, and it is Vixen.Core's annotation rather than the editor's for the reason Mesh gives: a runtime assembly referencing an editor one is the coupling doc 11's layering exists to prevent. Between that and [Component] [DataContract], the Add Component menu, the type-filtered picker, the drag-and-drop target and the .vxscene line all follow with no editor code at all.

⚠ A zeroed emitter is stopped, and that is why VfxEmitters exists. default gives Playing false and a Reach of zero — an effect that never runs and whose bound culls it from every view even if it did. A component cannot have a non-zero default and nothing can change that, which is the same asymmetry MeshRenderables.Default and Lights.Default exist for.

Fields and properties (5)

  • public AssetReference Effect

    Which effect, as the reference a scene stores.

  • public bool Playing

    Whether the spawners are running.

  • public uint Seed

    What the effect's randomness is derived from.

  • public float Reach

    How far the particles reach from the emitter, in metres.

  • public float Rise

    How far above the emitter the bound is centred, in metres.

Used by (7)

  • ComponentRegistrationVixen.Rendering
  • TypeRegistrationVixen.Rendering
  • VfxEmittersVixen.Rendering
  • VfxExtractionSystemVixen.Rendering
  • VfxExtractionTestsVixen.Rendering.Tests
  • Vixen_Rendering_Ecs_VfxEmitterSerializerVixen.Rendering
  • MaterialIconsVixen.Editor.App