hey! so im working on a console for a project and the best (easiest least code) method i've found without getting a plugin for this is using an array, filling it with stuff (log output) and pushing it to a dynamic GUI list in the form of a for loop based on how many elements are in the array. now here's the problem, i can only have about 25 objects in the array before the game starts dropping in frame rate. at about 50 items, im down to 30 (from 70). which is as im sure you can immagine very annoying. so what is the best way to go about having a dynamic list using unity's built in GUI system? here's my draw code : Code (JavaScript): GUI.Box(Rect(10,648-260,420,220),"Debug Log"); DebugBar = GUI.BeginScrollView (Rect (10, 648-240, 420, 200), DebugBar, Rect (0, 0,400, outputArray.length*25+15)); for(i = 0; i<outputArray.length; i++){ GUI.Button(Rect(10,i*25+15,380,25),outputArray[i] + " |" +i +"|" ); } GUI.EndScrollView(); } to fill the array im just saving the game to call the save notification. i've checked the profiler and it is comming from this script so i know its nothing to do with saves by the way. thanks for any and all help!
are you particularly attached to the old legacy GUI approach? the newer UI came out in 4.6 and it does dynamic content much more simply
new system is less verbose on the scripting side, more "build in scene view" like the rest of unity. For example, to get a grid of elements you would just have a panel (UI gameobject) with a GridLayout component and add in whatever you want in the grid as children. I have no idea if the new system will solve your performance issues though, but unity seems to be going in that direction so it might be worth looking into the learn section UI tutorials as a primer.