You Cant Not Change Value Directly Try This will solve Your Problem
class RandomAssign
{
[SerializeField] private ParticleSystem _particleSystem;
[SerializeField]private float _min ;
[SerializeField]private float _max;
private void Start()
{
//using Random Value
var initialTime = Random.Range(_min, _max);
var main = _particleSystem.main;
//Assign Time Using Curve
// main.startLifetime = new ParticleSystem.MinMaxCurve(_min,_max);
main.startLifetime = initialTime;
}
}
Starting from 5.3 you need to first define a variable for the particle system module in question before using its functions, in this case, the “main module”: