- Home /
Unity UI - Data Management for GameObjects in ScrollRect/TableViews with Large Data Sets
In native iOS and Android programming, things such as a tableviews are setup in a way that can handle huge amounts of data. They only keep in memory what is visible in the viewport at any given time and as you scroll, things are offloaded and loaded to and from memory. However if we are implementing something like in Unity UI, simply adding all the data items as new GameObjects (via a Prefab GameObject "Row" Item) would easily overwhelm the memory.
Using Destroy on a GameObject wouldn't be optimal since, if you scroll something out of view and back into view before it is destroyed things can get messy. Also if using DestroyImmediate, this could cause the program to hang.
I was wondering if there is a way to easily manage memory with a masked ScrollRect in Unity for large datasets?
Sidenote: From my experience, adding a mask to a scroll rect in Unity and exporting to iOS immediately drops the FPS from 60+ to 30-40 FPS at runtime on device (both iPhone 5 and iPad Air). I'm not sure if this is the result of the redraw calculations or not but just wondering if others have had a similar situation.
Thanks for all the replies!
Your answer
Follow this Question
Related Questions
using Contains(gameObject) to find and destroy a gameObject from a list 2 Answers
Problem with timed code-execution (audioplay and object destruction) 1 Answer
Trying to make a simple inventory: 0 Answers
Destruct gameobject by call from another script 1 Answer
GameObject.FindGameObjectsWithTag still finding destroyed object (C#) 1 Answer