PopcornFX v2.8

Generic selectors
Exact matches only
Search in title
Search in content
  1. Home
  2. Docs
  3. PopcornFX v2.8
  4. Plugins
  5. Unity Plugin
  6. Emitters

Emitters

Overview

PopcornFX Emitter (PKFxEmitter.cs) is an instance of a PopcornFX Effect (PKFxEffectAsset.cs).

Emitters are updated and rendered in a scene, allowing configuration during edition and control over emitters during runtime.

Emitter properties

Unity_Emitters_Property

The emitter can be started, stopped, restarted and terminated using interface from section (1). Section (2) exposes general properties of the emitter and section (3) provides control and configuration over attributes and attributes samplers.

You can also interact with the emitter by getting the component and calling the appropriates methods

void Start()
{
  PopcornFX.PKFxEmitter effect = GetComponent<PopcornFX.PKFxEmitter>();

  effect.StartEffect();
  effect.StopEffect();

  effect.KillEffect();
  effect.TerminateEffect();

  effect.SetAttributeSafe("AttributeName", 0.5f);

  /* Example of Set sampler for Sampler Text.
  * Other sampler use a Sampler Description structure to set their data */
  PopcornFX.Sampler sampler = new PopcornFX.Sampler("SamplerName", "StringForSamplerText");
  effect.SetSamplerSafe(sampler);

  /* Interface with Exported Events that allow custom script to interact with event triggered by
  * the PopornFX Runtime */
  effect.EffectRegisterEvent("EventName", new PopcornFX.PKFxEmitter.PKFxRaiseEventCallback(Callback));
}

void Callback(string name, List<PopcornFX.PKFxEmitter.SPopcornFXPayloadData> payload)
{
}

 

Was this article helpful to you? Yes No

How can we help?