Created
May 22, 2018 18:20
-
-
Save lyokato/e594301a5598f8c84ee728c0f2caaf3a to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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