Hello everyone,
My script is pretty big, so I'll try me best to narrow it down to the core.
I'm trying to use 3 IntSliders to manipulate a GameObject's color. Here's what I had in a nutshell:
var slideR : float = 255; //Range: 0-255
var slideG : float = 255;
var slideB : float = 255;
function Update(){
headPart.renderer.material.color.r = slideR/ 255;
headPart.renderer.material.color.g = slideB/ 255;
headPart.renderer.material.color.b = slideG/ 255;
}
function OnGUI(){
slideR = EditorGUI.IntSlider (Rect(850, 500, 200, 20), slideR, 0, 255.0);
slideG = EditorGUI.IntSlider (Rect(850, 520, 200, 20), slideG, 0, 255.0);
slideB = EditorGUI.IntSlider (Rect(850, 540, 200, 20), slideB, 0, 255.0);
}
However, this gives me the error of "Unknown identifier: EditorGUI". I've read that I should place the script in my Editor folder, but then it can't be attached to my GameObject anymore. What would be the best way to get around this limitation?
Thanks in advance, Patrick
Do'w, I didn't even realize there was a GUI.HorizontalSlider. It worked without any additional changes, thanks! =)
– Senshi