Hi there,
Some basic stuff I can’t deal with.
I have a scene kinda virtual showcase with design objects and need to change there colors / materials with Gui sliders.
Despite the limitation of lerp.material (wich unfortunately does not allow to change texture map or shader type) I managed to write a little script that works :
var style : GUIStyle;
var hSliderValue : float;
var material1 : Material;
var material2 : Material;
function OnGUI () {
GUI.skin.horizontalSlider = style;
hSliderValue = GUI.HorizontalSlider (Rect (25, 25, 300, 30), hSliderValue, 0.0, 1.0);
}
function Update () {
var lerp = hSliderValue;
renderer.material.Lerp (material1, material2, lerp);
}
The issue there is that this script only applies on the FIRST material of the Mesh Renderer list.
How could it select another entry (example “element 2 material”) so that :
1/ it’s the correct part of the model that changes
2/ in some cases I need to have several sliders corresponding to several materials of the same objects (example metal / wood / plastic parts of it).
Any help appreciated.