|
Post by noncom on Apr 7, 2023 14:04:57 GMT
Hi! First of all I want to say that this is a very nice asset!
However, there's one small issue I've encountered: When setting up my list I forgot to set the delegate on the `EnhancedScroller`, which resulted in the list just showing blank, without any errors. I spent quite a while debugging this, both my code and then the `EnhancedScroller`s code, and found out that if the delegate is not set then it just silently misses updating the list size in the `ReloadData()` method. This in turn results in nothing being shown.
It doesn't look like there's any point in going further if the delegate is not set. So I'm not sure, but shouldn't the delegate missing there cause an exception that describes what's wrong?
|
|
|
Post by echo17 on Apr 8, 2023 10:19:55 GMT
Thanks for the kind words. The intent of the behavior you are seeing was to be able to silence the scroller simply by setting the delegate to null. That way you don't have to constantly do checks in your controller to see if you should call reload data or any of the other delegate commands. You can quickly stop the scroller from updating just by setting the delegate to null, and then re-enable by assigning the delegate again. This also lets you hand off processing to other controllers, even with a few frames of delay (such as in a coroutine running on a different thread) without errors.
I realize these situations are outliers, but I wanted to give that control to the programmer without limiting them.
|
|
|
Post by noncom on Apr 8, 2023 16:23:01 GMT
Ah, I see. Yeah that makes sense. Although I'd do that just with an explicit flag in the `EnhancedScroller` just to make it clear what is going on and why. Or maybe add the description of that use of `Delegate` into the doc. But now I understand more about how the asset is intended to work, and that there's a way to easily stop it from updating when that's needed, thanks!
|
|