How to change GUIStyle normal background texture2D through script?
This will be used whenever I clicked a button the background texture2D will be changed its texture2D.
In the Scripting Reference, it says use this code:
//i just add a gui.button
var aTexture : Texture2D;
if (GUI.Button (Rect (590,244,150,50), chap)){
GUI.skin.customStyles[0].active.background = aTexture;
}
but it is not working for me …
any suggestions?? thanks in advance