Hi,
I was wondering if anybody knew how I could go about mimicking the particle editor’s nifty “constant/curve/between two” functionality. I have various gameplay constants that I would like to set in editor in a similar way. Damage, for instance, could be a constant, a random in some range of values, or applied via a curve based on some parameterization code side.
Any ideas?
Thanks!
To start with, you get a neat curve editor when you use AnimationCurve as a public variable. You can also use PropertyDrawers. With these in mind, you can create a class that holds all of those numbers and some curves, and a PropertyDrawer to edit that class and make it nice and pretty. It needs a random value (which you use as the lerp control variable in all the “random between” options). Finally, this class needs a Evaluate(float) function that can spit out your number.