Using a Texture as a Button Again

Hey

Is this code ok ???

/* Button Content examples */

var icon : Texture2D;

function OnGUI () {
	if (GUI.Button (Rect (375,265, 100, 50), icon,GUIStyle.none)) {
		print ("you clicked the icon");
	}
}

my Texture2D is 512 x 512 tiff withe alpha map.

but somtimes my unity crash and when i change the orintation from player settings ( right - left landskabe ) unity close : (

when i export this to my iphone device, i cant see no texture but in my unity player windows all seem fine.

If everything looks okay and works with just doing Button(rect, image) then I would just do that.

I don’t know iPhone so have no idea what can be causing the issue when you give it GUIStyle.none.

Problem Solve — :?

I use the gui texture instead and a normal button with Guistyle.none and now it working…