Exemplo n.º 1
0
    /// <summary>
    /// Update Function, process input by cycling through items or changing the activation state of the Canvas.
    /// </summary>
    void Update()
    {
        // Turn Inventory On & Off
        if (VRButton.onPressed(SwitchButton))
        {
            generatorInstance.gameObject.SetActive(CurrentInventoryState = !CurrentInventoryState);
            if (CurrentInventoryState)
            {
                SaveHandIndexes();
            }
            else
            {
                ComputeSelection(MGR_VRControls.get.RightHand, MGR_VRControls.get.LeftHand);
            }
        }

        // Cycle Through Items
        if (CurrentInventoryState)
        {
            if (VRButton.onPressed(CycleLeftHand))
            {
                CycleItem(VRHand.Hand.LEFT);
            }
            if (VRButton.onPressed(CycleRightHand))
            {
                CycleItem(VRHand.Hand.RIGHT);
            }
        }
    }
Exemplo n.º 2
0
 /// <summary>
 /// Update Function, change the Camera to the next on the list.
 /// </summary>
 private void Update()
 {
     if (VRButton.onPressed(switchButton) && AllCams != null)
     {
         if (MGR_Camera.ChangeCamera(AllCams[(currIndex + 1) % AllCams.Count]))
         {
             currIndex = ++currIndex % AllCams.Count;
         }
     }
 }