I have a UIpanel in my application and i instantiate gameobject in it programmatically during runtime, the problem i have is i have to create more than 1000 gameobjects (sometimes up to 6000) in that panel and that takes a long time freezing the UI and trying it with Coroutines cause some lags as well.
is there any way to have a list of gameobjects and create them in UI panel during user scrolling that panel?
or can somebody suggest a better way of adding gameobjects to a panel without any lag or UI freeze?
UPDATE :
I added this to clear my goal.
i have a long list of items that i trying to put them in a list each item have a picture a some button and some texts, below there is a sample from a single item:
now i need to instantiate this complex sample in a panel and each item change itself based on a ID i pass after instantiation.
but i have a panel capacity problem and even if i cut some item when i put that many object in a panel at once scrolling in panel make it very slow and painful
also i need a scroll bar for my panel so i have to have all of my object available in the panel
hope this information helped.
When you describe it that way, its much clearer & much simpler.
Look at any mobile application: they do not put 6000 people records on a single page. Its normally paged or grouped, with a search option. So do that instead.
If you look at the facebook mobile app (a good standard) if you start scrolling to look at older posts, every few seconds it pauses for a second or two to load the next few posts. Its the same with the youtube app.
Because of this 65535 unity limit, just put in a paging limit (say 100-200 items).