upgrade
This commit is contained in:
@@ -50,6 +50,7 @@ namespace Coolape
|
||||
oldScrollViewPos = _scrollView.transform.localPosition;
|
||||
oldClipOffset = _scrollView.panel.clipOffset;
|
||||
_scrollView.panel.cullWhileDragging = true;
|
||||
_scrollView.panel.onClipMove = OnMove;
|
||||
}
|
||||
}
|
||||
return _scrollView;
|
||||
@@ -703,5 +704,25 @@ namespace Coolape
|
||||
itemList.Insert (targetIndex, movedWidget);
|
||||
}
|
||||
}
|
||||
|
||||
protected virtual void OnMove(UIPanel panel)
|
||||
{
|
||||
if (scrollView == null) return;
|
||||
bool restrictWithinPanel = false;
|
||||
if (list == null || list.Count == 0)
|
||||
{
|
||||
restrictWithinPanel = true;
|
||||
}
|
||||
|
||||
if (!restrictWithinPanel && firstVislable && int.Parse(head.name) == 0)
|
||||
{
|
||||
restrictWithinPanel = true;
|
||||
}
|
||||
if (!restrictWithinPanel && lastVisiable && int.Parse(tail.name) == list.Count - 1)
|
||||
{
|
||||
restrictWithinPanel = true;
|
||||
}
|
||||
scrollView.restrictWithinPanel = restrictWithinPanel;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user