//To add a trigger for Analog sensors public static void TriggerEventAnalog(string deviceType, string deviceName, VRPNAnalog.AnalogReport report) { if (eventManager == null) { Debug.LogError("There needs to be one active EventManger script on a GameObject in your scene."); return; } VRPNAnalogEvent thisEvent = null; if (instance.eventDictionaryAnalog.TryGetValue(deviceType + " " + deviceName, out thisEvent)) { thisEvent.Invoke(deviceType + " " + deviceName, report); } }
//To remove a listener for Analog sensors public static void StopListeningAnalog(VRPNManager.Analog_Types deviceType, VRPNDeviceConfig.Device_Names deviceName, UnityAction <string, VRPNAnalog.AnalogReport> listener) { if (eventManager == null) { Debug.LogError("There needs to be one active EventManger script on a GameObject in your scene."); return; } VRPNAnalogEvent thisEvent = null; if (instance.eventDictionaryAnalog.TryGetValue(deviceType.ToString() + " " + deviceName.ToString(), out thisEvent)) { thisEvent.RemoveListener(listener); } }