LoopScrollRect
LoopScrollRect copied to clipboard
Inherit from ScrollRect, but use reflection; to make code more maintainable?
In the descriptions, you've said "I need to modify some private variants to make dragging smooth." But I think it's possible to do that using reflection. This removes code duplication, won't need copying a newer ScrollRect code if one becomes available, and makes understanding the additional features easier (since we won't need to study the duplicated codes). Is there anything else that stopped you from inheritance, besides access to private members? If that's the only reason, I could try, and see if inheritance + reflection works.
Yep, overriding/modifying private methods/members is the only reason for copying codes. If reflection works and performance doesn't hurt, it would be great! ps. I tried long time ago but fails with IL2CPP. I'm not sure if it works with recent Unity.