public TrackIRTracker() { Debug.Log("[KerbTrack] Initialising TrackIR..."); trackIRclient = new TrackIRUnity.TrackIRClient(); string status; if (trackIRclient == null) status = "Failed to start."; else status = trackIRclient.TrackIR_Enhanced_Init(); Debug.Log("[KerbTrack] TrackIR status: " + status); }
public TrackIRTracker() { Debug.Log("[KerbTrack] Initialising TrackIR..."); // TrackIRUnity's init throws a NullRef if the DLL location isn't found. // Check this before starting. bool keyFound = false; RegistryKey registryKey = Registry.CurrentUser.OpenSubKey("Software\\NaturalPoint\\NATURALPOINT\\NPClient Location", false); if (registryKey != null && registryKey.GetValue("Path") != null) { keyFound = true; } registryKey.Close(); string status; if (keyFound) { trackIRclient = new TrackIRUnity.TrackIRClient(); if (trackIRclient == null) { status = "Failed to start."; } else { status = trackIRclient.TrackIR_Enhanced_Init(); } } else { status = "TrackIR not installed"; } Debug.Log("[KerbTrack] TrackIR status: " + status); }
/// <summary> /// Get the trackIR client /// </summary> /// <returns></returns> private TrackIRClient GetTrackIR() { TrackIRClient trackIR = new TrackIRClient(); return(trackIR); }
public TrackIRWrapper() { _trackIR = GetTrackIR(); }