Skip to content

Instantly share code, notes, and snippets.

@tarukosu
Created May 6, 2017 12:16
Show Gist options
  • Save tarukosu/059d45afc6f68503f18da8ea147ca0d8 to your computer and use it in GitHub Desktop.
Save tarukosu/059d45afc6f68503f18da8ea147ca0d8 to your computer and use it in GitHub Desktop.
DestinationPlacement.cs
using HoloToolkit.Unity.InputModule;
using UnityEngine;
public class DestinationPlacement : MonoBehaviour, IInputClickHandler
{
void Start()
{
InputManager.Instance.PushFallbackInputHandler(gameObject);
}
public void OnInputClicked(InputClickedEventData eventData)
{
if (GazeManager.Instance.IsGazingAtObject)
{
var hitInfo = GazeManager.Instance.HitInfo;
transform.position = hitInfo.point + transform.localScale.y * Vector3.up;
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment