ibyte
New Member
Posts: 24
|
Post by ibyte on Jun 9, 2020 21:21:33 GMT
Sorry for the odd subject. I only have 3 rows and only 1 is visiable at any one time. When a user clicks on a button in the current view I may need to update the cellview that is not viisble and possibly not active in the current hiearchy.
Is it possible to tell the scroller to always maintain those three game obejcts and not to recycle them? or only ever have one active cell so that each cell is forced to rebuild when it is being reactivated. I notice some times tehre are two cells actiev and other times ther is one cell active but never 3 at the same time.
If that is not possible how do i manually force a cellview rebuild when data it relies on elsewhere changes?
To give you a bit more background, two of the rows have buttons that will change the graphics of the other row when selected. I need to keep them in sync and it works most of the time. The odd time the cell does not get rebuilt.
Glenn
|
|
|
Post by echo17 on Jun 10, 2020 13:25:55 GMT
Actually, I just released an update (v2.25.0) that has a lookAheadBefore and lookAheadAfter values that allow you to preserve cells that would otherwise not be visible. In your example, you would set the lookAheadBefore to the size of your first cell (plus spacing if necessary) and the lookAheadAfter to the size of your last cell (plus spacing if necessary).
Please be sure to back up your work before updating the plugin. Plugin available on the Asset Store.
|
|
ibyte
New Member
Posts: 24
|
Post by ibyte on Jun 10, 2020 19:44:54 GMT
These are public vars but they not showing up in my inspector? They show as greyed out when looking at the script in debug mode? These should be set from code only?
|
|
ibyte
New Member
Posts: 24
|
Post by ibyte on Jun 10, 2020 20:11:20 GMT
Actually this is not helping based on the way I have my code setup. I think what i need it to use delegate cellViewVisibilityChanged();
|
|
ibyte
New Member
Posts: 24
|
Post by ibyte on Jun 10, 2020 20:44:46 GMT
Oh boy I think I am doing something else wrong - My number of recycled cells keeps growing over time?
Glenn
|
|
ibyte
New Member
Posts: 24
|
Post by ibyte on Jun 10, 2020 21:31:20 GMT
I am trying to use cellViewVisibilityChanged(). I was expecting it to be called on the cell coming into view according to the documentation but my console is showing me otherwise?
|
|
|
Post by echo17 on Jun 11, 2020 12:57:13 GMT
I think I'll need to see a working example to be able to give you a good diagnosis. You can create a simple project and zip it up, sending to my support email (in the signature). Please see this FAQ for more information: link
|
|
ibyte
New Member
Posts: 24
|
Post by ibyte on Jun 11, 2020 13:53:17 GMT
Hi you can use the same sample I provided yesterday. I will send the updated files to apply over top. Thanks!
|
|