Exemplo n.º 1
0
    void Start()
    {
        Left  = SteamVR_Input_Sources.LeftHand;
        Right = SteamVR_Input_Sources.RightHand;

        action = SteamVR_Action.FindExistingActionForPartialPath("/actions/default/in/Trackpad");
        push   = SteamVR_Action.FindExistingActionForPartialPath("/actions/default/in/Button");
    }
Exemplo n.º 2
0
    /*
     *  @brief: function called when script instance is being loaded
     */
    void Awake()
    {
        // Attatch the correct action to each variable to track values from VR controllers
        joystick = SteamVR_Action.FindExistingActionForPartialPath("/actions/default/in/Trackpad");
        trigger  = SteamVR_Action.FindExistingActionForPartialPath("/actions/default/in/Squeeze");
        push     = SteamVR_Action.FindExistingActionForPartialPath("/actions/default/in/Button");

        // Attatches variables to Left / Right controllers
        Left  = SteamVR_Input_Sources.LeftHand;
        Right = SteamVR_Input_Sources.RightHand;

        // Clears the VR control array
        for (int i = 0; i < global.SteamVRControl.Length; i++)
        {
            global.SteamVRControl[i] = 0;
        }
    }