Example #1
0
    void OnEnable()
    {
        InputDevices.deviceConnected += RegisterDevices;
        List <InputDevice> devices = new List <InputDevice>();

        InputDevices.GetDevices(devices);
        for (int i = 0; i < devices.Count; i++)
        {
            RegisterDevices(devices[i]);
        }

        m_RightControllerState.Initalize();
        m_LeftControllerState.Initalize();

        m_RightControllerState.SetGameObject(ControllerStates.Select, m_RightBaseController);
        m_RightControllerState.SetGameObject(ControllerStates.Teleport, m_RightTeleportController);

        m_LeftControllerState.SetGameObject(ControllerStates.Select, m_LeftBaseController);
        m_LeftControllerState.SetGameObject(ControllerStates.Teleport, m_LeftTeleportController);

        m_LeftControllerState.ClearAll();
        m_RightControllerState.ClearAll();
    }