dmax
New Member
Posts: 4
|
Post by dmax on Mar 13, 2021 13:42:18 GMT
Demo "15 Expanding Cells" work fine in demo scene. If loop option is selected on Enhanced Scroller, cells are looped properly.
Click on folding cell unfold good, but after scroller reload it jumps to offset position. Somewhere in Conroller.cs method TweenEnd() doesn't calculate well jump position, but I can not figure out what should be corrected. I noticed that bool _tweeningFirstPadder newer gets positive.
I'd like to use this function in loop, but for now can not make it work.
|
|
|
Post by echo17 on Mar 15, 2021 12:24:05 GMT
If you could post a video of what you are describing that would help me to see the issue.
|
|
dmax
New Member
Posts: 4
|
Post by dmax on Mar 15, 2021 17:46:31 GMT
In the attached video is the demo scene "15 Expanding Cells" in the new Unity project. When open and close 1 tweened cell, it all works fine. If 1 cell is opened and then we open 2nd one, the scroller jumps up and we need to scroll it down in order to see it. Attachments:Scroller Video 1.mp4 (790.15 KB)
|
|
dmax
New Member
Posts: 4
|
Post by dmax on Mar 15, 2021 18:00:46 GMT
In this video, is enabled loop. After start playing, first I'm scrolling down to pull "last" cells and click on 1st tween cell 45. It opens normally, but the scroller jumps when the cell is closing. Attachments:Scroller Video 2.mp4 (917.23 KB)
|
|
dmax
New Member
Posts: 4
|
Post by dmax on Mar 15, 2021 18:18:34 GMT
In coroutine TweenPosition (Tween.cs) I noticed the variable "lastPosition" wrongly placed. On the attached image, the current position is squared in red. lastPosition is initiated with the value from attribute start (yellow square), but in the first loop is immediately replaced with the value from "newPosition" that is initiated with 0f. It looks to me that this row in the red square should be placed below the green square. In this place, it will not matter for the 2nd and consequential loops, but it will matter for the 1st loop as lastPosition will retain "start" value. This is important for attribute "delta" that is sent with tweenUpdated (green square). tweenUpdated(newPosition, newPosition - lastPosition); Currently, in the first loop delta (which is "newPosition - lastPosition") will be the same as newPosition, because lastPosition will have a value 0f that it god from newPosition when it had that value (red square). newPosition will be updated until reached this part, so "delta" will be some value from newPosition (cell size) minus 0f (lastPosition). In the 2nd and every next loop, this value will be a real delta difference, as lastPosition is not 0f anymore, but the real previous value. I notice this because I wanted to use, delta value and spot this jump of value in 1st loop. Attachments:
|
|
|
Post by echo17 on Mar 16, 2021 12:24:09 GMT
Thanks for the details, I'll take a look and post back here when I have an update.
|
|
|
Post by echo17 on Mar 18, 2021 16:30:42 GMT
OK, I completely re-worked Demo #15 to accommodate looping. I also implemented your bug fix in Tween.cs (thanks for that!).
You can find these updates in the latest version (2.29.0+) of EnhancedScroller on the Unity Asset Store.
|
|