Hey guys, just a small issue with a GUIContent array.
It would seem that it doesn’t like to be re-sized. Here is my code:
buttons.partyButtons = new GUIContent[skills.partySize[0]];
for(var j : int; j < skills.partySize[0]; j++)
{
buttons.partyButtons[j].tooltip = currentParty[j].GetComponent(Info).fullName;
}
So I’m resizing it to the value in a different array then adding the names of things in another array to the tool tips of the GUIContent array. When I run this however I’m give this error.
NullReferenceException: Object reference not set to an instance of an object
That points to the line inside the for loop. If I remove the resizing of the array and re-size it manually it works no problem.
I found adding a yield between the re-size and the loop helped but only about 30% of the time.
Cheers.