Example #1
0
 //Public method that allows to start recording in the indicated path
 //It registers the listener method in the event manager
 public void StartRecording()
 {
     data.deviceType = TrackerType.ToString();
     data.deviceName = TrackerName.ToString();
     VRPNEventManager.StartListeningTracker(TrackerType, TrackerName, Record);
     isRecording = true;
 }
Example #2
0
 //Public method that allows to start recording in the indicated path
 //It registers the listener method in the event manager
 public void StartRecording()
 {
     data.deviceType = ButtonType.ToString();
     data.deviceName = ButtonName.ToString();
     VRPNEventManager.StartListeningButton(ButtonType, ButtonName, Record);
     isRecording = true;
 }
Example #3
0
 //Public method that allows to start recording in the indicated path
 //It registers the listener method in the event manager
 public void StartRecording()
 {
     data.deviceType = AnalogType.ToString();
     data.deviceName = AnalogName.ToString();
     VRPNEventManager.StartListeningAnalog(AnalogType, AnalogName, Record);
     isRecording = true;
 }
Example #4
0
    //To add a listener for Buttons
    public static void StartListeningButton(VRPNManager.Button_Types deviceType, VRPNDeviceConfig.Device_Names deviceName, UnityAction <string, VRPNButton.ButtonReport> listener)
    {
        if (eventManager == null)
        {
            Debug.LogError("There needs to be one active EventManger script on a GameObject in your scene.");
            return;
        }
        VRPNButtonEvent thisEvent = null;

        if (instance.eventDictionaryButton.TryGetValue(deviceType.ToString() + " " + deviceName.ToString(), out thisEvent))
        {
            thisEvent.AddListener(listener);
        }
        else
        {
            thisEvent = new VRPNButtonEvent();
            thisEvent.AddListener(listener);
            instance.eventDictionaryButton.Add(deviceType.ToString() + " " + deviceName.ToString(), thisEvent);
        }
    }
Example #5
0
    bool StartTracker()
    {
        if (VRPNManager.initialized)
        {
            // Register Tracker Device
            VRPNTrackerStart(TrackerName.ToString(), (int)Derivation);
            num_trackers++;

            // Set up debug window
            if (ShowDebug)
            {
                debug_xoffset = num_trackers * 210;
                if (VRPNManager.debug_flag)
                {
                    debug_xoffset += 405;
                }
            }
            initialized = true;
            return(true);
        }
        return(false);
    }
Example #6
0
    private bool StartButton()
    {
        if (VRPNManager.initialized)
        {
            // Register Button Device
            VRPNButtonStart(ButtonName.ToString());
            num_buttons++;

            // Set up debug window
            if (ShowDebug)
            {
                debug_xoffset = num_buttons * 210;
                if (VRPNManager.debug_flag)
                {
                    debug_xoffset += 405;
                }
            }
            initialized = true;
            return(true);
        }
        return(false);
    }
Example #7
0
    private bool StartAnalog()
    {
        if (VRPNManager.initialized)
        {
            // Register Analog Device
            VRPNAnalogStart(AnalogName.ToString());
            num_analogs++;

            // Set up debug window
            if (ShowDebug)
            {
                debug_xoffset = num_analogs * 210;
                if (VRPNManager.debug_flag)
                {
                    debug_xoffset += 405;
                }
            }
            initialized = true;
            return(true);
        }
        return(false);
    }
Example #8
0
    //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);
        }
    }