- Home /
 
How to set a background for style
My problem is thet i cant set noraml.background of my style with a script. I just get NullReferenceException.
Here what i have so far:
 private var UnitControl_skill_style_active : GUIStyle;
 function Start ()
 {
 var Button_Normal : Texture = Resources.Load("Battle Mode/Texture/GUI/Button_Normal");
 UnitControl_skill_style_active.normal.background = Button_Normal; // <--- NullReferenceException
 }
 
 
              Can you be more clear on the question? "Background Style" is very vauge. Do you mean setting a background? Improting images? Background manipulation in reaction to something?
I need to set a normal/active background for my button on script startup.
I have all textures imported to Battle $$anonymous$$ode/Texture/GUI/
Answer by ShadowAngel · Nov 30, 2012 at 06:26 PM
Found what was error. Unity cant process space char in folder names. I wonder why unity allows use of spaces in names if it cant process them =/
Your answer
 
             Follow this Question
Related Questions
GUIStyle not working on GUI.Button 4 Answers
Changing background, font and style of buttons 1 Answer
How can I prevent shadow sprite overlap? 0 Answers
Runner Game Background Softly Change 0 Answers
Title screen is off to the side in build 2 Answers