# customData

> Script interface for the CustomDataModule of a Particle System.

## Definition

* **Type:** Property
* **Namespace:** [UnityEngine](/engine/6000.6/script-reference/unityengine.md)
* **Assembly:** UnityEngine.ParticleSystemModule

```csharp
public ParticleSystem.CustomDataModule customData { get; }
```

### Remarks

Once configured, this module will generate custom per-particle data, which you can use either in script or shaders. To read the data from script, simply call [ParticleSystem.GetCustomParticleData](/engine/6000.6/script-reference/unityengine/particlesystem/getcustomparticledata.md). To read it in a shader, enable the custom data streams in the [ParticleSystemRenderer](/engine/6000.6/script-reference/unityengine/particlesystemrenderer.md) Module, or call [ParticleSystemRenderer.SetActiveVertexStreams](/engine/6000.6/script-reference/unityengine/particlesystemrenderer/setactivevertexstreams.md) from script. Once enabled, the custom data will be passed to your vertex shader through a TEXCOORD channel. The [ParticleSystemRenderer](/engine/6000.6/script-reference/unityengine/particlesystemrenderer.md) Inspector will tell you which channels are being used.

Particle System modules do not need to be reassigned back to the system; they are interfaces and not independent objects.

Additional Resources: [ParticleSystemRenderer.SetActiveVertexStreams](/engine/6000.6/script-reference/unityengine/particlesystemrenderer/setactivevertexstreams.md).

### Examples

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

[RequireComponent(typeof(ParticleSystem))]
public class ExampleClass : MonoBehaviour
{
    void Start()
    {
        ParticleSystem ps = GetComponent<ParticleSystem>();
        var customData = ps.customData;
        customData.enabled = true;

        Gradient grad = new Gradient();
        grad.SetKeys(new GradientColorKey[] { new GradientColorKey(Color.blue, 0.0f), new GradientColorKey(Color.red, 1.0f) }, new GradientAlphaKey[] { new GradientAlphaKey(1.0f, 0.0f), new GradientAlphaKey(0.0f, 1.0f) });

        customData.SetMode(ParticleSystemCustomData.Custom1, UnityEngine.ParticleSystemCustomDataMode.Color);
        customData.SetColor(ParticleSystemCustomData.Custom1, grad);
    }
}
```
