- Home /
GUI Skin Custom textures in C#
I am trying to use custom textures instead of the default GUI Skin provided ones; Not use a custom skin but rather one that's "empty'.
So I did so:
public class MenuManager : MonoBehaviour {
public GUISkin PiratesGuiSkin;
And later called it in OnGui:
void OnGUI() {
GUI.skin = PiratesGuiSkin;
But for some reason I still get the default buttons skinning my gui elements around. Where am I wrong? Thanks!
Answer by CHPedersen · May 06, 2011 at 11:15 AM
Have you created a Skin in the editor and dragged it onto the PiratesGuiSkin variable? If not, it will remain null, and if you assign null to GUI.skin, Unity defaults to the Skin it came with.
yes I have. And removed the textures from its styles, should I add a transparent texture maybe?
Answer by Ejlersen · May 06, 2011 at 11:36 AM
Have you assigned new textures to the Button GUIStyle in the GUISkin?
I made various changes to my own GUISkin but apparently in the code it is not actually assigned to anyt of my gui elements, it's still defaulting.
Hm, you are not by any chance relying on that assigning GUISkin ones will automatically do it in every monobehaviour script with an OnGUI method?
Your answer
Follow this Question
Related Questions
Custom GUI Button is Black 1 Answer
Attach a GUI Skin Dynamicaly 2 Answers
Where is the directory for GUI skin 0 Answers
Custom Material Editor 1 Answer
GUI background changed, don't know how to reset it. 2 Answers