05-12-2023, 02:42 PM
Follow up on this question, I tried using the createGameObject module to get my wall game objects and call functions.
Using the OnRefresh callback I was able to access the items via createGameObject.GameObjects.Items.
This worked however in an attempt to slightly optimize my preview stuff (basically just applies a material property block to each wall when preview toggle is set) I tried to optimize this by having OnRefresh add the Preview component I needed to a cached list. On every refresh, I'd clear the list and update. This way if I moved the cursor slightly and the preview changed but the wall amount didn't, I wouldn't need to regrab all the wall modules again.
The issue is that I think the way the pooling works, its constantly changing out the objects anytime it regenerates? And thus my caching doesn't work all the time and I'm forced to rebuild the list of the wall modules.
There has to be some better way to handle this right?
Using the OnRefresh callback I was able to access the items via createGameObject.GameObjects.Items.
This worked however in an attempt to slightly optimize my preview stuff (basically just applies a material property block to each wall when preview toggle is set) I tried to optimize this by having OnRefresh add the Preview component I needed to a cached list. On every refresh, I'd clear the list and update. This way if I moved the cursor slightly and the preview changed but the wall amount didn't, I wouldn't need to regrab all the wall modules again.
The issue is that I think the way the pooling works, its constantly changing out the objects anytime it regenerates? And thus my caching doesn't work all the time and I'm forced to rebuild the list of the wall modules.
There has to be some better way to handle this right?