In a C# Unity script, how can I add fields that will be displayed in the Unity Inspector with min and max values on a single line? (like it is done for the Particle System, where you can choose Between Two Constants
)
WHAT I HAVE | Separate lines for min and max:
public class MyTest : MonoBehaviour {
[SerializeField] float projectileRateMin = 1f;
[SerializeField] float projectileRateMax = 3f;
}
WHAT I WOULD LIKE: Single line with both min and max:
Another example is Vector2, which also gets displayed in the Inspector on one line. I did look at the Vector2 code and tried to copy and rename the relevant parts of the Vector2 struct to my own version, but it didn't show up in the Inspector at all.