Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- public static int Clamp ( int value, int minValue, int maxValue )
- {
- int result;
- if ( value <= minValue )
- {
- if ( value >= maxValue )
- {
- return value;
- }
- else
- {
- return maxValue;
- }
- }
- else
- {
- return minValue;
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment