hi I am writting some code like this:
public Dictionary<string,long> dictionary = new Dictionary<string,long>();
public GUIStyle s;
void displayHeadings()
{
foreach (KeyValuePair<string,long> entry in dictionary)
{
if (GUI.Button(new Rect(100,200,100,100), entry.Key + " " + entry.Value, s))
{
Debug.Log("Clicked me!");
}
}
}
void OnGUI() {
displayHeadings();
}
As one may have guessed upon reading this, does the logging statement happen? Yes. My question: why? What am I doing wrong?