# GetEvents(List<string>)

> Gets the name of every Event connected to a system.

## Definition

* **Type:** Method
* **Namespace:** [UnityEngine.VFX](/engine/6000.6/script-reference/unityengine/vfx.md)
* **Assembly:** UnityEngine.VFXModule

```csharp
public void GetEvents(List<string> names)
```

### Parameters

**** (\[List\<string>]\(https\://learn.microsoft.com/dotnet/api/system.collections.generic.list-1)): The List that this function populates with the event system names.

### Remarks

To increase the speed of the retrieval process, preallocate the `names` input list.

Additional Resources: [VisualEffect.SendEvent](/engine/6000.6/script-reference/unityengine/vfx/visualeffect/sendevent.md).

```csharp
using System.Collections.Generic;
using UnityEngine;
using UnityEngine.VFX;

[ExecuteInEditMode]
class LogEventNames : MonoBehaviour
{
	// Called when the script or GameObject is enabled
    void OnEnable()
    {
        VisualEffect vfx = GetComponent<VisualEffect>();
        if (vfx != null && vfx.visualEffectAsset != null)
        {
            VisualEffectAsset vfxAsset = vfx.visualEffectAsset;
            var eventNames = new List<string>();

            // Retrieve all events from the VisualEffectAsset and store them in the list
            vfxAsset.GetEvents(eventNames);
            if (eventNames.Count == 0)
            {
                Debug.Log($"There are no events listed for asset: {vfxAsset}");
            }

            foreach (var eventName in eventNames)
            {
                Debug.Log($"Event: {eventName}");
            }
        }
        else
        {
            Debug.Log("Unable to retrieve VisualEffect component or VisualEffectAsset is null.");
        }
    }
}
```

This example logs all available events in the attached `VisualEffectAsset`.
