Author Topic: Wierd error in 3.7.3  (Read 2901 times)

hrlarsen

  • Newbie
  • *
  • Thank You
  • -Given: 0
  • -Receive: 3
  • Posts: 35
    • View Profile
Wierd error in 3.7.3
« on: September 23, 2014, 08:07:30 AM »
Hi

I just found this error is present after upgrading to 3.7.3 from 3.7.1. It happens when I drag across objects with an UIEventTrigger component, which can accidentally happen a lot on mobile devices :)


Failed to call function OnDragEnd of class UIEventTrigger
Calling function OnDragEnd with no parameters but the function requires 1.
UnityEngine.GameObject:SendMessage(String, Object, SendMessageOptions)
UICamera:Notify(GameObject, String, Object) (at Assets/NGUI/Scripts/UI/UICamera.cs:1065)
UICamera:ProcessTouch(Boolean, Boolean) (at Assets/NGUI/Scripts/UI/UICamera.cs:1768)
UICamera:ProcessMouse() (at Assets/NGUI/Scripts/UI/UICamera.cs:1402)
UICamera:ProcessTouches() (at Assets/NGUI/Scripts/UI/UICamera.cs:1474)
UICamera:Update() (at Assets/NGUI/Scripts/UI/UICamera.cs:1221)

Failed to call function OnDragStart of class UIEventTrigger
Calling function OnDragStart with no parameters but the function requires 1.
UnityEngine.GameObject:SendMessage(String, Object, SendMessageOptions)
UICamera:Notify(GameObject, String, Object) (at Assets/NGUI/Scripts/UI/UICamera.cs:1065)
UICamera:ProcessTouch(Boolean, Boolean) (at Assets/NGUI/Scripts/UI/UICamera.cs:1720)
UICamera:ProcessMouse() (at Assets/NGUI/Scripts/UI/UICamera.cs:1402)
UICamera:ProcessTouches() (at Assets/NGUI/Scripts/UI/UICamera.cs:1474)
UICamera:Update() (at Assets/NGUI/Scripts/UI/UICamera.cs:1221)


Looks like the inspector for UIEventTrigger do not cater OnDragStart and OnDragEnd, maybe this is the problem??

ArenMook

  • Administrator
  • Hero Member
  • *****
  • Thank You
  • -Given: 337
  • -Receive: 1171
  • Posts: 22,128
  • Toronto, Canada
    • View Profile
Re: Wierd error in 3.7.3
« Reply #1 on: September 23, 2014, 12:36:37 PM »
Hmm... remove the "GameObject" part from UIEventTrigger's function parameters:
  1.         void OnDragStart ()
  2.         {
  3.                 if (current != null) return;
  4.                 current = this;
  5.                 EventDelegate.Execute(onDragStart);
  6.                 current = null;
  7.         }
  8.  
  9.         void OnDragEnd ()
  10.         {
  11.                 if (current != null) return;
  12.                 current = this;
  13.                 EventDelegate.Execute(onDragEnd);
  14.                 current = null;
  15.         }

pretender

  • Full Member
  • ***
  • Thank You
  • -Given: 1
  • -Receive: 0
  • Posts: 155
    • View Profile
Re: Wierd error in 3.7.3
« Reply #2 on: September 24, 2014, 07:44:41 AM »
Is this going to be included in the next update? :)

ArenMook

  • Administrator
  • Hero Member
  • *****
  • Thank You
  • -Given: 337
  • -Receive: 1171
  • Posts: 22,128
  • Toronto, Canada
    • View Profile
Re: Wierd error in 3.7.3
« Reply #3 on: September 24, 2014, 02:38:09 PM »
Already in the Pro version, so yup!