static function Clamp (value : float, min : float, max : float) : float
Description
Clamps a value between a minimum float and maximum float value.
static function Clamp (value : int, min : int, max : int) : int
Description
Clamps value between min and max and returns value.
using UnityEngine;
using System.Collections;
public class example :
MonoBehaviour {
void Awake() {
print(
Mathf.Clamp(10, 1, 3));
}
}