So I made custom script like this,
public class NguiDragRevise : UIDragDropItem {
public UIScrollView myscroll;
void Start(){
myscroll = GameObject.Find("AllyScroll").GetComponent<UIScrollView>();
}
protected override void OnDragDropRelease(GameObject obj)
{
myscroll.RestrictWithinBounds(false);
base.OnDragDropRelease(obj);
}
}
For solve my last post's dragging problem.
When I attach this script instead of UIDragDropItem script, and if I try to move this item out, error says,
------------
NullReferenceException: Object reference not set to an instance of an object
UIDragDropItem.OnDrag (Vector2 delta) (at Assets/NGUI/Scripts/Interaction/UIDragDropItem.cs:169)
UnityEngine.GameObject:SendMessage(String, Object, SendMessageOptions)
UICamera:Notify(GameObject, String, Object) (at Assets/NGUI/Scripts/UI/UICamera.cs:1052)
UICamera:ProcessTouch(Boolean, Boolean) (at Assets/NGUI/Scripts/UI/UICamera.cs:1721)
UICamera:ProcessMouse() (at Assets/NGUI/Scripts/UI/UICamera.cs:1388)
UICamera:ProcessTouches() (at Assets/NGUI/Scripts/UI/UICamera.cs:1460)
UICamera:Update() (at Assets/NGUI/Scripts/UI/UICamera.cs:1207)
-----------
What is problem, how solve?