- Home /
How can I use 'curves' like ParticleSystem has?
So I want to be able to have a script where some of the variables are a 'curve' like you see in Shuriken particle systems. I need one for color, and one for just a floating point mapping (something like 'particle size over time').
How can I get that type of thing?
Answer by DaveA · May 01, 2013 at 09:00 PM
I'm guessing you write your own using this: http://docs.unity3d.com/Documentation/ScriptReference/EditorGUI.CurveField.html
But it would be cool to have a 'curve' data type. And since you mention it, the docs on ParticleSystem are pretty cryptic: "When using curves, this values acts as a scale on the curve." But does not say how to 'use curves' programatically.
That API indicates AnimationCurve. Seems like there should be a generic Curve datatype, right? But you should be able to extract values from that for whatever purpose
Ok that should work for the float value, thanks. Do you know of any color range thing?
I'm guessing Shuriken wrote a custom Editor GUI window to popup the color pickers and then set those RGBA values to AnimationCurves