How to define a slider on script file?


I want a slider like what is in the image below on my script file:


how can i make that?!

This can be accomplished for individual fields by adding the Range Attribute

To show what is in your example when you created your public field place the Range Attribute above it like this:

    [Range(1, 10)]
    public float colourMultiplier;

This will cause the editor to instead show a slider in the inspector you can drag around between the two values (In this case between 1 and 10 including 1 and 10).