For Alex
Code:
private var startingColor : Color; function Awake() { //Get the original color value of the GUI startingColor = guiTexture.color; } function Update() { //When the mouse is down, transition from whatever color the guitTexture is currently at to the color red (Color (1,0,0) if (Input.GetMouseButton(0)) { guiTexture.color = Color.Lerp(guiTexture.color, Color (1,0,0), Time.time * .001); } //When the mouse is not down, check to see if the current color's red channel is more than the starting color's red. If it is, lerp back to the starting color else { if (guiTexture.color.r > startingColor.r) { guiTexture.color = Color.Lerp(guiTexture.color, startingColor, Time.time * .001); } } }