using UnityEngine;
using System.Collections;
public class ColorChangeOnHover : MonoBehaviour {
// Use this for initialization
Color32 initCol;
public int materialID;
public byte RED;
public byte GREEN;
public byte BLUE;
Color32 changeto;
public GameObject target;
void Start(){
initCol = target.renderer.materials[materialID].color;
changeto
= new Color32
(RED,GREEN,BLUE,
255);
}
void OnMouseOver () {
target.renderer.materials[materialID].color = changeto;
}
void OnMouseExit(){
target.renderer.materials[materialID].color = initCol;
}
// Update is called once per frame
void Update () {
}
}