Hi,
ok, after a request, I modified the logic I implemented in that package above to overcome a issue with it.
basically, it doesn't check the gameObject you touch. That is, you touch and drag and no matter what it will.
Now in many cases you actually want to have control over what you are dragging and certainly want to let the user drag what he has touched. The package attached to this post is a variation that takes into account this situation. The logic is moved into the camera to becomes generic to the scene.
To improve raycasting efficiency, I only raycast on a layer I created called "drag". All objects that can potentially be dragged are in this layer. It doesn't no mean that they are enabled for dragging, for this, I use a tag called "drag enabled" that I set on the object I want to be currently enabled for dragging, You can always set the tag of an object using the action "set tag". This layering it not mandatory, you could simply ignore layers and raycast everything and simply check for the tag itself.
The down side of this technic is that only one drag at a time can happen. This is likely fine, but if you want multiple dragging, then this dragging would have to be hosted by each individual gameObject that can be dragged, this way they work independtly and multi touch dragging can therefore happen.
As always, questions and comments are welcome,
Bye,
Jean