Author Topic: Drag'n'Drop problems on windows phone 8  (Read 2150 times)

Lotti

  • Newbie
  • *
  • Thank You
  • -Given: 5
  • -Receive: 0
  • Posts: 47
    • View Profile
Drag'n'Drop problems on windows phone 8
« on: February 10, 2014, 12:29:49 PM »
Hello! I implemented drag'n'drop watching your example...

so I extended UIDragDropItem to create my "drag behaviour" (let's call it dragItem) and everything works on editor, on iphone and android.

When i try to drag'n'drop on windows phone 8 it gives me errors saying that my class dragItem dosn't implement onDrag()!
(well it is private on UIDragDropItem so it isn't inherited, it does make sense... but why it works on other platforms??)

Thank you! :)

ArenMook

  • Administrator
  • Hero Member
  • *****
  • Thank You
  • -Given: 337
  • -Receive: 1171
  • Posts: 22,128
  • Toronto, Canada
    • View Profile
Re: Drag'n'Drop problems on windows phone 8
« Reply #1 on: February 10, 2014, 05:27:00 PM »
Something different in Unity's handling of the common SendMessage logic on WP8? That's all NGUI does -- just uses Unity's gameObject.SendMessage("OnDrag", delta);

I'd suggest creating an example of it without NGUI (just do your own SendMessage) and submitting a bug to Unity.

Lotti

  • Newbie
  • *
  • Thank You
  • -Given: 5
  • -Receive: 0
  • Posts: 47
    • View Profile
Re: Drag'n'Drop problems on windows phone 8
« Reply #2 on: March 26, 2014, 05:00:29 AM »
after a month i can paste a "fix" for windows phone 8. i dont' remember why i fixed it like this and where i copypasted this code from, but it works. I'm doing this post as answer to a guy who asked me for a solution with a pm.

simply add this code on the class that extends UIDragDropItem
  1. #if UNITY_WP8
  2.         new void OnDrag (Vector2 delta)
  3.         {
  4.                 if (!enabled || mTouchID != UICamera.currentTouchID) return;
  5.                 OnDragDropMove((Vector3)delta * mRoot.pixelSizeAdjustment);
  6.         }
  7.         new void OnPress (bool isPressed) { if (isPressed) mPressTime = RealTime.time; }
  8. #endif
  9.