hello all
can someone please tell me, how i change the sice of the texture placed in the button as icon.
or how i can add some backround to the button, using the var icon : texture;
var hover : String;
var icon : Texture2D;
var caro : String;
var White : GUISkin;
function OnGUI () {
GUI.skin = White;
if (GUI.Button(Rect(10,120,20,45),GUIContent(icon, "Color")))
{
DoSomething();
}
hover=GUI.tooltip;
if(hover=="Color")
{
GUI.Label(Rect(10,170,180,18), "Emerald Green");
}
}
function DoSomething () {
caro = "_Caro_Front_";
GameObject.Find(caro).renderer.sharedMaterial.mainTexture = icon;
}
please help, i can’t figured out…
best regards
michael