Thanks, but was does "and use the center of screen as the cursor" mean? I have a controller which has its own cursor. Or do I misunderstand that?
I had some issues, but the main part is this for interaction with buttons
protected override void BeforeUpdate()
{
#if UNITY_EDITOR || UNITY_STANDALONE || UNITY_WEBPLAYER || UNITY_WEBGL || UNITY_ANDROID
if (GvrController.ClickButtonDown) { OnMapBasePress(); }
else if (GvrController.ClickButtonUp) { OnMapBaseRelease(); }
}
and for position of controller:
public Vector2 GetInputPosition()
{
if (OnGetInputPosition != null) { Debug.Log("return OnGetInputPosition"); return OnGetInputPosition(); }
Vector2 vec2 = Input.mousePosition;
#if UNITY_HAS_GOOGLEVR && (UNITY_ANDROID || UNITY_EDITOR)
vec2 = DaydreamInput();
#endif
return vec2;
}
private Vector2 DaydreamInput()
{
Transform pointerTransform = pointer.GetPointerTransform();
float maxPointerDistance = pointer.GetMaxPointerDistance();
Vector3 pointerPos = pointerTransform.position + (pointerTransform.forward * maxPointerDistance);
Vector2 vector2 = new Vector2(pointerPos.x, pointerPos.y);
return vector2;
}
That works perfectly for a map which is in front of me directly. But if the map is under me (turned 90° over x axis), only the lng value changes. The translation from Vector3 to Vector2 seems to be a problem.