Hi
I have a scenario where an joystick (drag object) has an arrow to the side. If the user presses the arrow the joystick should snap to under their finger and become the active UI component so when the user slides their finger, the joystick moves with it.
So, when the button is pressed I've gotten the code:
button.SendMessage("OnPress", false); // Deactivate button
joystick.SendMessage("OnPress", true); // Activate joystick
UICamera.currentTouch.dragged = joystick; // Make the joystick the camera's current drag objectWhich works in that it results in the joystick being dragged after a finger is slid off the button BUT it seems that that breaks something else as the joystick doesn't move as it normally does (like when its pressed directly and ragged around. With my method via the button it jumps off the panel).
Is there already a way of doing this? Or if not how should I go about implementing the functionality?
P.S Here's the image link just incase:
http://imgur.com/IrTH6C1 (wasn't displaying properly in the post for me)