Skip to content

Instantly share code, notes, and snippets.

@lyokato
Created May 22, 2018 18:20
Show Gist options
  • Save lyokato/e594301a5598f8c84ee728c0f2caaf3a to your computer and use it in GitHub Desktop.
Save lyokato/e594301a5598f8c84ee728c0f2caaf3a to your computer and use it in GitHub Desktop.
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
namespace OVROSX {
public class HeadTracking : MonoBehaviour {
public static HeadTracking instance { get; private set; }
private void Awake()
{
// Only allow one instance at runtime.
if (instance != null)
{
enabled = false;
DestroyImmediate(this);
return;
}
instance = this;
}
#if UNITY_EDITOR
private MouseMoveTracker tracker;
void Start() {
tracker = new MouseMoveTracker(KeyCode.Space);
}
void Update () {
tracker.Update();
}
public Quaternion GetOrientation() {
return tracker.GetOrientation();
}
#endif
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment