Hello,
Ive created a timeline in Unity where you can drag and drop sprite into and then you can drag the sprites at the sides to increase/decrease the width.
It all works great except that i cant seem to determine the centerpoint and the start and end of the widget. Its built as follows:
Container - With a manager script for the objects interactions
- Background sprite with collider for dragging
- Arrows for resizing
The code can be seen here:
http://pastebin.com/FfzRwKpqBelow is the code i use to see if a clips end or start point overlaps with that of another object in the time line
!timeline.Any( o => o.ValueObject.start <= vo.end && o.ValueObject.end >= vo.start )
But this is giving me very inaccurate results for some reasons. The center point of the clip seems to be fine but any time i check the start and end points it gives very weird results as if the box is shifted over x-amount of pixels.