if (response is IList)
{
IList buddy = (List) response;
for(int i=0;i<buddy.Count;i++){
Debug.Log("Buddy request from: " + buddy*.GetBuddyName());*
buddy_requests_list.Add(buddy*.GetBuddyName());
_ }_
GetBuddyRequest.buddy_requests = buddy_requests_list.ToArray();
_ }*_
public static string[] buddy_requests;
void OnGUI(){
* {*
* scrollPosition = GUI.BeginScrollView(new Rect(Screen.width - 950, Screen.height - 400, 100, 200), scrollPosition, new Rect(0, 0, 0, 1000));*
* buddy_selected = GUILayout.SelectionGrid(buddy_selected, buddy_requests, buddy_requests.Length);
_ GUI.EndScrollView();_
_ }*_
* }*
so the code is generating a buddy list then i’m converting it to an array and putting it into the buddy_requests variable. But I’m still getting a null reference error on the line buddy_selected = GUILayout.SelectionGrid(buddy_selected, buddy_requests, buddy_requests.Length);
And I’m not sure why, I use code identical to this in another script and seems to work fine.