core icon indicating copy to clipboard operation
core copied to clipboard

Implement Unity GameObject pooling

Open KurtGokhan opened this issue 2 years ago • 1 comments

When creating new elements, many new GameObjects will be created on Unity side. This is a problem especially since some components drop the framerate on initialization (like TextMeshPRO). Such components (or ideally all components) should be pooled and recycled.

This was requested in Discord. Here is a simple example of how to implement it.

KurtGokhan avatar Aug 12 '22 12:08 KurtGokhan

Done in main branch. Will be released in next version.

KurtGokhan avatar Oct 12 '22 09:10 KurtGokhan

Added pool property to all elements, accepting either boolean or string. This will group similar elements in a pool and recycle elements from that pool instead of creating/destroying them each time. This is enabled by default for text elements. Will observe how it works and may improve it in the next versions.

KurtGokhan avatar Jan 16 '23 08:01 KurtGokhan