// Use this for initialization void Start() { if (0 == path.Length) { Debug.LogError("Missing path for OrientationInterface " + gameObject.name); return; } iface = OSVR.Unity.ClientKit.instance.context.getInterface(path); cb = new OSVR.ClientKit.OrientationCallback(callback); iface.registerCallback(cb, IntPtr.Zero); }
public void RegisterCallback(OrientationCallback callback) { Start(); // make sure the interface is initialized. if (null == orientationCallbacks) { orientationCallbacks = callback; rawOrientationCallback = new OSVR.ClientKit.OrientationCallback(OrientationCb); iface.registerCallback(rawOrientationCallback, System.IntPtr.Zero); } else { orientationCallbacks += callback; } }