Hello, i’m trying to write an OnGUI script that has an if statement that checks if a GUIContent variable called toolbar has a string or not.
it’s a long script, but i’ll show you the stuff regarding my question.
public GUIContent toolbar1;
void Start()
{
addItem();
toolbar1 = new GUIContent("");
}
public void addItem()
{
print ("additem ran");
if (toolbar1 == new GUIContent(""))
{
print ("1 was empty");
}
}
When i run this script it doesn’t print “1 was empty”