I use to use this code:
ParticleSystem m_System = GetComponent<ParticleSystem>();
m_System.startLifetime = startValue; //Write
float read = m_System.startLifetime; //Read
But after updating to Unity 5.5, Unity deprecated startLifetime.
I now have to do:
ParticleSystem m_System = GetComponent<ParticleSystem>();
ParticleSystem.MainModule main = m_System.main;
main.startLifetime = startValue; //Write
The problem is that I can’t read main.startLifetime.
I can’t do this:
float read = main.startLifetime; //Read
I get the error:
Cannot implicitly convert type ‘UnityEngine.ParticleSystem.MinMaxCurve’ to ‘float’
What’s the equivalent of reading ParticleSystem.startLifetime as a float?
What’s the equivalent of reading ParticleSystem.startSize as a float?
I also used to have another Particle code that looks like this:
ParticleSystem.startSize *= myMultiplier
I noticed startLifetimeMultiplier in ParticleSystem.MainModule.
How should I translate this? Thanks.