I need some help guys. Correct me if I am wrong. By the way. I trying to create a small button in left bottom of the screen. I made a gui skin with a set up specific for that button. I set its normal background and active background. my problem is the center button is also using that skin.
How do I prevent a center button to use the gui skin of left bottom button and set its own GUI skin with different sets of background? I was using an object and put a rigidbody so the onmouseup command will work. the problem is the unity keeps showing GUI warning mouse events
public GUISkin mGui;
float nativeWidth = 1080f;
float nativeHeight = 1920f;
void OnGUI()
{
GUI.skin = mGui;
float rx = Screen.width / nativeWidth;
float ry = Screen.height / nativeHeight;
GUI.matrix = Matrix4x4.TRS(new Vector3(0, 0, 0), Quaternion.identity, new Vector3(ry, ry, 1));
float adjustedWidth = nativeWidth * (rx / ry);
float adjustedHeight = nativeHeight * (ry / rx);
//Left Bottom
if (GUI.Button (new Rect (10, adjustedHeight + 190, 100, 100), "")) {
Debug.Log( "Clicked" );
}
//center
if (GUI.Button (new Rect (adjustedWidth / 2, adjustedHeight /2 , 200, 100), "")) {
Debug.Log( "Clicked" );
}
}