Changing one button style's background changes for all styles

In the code below I am trying to have different styles for different buttons. The handStyle GUIStyle is used for cards that should be shown and blankHandStyle for cards that should give the appearance of being upside down. When I remove the last line all buttons show the handStyle GUIStyle, when it is there all buttons show the cardBack texture. When creating buttons in the OnGUI function I have correctly assigned Styles in the parameters.

		//Hand
		handStyle = GUI.skin.GetStyle("button");
		handStyle.normal.background = normalButton;
		handStyle.fontSize = Mathf.RoundToInt(((Screen.width/Screen.height)*11.5f)*GUIScale);
		blankHandStyle = GUI.skin.GetStyle("button");
		blankHandStyle.normal.background = cardBack as Texture2D;

Hi,

Problem here is that you are passing button style to both handStyle and blankhandstyle which is why changing the background of one changes for all.
You need to create two different custom styles and and pass them to hand style and blankHandStyle separatly ,then it would not affect each other.
Hope you are clear what i mean.

Here you need to pass different styles to both the buttons. You can achieve this by creating a GUISKIN and then making custom styles as much as you want.

You can take help from below:

[37494-screen+shot+2014-12-23+at+3.36.26+pm.png|37494]

Now in Code assign this GUISKIN publically.

C# code:

public GUISkin mainMenuSkin;
and then

handStyle = mainMenuSkin.GetStyle("CustomStyle1");
blankHandStyle = mainMenuSkin.GetStyle("CustomStyle2");

so on..