Handle Events with the Unity Plugin V3

From PopcornFX
Revision as of 16:00, 18 July 2018 by Vbas (talk | contribs)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to navigation Jump to search


You can register a custom handler to handle the events coming from PopcornFX into Unity.
You can access to the event name, and if you enable the unsafe code you can also access the position of the particle which emitted the event.

Example Code

The following example script demonstrates how to register the custom handler for the events.

public class HandlePopcornFXEvent : MonoBehaviour
	void Start ()

	public static void OnRaiseEvent(string eventName, Vector3 position)
		Debug.Log(eventName + " " + position); 
	public static void OnRaiseEvent(string eventName)