Author Topic: Issue with onDragFinished in UIScrollView and UICenterOnChild  (Read 3447 times)

cyx

  • Newbie
  • *
  • Thank You
  • -Given: 0
  • -Receive: 0
  • Posts: 17
    • View Profile
Issue with onDragFinished in UIScrollView and UICenterOnChild
« on: October 08, 2014, 11:33:15 AM »
Hi,

I have a problem assigning an OnDragFinished-Handler with:

  1. scrollView.onDragFinished += OnDragFinished; //in my Start())

because there is another OnDragFinished in UICenterOnChild which is assigned in Recenter line 85 via "=".

This overrides my delegate call and my own OnDragFinished is never called.

I can fix it if I add a "+=" in line 85 but I don't know if that's the right approach.

NGUI: 3.7.4

I appreciate your help.

ArenMook

  • Administrator
  • Hero Member
  • *****
  • Thank You
  • -Given: 337
  • -Receive: 1171
  • Posts: 22,128
  • Toronto, Canada
    • View Profile
Re: Issue with onDragFinished in UIScrollView and UICenterOnChild
« Reply #1 on: October 08, 2014, 01:31:24 PM »
This only happens the first time you do a Recenter(), but you can probably change it to += without any issues. Try it.