I am working on a small touch gesture API in C++ all set with my gesture libraries. I want to use Unity as my front for the visualization. But I want to know if I can use my library in unity, maybe write it as a plugin. Also, I want to know if Unity has the capability of letting me extract their raw touch data to detect the user’s touch pressure being applied?
I don’t have much experience with C++ plugins for unity but I guess this page should help :
About getting raw touch data, something like this should do the trick :
#using UnityEngine;
public class TouchManager : MonoBehaviour
{
void Update()
{
if (Input.touchCount != 0)
{
foreach (Touch touch in Input.touches)
{
// Do your stuff here
}
}
}
}