Hi there,
I’ve got a problem. I want to split a string and place it in a label of the for loop.
This is the code:
for(int i = index; i < index2; i++) {
GUILayout.BeginArea(new Rect(20, (height + (12 * i)), 110, 20));
string[ ] split = friendidstring.Split(":"[0]);
GUILayout.Label("online: " + split[-1 + i]);
GUILayout.EndArea();
}
But I get this error:
GUI Error: You are pushing more GUIClips than you are popping. Make sure they are balanced)
And:
IndexOutOfRangeException: Array index is out of range.
Friends.FriendsWindow (Int32 windowID) (at Assets/Highscore/Script/Friends.cs:93)
UnityEngine.GUI.CallWindowDelegate (UnityEngine.WindowFunction func, Int32 id, UnityEngine.GUISkin _skin, Int32 forceRect, Single width, Single height, UnityEngine.GUIStyle style) (at C:/BuildAgent/work/d3d49558e4d408f4/artifacts/EditorGenerated/GUI.cs:1395)
Can someone help me with how to split that string and how i can place this into my for loop with the label.
And that the first loop has split[0] and the second split[1].
with friendly greetz
Dennisjo1