Overview
A 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
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.PKFxRaiseEventCallback(Callback)); } void Callback(string name, List<PopcornFX.PKFxEmitter.SPopcornFXPayloadData> payload) { }