How to get the value of the checkbox of Custom Vertex Streams in the C# script ?,How to get the value of the checkbox of Custom Vertex Streams in C# script?

206385-6b753d8a-3cc1-454d-853f-d7d9e699011e.png

,206385-6b753d8a-3cc1-454d-853f-d7d9e699011e.png

The ‘custom vertex streams’ settings are not directly exposed. However, you can indirectly access and modify them through a script by manipulating the ParticleSystemRenderer component.

To get the list of custom vertex streams, you can use the ‘GetActiveVertexStreams’ method. Something like this:

using UnityEngine;
using System.Collections.Generic;

public class VertexStreamsExample : MonoBehaviour
{
    private ParticleSystemRenderer particleSystemRenderer;
    private List<ParticleSystemRenderer.VertexStream> activeVertexStreams;

    void Start()
    {
        particleSystemRenderer = GetComponent<ParticleSystemRenderer>();
        if (particleSystemRenderer != null)
        {
            activeVertexStreams = new List<ParticleSystemRenderer.VertexStream>();
            particleSystemRenderer.GetActiveVertexStreams(activeVertexStreams);

            // Iterate through the active vertex streams and log their values
            for (int i = 0; i < activeVertexStreams.Count; i++)
            {
                Debug.Log($"Vertex Stream {i}: {activeVertexStreams*}");*

}
}
}
}
Attach this script to a GameObject with a Particle System and Particle System Renderer component. When you run the scene, it will log the values of the active custom vertex streams in the console.
Keep in mind that this script only retrieves the current list of active custom vertex streams. You cannot directly access or modify the checkboxes in the Custom Vertex Streams list through the API. However, you can change the custom vertex streams by calling SetActiveVertexStreams with a modified list.