GetUp() public static method

Gets the current up state of the given virtual button mask with the given controller mask. Returns true if any masked button was released this frame on any masked controller and no other masked button is still down this frame.
public static GetUp ( Button, virtualMask, Controller, controllerMask = Controller.Active ) : bool
virtualMask Button,
controllerMask Controller,
return bool
コード例 #1
0
    // Update is called once per frame
    void Update()
    {
        bool pressA = OVRInput.GetUp(OVRInput.Button.One);

        if (pressA)
        {
            SpawnBlock();
            gameStateText.text = "Catch and Balance the Cubes!";
        }
    }
コード例 #2
0
 // go back to the front Texts
 void backToFrontText()
 {
     if (OVRInput.GetUp(OVRInput.Button.PrimaryIndexTrigger))
     {
         afternoon.SetActive(false);
         preText.SetActive(true);
         preText2.SetActive(true);
         Home.GetComponent <LoadTextByWord>().rollBackCheck(1);
     }
 }
コード例 #3
0
    private void RotateRod()
    {
        var scrollAxis = Input.GetAxis("Mouse ScrollWheel");

        if (!isControllerChanged)
        {
            if (scrollAxis > 0)
            {
                rod.transform.rotation *= Quaternion.Euler(0, 0, 0.5f);
            }
            else if (scrollAxis < 0)
            {
                rod.transform.rotation *= Quaternion.Euler(0, 0, -0.5f);
            }
        }
        else
        {
            if (OVRInput.Get(OVRInput.Button.DpadLeft))
            {
                timer += Time.deltaTime;
                if (timer > 1)
                {
                    rod.transform.rotation *= Quaternion.Euler(0, 0, 0.5f);
                    timer -= 0.03f;
                }
            }
            else if (OVRInput.Get(OVRInput.Button.DpadRight))
            {
                timer += Time.deltaTime;
                if (timer > 1)
                {
                    rod.transform.rotation *= Quaternion.Euler(0, 0, -0.5f);
                    timer -= 0.03f;
                }
            }

            if (OVRInput.GetUp(OVRInput.Button.DpadLeft))
            {
                timer = 0;
            }
            else if (OVRInput.GetUp(OVRInput.Button.DpadRight))
            {
                timer = 0;
            }

            if (OVRInput.GetDown(OVRInput.Button.DpadLeft))
            {
                rod.transform.rotation *= Quaternion.Euler(0, 0, 0.5f);
            }
            else if (OVRInput.GetDown(OVRInput.Button.DpadRight))
            {
                rod.transform.rotation *= Quaternion.Euler(0, 0, -0.5f);
            }
        }
    }
コード例 #4
0
    // Update is called once per frame
    void FixedUpdate()
    {
        if (OVRInput.GetDown(OVRInput.Button.PrimaryIndexTrigger))
        {
            ShootHook();

            playerPhysics.TriggerPressed = true;
        }
        else if (OVRInput.GetUp(OVRInput.Button.PrimaryIndexTrigger))
        {
            hooked = false;

            returning = true;

            shooting = false;

            playerPhysics.TriggerPressed = false;
        }

        if (OVRInput.GetDown(OVRInput.Button.PrimaryTouchpad))
        {
            if (retractedObject != null)
            {
                retractedObject.parent = null;
                retractedObject.GetComponent <Rigidbody>().isKinematic = false;
                retractedObject.GetComponent <Collider>().enabled      = true;

                retractedObject.GetComponent <Rigidbody>().velocity        = OVRInput.GetLocalControllerVelocity(OVRInput.Controller.RTrackedRemote) * 50f;
                retractedObject.GetComponent <Rigidbody>().angularVelocity = OVRInput.GetLocalControllerAngularVelocity(OVRInput.Controller.RTrackedRemote) * .5f;



                returning = true;
            }
        }

        if (hooked)
        {
            ReelTowardsHook();
        }

        if (returning)
        {
            ReturnHook();
        }

        currentHookDistance = Vector3.Distance(hookOrigin.position, transform.position);

        if (currentHookDistance >= maxHookDistance)
        {
            returning = true;
        }

        RenderLine();
    }
コード例 #5
0
ファイル: Teleporter.cs プロジェクト: diaosuyidsy/VR-Research
    // Update is called once per frame
    void Update()
    {
        if (GameManager.GM.PlayerActionLock)
        {
            return;
        }
        // Cast out a ray from the controller to see where it is pointing
        Ray        ray = new Ray(Controller.transform.position, Controller.transform.forward);
        RaycastHit hit;

        // Check if the button is pressed and the ray hit an object
        // If so, make the line renderer visible
        if (Physics.Raycast(ray, out hit, RayLength, floor.value) &&
            OVRInput.Get(OVRInput.Button.PrimaryIndexTrigger))
        {
            Line.enabled = true;
            Line.SetPosition(0, Controller.transform.position);
            Line.SetPosition(1, hit.point);
            // Check if the object the ray hit is the ground
            if (hit.collider.tag == "Floor")
            {
                // If it is, make the target visible to visualize the target location
                if (!Target.activeSelf)
                {
                    Target.SetActive(true);
                }
                Target.transform.position = hit.point;
                Target.transform.rotation = transform.rotation;
            }
            else
            {
                Target.SetActive(false);
            }
        }
        // Check if the ray hit an object AND the button was just RELEASED
        else if (Physics.Raycast(ray, out hit, RayLength, floor.value) &&
                 OVRInput.GetUp(OVRInput.Button.PrimaryIndexTrigger))
        {
            // Check if the object the ray hit is the ground
            if (hit.collider.tag == "Floor")
            {
                // Move the player to that position
                Vector3 targetPosition = Target.transform.position;
                Player.position = new Vector3(targetPosition.x, targetPosition.y + Height, targetPosition.z);
                Target.SetActive(false);
                Line.enabled = false;
            }
        }
        // Make the target and line renderer invisible
        else
        {
            Target.SetActive(false);
            Line.enabled = false;
        }
    }
コード例 #6
0
    // Update is called once per frame
    void Update()
    {
        timer += Time.deltaTime;

        if (rightPointerObject != null)
        {
            previousPointerPos = rightPointerObject.gameObject.transform.position;
        }
        waistPosition = myCam.gameObject.transform.position - new Vector3(0, 1, 0);

        if (Input.GetKeyDown("j"))
        {
            Debug.Log("Pressed 'J' key.");
            Vector3    originPosition = myCam.gameObject.transform.position;
            Vector3    rayDirection   = myCam.gameObject.transform.forward;
            RaycastHit hit;
            if (Physics.Raycast(originPosition, rayDirection, out hit, 1))
            {
                GameObject          hitObject       = hit.collider.gameObject;
                CollectibleTreasure objectComponent = hitObject.GetComponent <CollectibleTreasure>();
                string objectName          = objectComponent.getType(); //should do a null reference check here
                CollectibleTreasure prefab = (CollectibleTreasure)Resources.Load(objectName, typeof(CollectibleTreasure));
                if (!prefab)
                {
                    Debug.Log("Prefab is null.");
                }
                addToInventory(prefab);
                Destroy(hitObject);
                updateTreasure();
                treasureItems[currentTreasureIndex].gameObject.active = true;
            }
            //triggerTrap();
        }
        else if (OVRInput.GetDown(OVRInput.RawButton.RHandTrigger))
        {
            Collider[] overlappingThings = Physics.OverlapSphere(rightPointerObject.transform.position, 0.1f, collectiblesMask);
            if (overlappingThings.Length > 0)
            {
                attachGameObjectToAChildGameObject(overlappingThings[0].gameObject, rightPointerObject, AttachmentRule.KeepWorld, AttachmentRule.KeepWorld, AttachmentRule.KeepWorld, true);
                //I'm not bothering to check for nullity because layer mask should ensure I only collect collectibles.
                thingIGrabbed = overlappingThings[0].gameObject.GetComponent <CollectibleTreasure>();
                if ((thingIGrabbed == trapTreasure) && !(trapTriggered))
                {
                    triggerTrap();
                }
            }
        }
        else if (OVRInput.GetUp(OVRInput.RawButton.RHandTrigger))
        {
            if (!(null == thingIGrabbed))
            {
                letGo();
            }
        }
    }
コード例 #7
0
 // Update is called once per frame
 void Update()
 {
     if (OVRInput.Get(OVRInput.Button.PrimaryIndexTrigger))
     {
         OnTriggerPressed();
     }
     else if (OVRInput.GetUp(OVRInput.Button.PrimaryIndexTrigger))
     {
         OnTriggerReleased();
     }
 }
コード例 #8
0
 // Update is called once per frame
 void Update()
 {
     if (rollbacksign == false && OVRInput.GetUp(OVRInput.Button.PrimaryHandTrigger))
     {
         IndexTrigger.SetActive(true);
     }
     else if (rollbacksign == true && OVRInput.GetUp(OVRInput.Button.PrimaryHandTrigger))
     {
         Home.SetActive(true);
     }
 }
コード例 #9
0
 void Update()
 {
     if (OVRInput.GetDown(OVRInput.Button.One))
     {
         triggerHeld = true;
     }
     else if (OVRInput.GetUp(OVRInput.Button.One))
     {
         triggerHeld = false;
     }
 }
コード例 #10
0
 void Update()
 {
     if (Input.GetKeyDown(KeyCode.G) || OVRInput.GetUp(OVRInput.RawButton.Y))
     {
         rigBody.useGravity = !rigBody.useGravity;
     }
     if (rigBody.useGravity == false)
     {
         RotateObject();
     }
 }
コード例 #11
0
 public void Update()
 {
     if (OVRInput.GetDown(teleportButton, controller))
     {
         teleport.StartTeleport();
     }
     if (OVRInput.GetUp(teleportButton, controller))
     {
         teleport.Teleport();
     }
 }
コード例 #12
0
 // go back to the front Texts
 void backToFrontText()
 {
     if (OVRInput.GetUp(OVRInput.Button.PrimaryIndexTrigger))
     {
         flowerLand.SetActive(false);
         Boy.SetActive(false);
         preText.SetActive(true);
         print("roll back");
         preText.GetComponent <LoadTextP12>().rollBackCheck(1);
     }
 }
コード例 #13
0
 public void HandleMenuToggle()
 {
     if (menu.activeSelf && (Input.GetKeyDown(KeyCode.I) || OVRInput.GetDown(OVRInput.RawButton.Y)))
     {
         menu.SetActive(false);
     }
     else if (!menu.activeSelf && (Input.GetKeyDown(KeyCode.I) || OVRInput.GetUp(OVRInput.RawButton.Y)))
     {
         menu.SetActive(true);
     }
 }
コード例 #14
0
    void Start()
    {
        if (uiText != null)
        {
            uiText.supportRichText = false;
        }

        data = new StringBuilder(2048);

        monitors = new List <BoolMonitor>()
        {
            // virtual
            new BoolMonitor("WasRecentered", () => OVRInput.GetControllerWasRecentered()),
            new BoolMonitor("One", () => OVRInput.Get(OVRInput.Button.One)),
            new BoolMonitor("OneDown", () => OVRInput.GetDown(OVRInput.Button.One)),
            new BoolMonitor("OneUp", () => OVRInput.GetUp(OVRInput.Button.One)),
            new BoolMonitor("One (Touch)", () => OVRInput.Get(OVRInput.Touch.One)),
            new BoolMonitor("OneDown (Touch)", () => OVRInput.GetDown(OVRInput.Touch.One)),
            new BoolMonitor("OneUp (Touch)", () => OVRInput.GetUp(OVRInput.Touch.One)),
            new BoolMonitor("Two", () => OVRInput.Get(OVRInput.Button.Two)),
            new BoolMonitor("TwoDown", () => OVRInput.GetDown(OVRInput.Button.Two)),
            new BoolMonitor("TwoUp", () => OVRInput.GetUp(OVRInput.Button.Two)),
            new BoolMonitor("PrimaryIndexTrigger", () => OVRInput.Get(OVRInput.Button.PrimaryIndexTrigger)),
            new BoolMonitor("PrimaryIndexTriggerDown", () => OVRInput.GetDown(OVRInput.Button.PrimaryIndexTrigger)),
            new BoolMonitor("PrimaryIndexTriggerUp", () => OVRInput.GetUp(OVRInput.Button.PrimaryIndexTrigger)),
            new BoolMonitor("PrimaryIndexTrigger (Touch)", () => OVRInput.Get(OVRInput.Touch.PrimaryIndexTrigger)),
            new BoolMonitor("PrimaryIndexTriggerDown (Touch)", () => OVRInput.GetDown(OVRInput.Touch.PrimaryIndexTrigger)),
            new BoolMonitor("PrimaryIndexTriggerUp (Touch)", () => OVRInput.GetUp(OVRInput.Touch.PrimaryIndexTrigger)),
            new BoolMonitor("PrimaryHandTrigger", () => OVRInput.Get(OVRInput.Button.PrimaryHandTrigger)),
            new BoolMonitor("PrimaryHandTriggerDown", () => OVRInput.GetDown(OVRInput.Button.PrimaryHandTrigger)),
            new BoolMonitor("PrimaryHandTriggerUp", () => OVRInput.GetUp(OVRInput.Button.PrimaryHandTrigger)),
            new BoolMonitor("Up", () => OVRInput.Get(OVRInput.Button.Up)),
            new BoolMonitor("Down", () => OVRInput.Get(OVRInput.Button.Down)),
            new BoolMonitor("Left", () => OVRInput.Get(OVRInput.Button.Left)),
            new BoolMonitor("Right", () => OVRInput.Get(OVRInput.Button.Right)),
            new BoolMonitor("Touchpad (Click)", () => OVRInput.Get(OVRInput.Button.PrimaryTouchpad)),
            new BoolMonitor("TouchpadDown (Click)", () => OVRInput.GetDown(OVRInput.Button.PrimaryTouchpad)),
            new BoolMonitor("TouchpadUp (Click)", () => OVRInput.GetUp(OVRInput.Button.PrimaryTouchpad)),
            new BoolMonitor("Touchpad (Touch)", () => OVRInput.Get(OVRInput.Touch.PrimaryTouchpad)),
            new BoolMonitor("TouchpadDown (Touch)", () => OVRInput.GetDown(OVRInput.Touch.PrimaryTouchpad)),
            new BoolMonitor("TouchpadUp (Touch)", () => OVRInput.GetUp(OVRInput.Touch.PrimaryTouchpad)),

            // raw
            new BoolMonitor("Start", () => OVRInput.Get(OVRInput.RawButton.Start)),
            new BoolMonitor("StartDown", () => OVRInput.GetDown(OVRInput.RawButton.Start)),
            new BoolMonitor("StartUp", () => OVRInput.GetUp(OVRInput.RawButton.Start)),
            new BoolMonitor("Back", () => OVRInput.Get(OVRInput.RawButton.Back)),
            new BoolMonitor("BackDown", () => OVRInput.GetDown(OVRInput.RawButton.Back)),
            new BoolMonitor("BackUp", () => OVRInput.GetUp(OVRInput.RawButton.Back)),
            new BoolMonitor("A", () => OVRInput.Get(OVRInput.RawButton.A)),
            new BoolMonitor("ADown", () => OVRInput.GetDown(OVRInput.RawButton.A)),
            new BoolMonitor("AUp", () => OVRInput.GetUp(OVRInput.RawButton.A)),
        };
    }
コード例 #15
0
 private void HandleKey(OVRInput.Button button, OVRInput.Controller controller, DirectInput.ScanCode scancode)
 {
     if (OVRInput.GetDown(button, controller))
     {
         DirectInput.Input.SendKey(scancode, false);
     }
     if (OVRInput.GetUp(button, controller))
     {
         DirectInput.Input.SendKey(scancode, true);
     }
 }
コード例 #16
0
    // Update is called once per frame
    void Update()
    {
        if (isDashing)
        {
            lerpTime += Time.deltaTime * dashSpeed;
            player.transform.position = Vector3.Lerp(playerStartPos, teleportLocation + Vector3.down * 0.5f, lerpTime);
            if (lerpTime >= 1)
            {
                isDashing = false;
                lerpTime  = 0;
            }
        }
        else
        {
            if (OVRInput.Get(OVRInput.Button.PrimaryIndexTrigger))
            {
                laser.enabled = true;
                teleportAimerObject.gameObject.SetActive(true);

                laser.SetPosition(0, gameObject.transform.position);
                RaycastHit hit;
                if (Physics.Raycast(transform.position, transform.forward, out hit, 15, laserMask))
                {
                    teleportLocation = hit.point;
                    laser.SetPosition(1, teleportLocation);

                    teleportAimerObject.transform.position = new Vector3(teleportLocation.x, teleportLocation.y + yAmount, teleportLocation.z);
                }
                else
                {
                    teleportAimerObject.transform.position = new Vector3(transform.forward.x * 15 + transform.position.x,
                                                                         transform.forward.y * 15 + transform.position.y,
                                                                         transform.forward.z * 15 + transform.position.z);
                    RaycastHit groundRay;
                    if (Physics.Raycast(teleportLocation, -Vector3.up, out groundRay, 17, laserMask))
                    {
                        teleportLocation = new Vector3(teleportLocation.x, groundRay.point.y, teleportLocation.z);
                    }
                    laser.SetPosition(1, transform.forward * 15 + transform.position);
                    teleportAimerObject.transform.position = teleportLocation + new Vector3(0, yAmount, 0);
                }
            }


            if (OVRInput.GetUp(OVRInput.Button.PrimaryIndexTrigger))
            {
                laser.enabled = false;
                teleportAimerObject.gameObject.SetActive(false);
                //player.transform.position = teleportLocation;
                playerStartPos = player.transform.position;
                isDashing      = true;
            }
        }
    }
コード例 #17
0
ファイル: Grabber.cs プロジェクト: astrohoff/Mixed_Reality
 private bool CheckGrabUp()
 {
     if (isLeft)
     {
         return(OVRInput.GetUp(OVRInput.Button.PrimaryHandTrigger));
     }
     else
     {
         return(OVRInput.GetUp(OVRInput.Button.SecondaryHandTrigger));
     }
 }
コード例 #18
0
 // Update is called once per frame
 void Update()
 {
     if (OVRInput.GetDown(OVRInput.Button.PrimaryHandTrigger))
     {
         animator.SetBool("Grab", true);
     }
     else if (OVRInput.GetUp(OVRInput.Button.PrimaryHandTrigger))
     {
         animator.SetBool("Grab", false);
     }
 }
コード例 #19
0
 // Update is called once per frame
 void Update()
 {
     if (OVRInput.GetDown(OVRInput.Button.PrimaryIndexTrigger, controller))
     {
         GrabPoint();
     }
     if (OVRInput.GetUp(OVRInput.Button.PrimaryIndexTrigger, controller))
     {
         ReleasePoint();
     }
 }
コード例 #20
0
ファイル: GVRControllerStatus.cs プロジェクト: NYUGP17/FRL.XR
 public override bool GetTouchUp(XRButton button)
 {
     if (button == XRButton.Touchpad)
     {
         return(OVRInput.GetUp(OVRInput.Touch.PrimaryTouchpad));
     }
     else
     {
         return(false);
     }
 }
コード例 #21
0
ファイル: BBVRController.cs プロジェクト: nklsrh/UnchartedVR
    public void Logic()
    {
        // RaycastGaze();

        Vector2 touchPadInput = OVRInput.Get(OVRInput.Axis2D.PrimaryTouchpad);
        Vector3 accelerator   = new Vector3(touchPadInput.x, 0, touchPadInput.y);

#if UNITY_EDITOR
        accelerator = new Vector3(Input.GetAxis("Horizontal"), 0, Input.GetAxis("Vertical"));
        if (!IsHolding && !HasHeld)
        {
            playerController.transform.Rotate(accelerator.z, accelerator.x, 0);
        }
#endif

        bool isJustClicked = OVRInput.GetUp(OVRInput.Button.One);

        if (HasHeld)
        {
            //firstPressTeleportPoint = pointerAttack.position;
            //teleportReticule.position = firstPressTeleportPoint;
            //teleportReticule.up = teleportReticuleUpNormal;

            //teleportReticule.localScale = Vector3.one * Mathf.Clamp((teleportReticule.position - transform.position).sqrMagnitude * 0.05f, 0.5f, 10);
        }
        else if (IsHolding)
        {
            //teleportLookDirection = Camera.main.transform.TransformVector(accelerator);
            //teleportLookDirection.y = 0;
            //teleportReticule.forward = teleportLookDirection;
        }
        else if (HasLifted)
        {
            isJustClicked = true;
        }


        if (isJustClicked)
        {
            //playerController.mover.TeleportTo(this.pointerAttack.transform.position);
            //playerController.mover.transform.rotation = Quaternion.LookRotation(teleportLookDirection, Vector3.up);
            // TODO - orient using VR controller's forward direction as well

            playerController.PressActionButton();
        }

        transform.position = playerController.transform.position + Vector3.up * cameraHeight;
        transform.rotation = Quaternion.Euler(playerController.transform.rotation.eulerAngles.x, playerController.transform.rotation.eulerAngles.y, 0);


        RaycastHand();

        CheckFiring();
    }
コード例 #22
0
 void Update()
 {
     if (Input.GetButtonDown("Fire1") || OVRInput.GetDown(OVRInput.Button.One))
     {
         PS.Play();
     }
     else if (Input.GetButtonUp("Fire1") || OVRInput.GetUp(OVRInput.Button.One))
     {
         PS.Stop();
     }
 }
コード例 #23
0
 // Update is called once per frame
 void Update()
 {
     if (OVRInput.GetDown(OVRInput.RawButton.RHandTrigger) && !grabbing)
     {
         GrabObject();
     }
     if (OVRInput.GetUp(OVRInput.RawButton.RHandTrigger) && grabbing)
     {
         DropObject();
     }
 }
コード例 #24
0
 public void Teleport()
 {
     if (OVRInput.GetUp(OVRInput.Button.PrimaryIndexTrigger, OVRInput.Controller.RTrackedRemote))
     {
         if (teleportMarker.activeSelf)
         {
             Vector3 markerPosition = teleportMarker.transform.position;
             positionOfPlayer.position = new Vector3(markerPosition.x, positionOfPlayer.position.y, markerPosition.z);
         }
     }
 }
コード例 #25
0
 void Update()
 {
     if (Input.GetMouseButtonDown(1) || OVRInput.GetDown(OVRInput.Button.SecondaryShoulder))
     {
         FadeToGhostMode( );
     }
     else if (Input.GetMouseButtonUp(1) || OVRInput.GetUp(OVRInput.Button.SecondaryShoulder))
     {
         FadeToNormalMode( );
     }
 }
コード例 #26
0
    void Update()
    {
        FireballPosition();

        int layer_mask = LayerMask.GetMask("Firework");

        Vector3 forward = transform.TransformDirection(Vector3.forward);

        Debug.DrawRay(transform.position, forward, Color.green);



        // if Raycast hits something = frontobject will snap to that something.
        //if (Physics.Raycast(transform.position, (forward), out hit))
        //{
        //    if (hit.collider.gameObject.tag == "Firework")
        //    {
        //        frontObject.transform.position = hit.point;
        //    }
        //    else
        //    {
        //        FireballPosition();
        //    }
        //}

        if (OVRInput.GetDown(OVRInput.Button.PrimaryIndexTrigger) || Input.GetButtonDown("Jump"))
        {
            running = true;
        }

        if (OVRInput.GetUp(OVRInput.Button.PrimaryIndexTrigger) || Input.GetButtonUp("Jump"))
        {
            running = false;
        }

        if (running == true)
        {
            distance += Speed;
        }
        else
        {
            distance -= Speed;
        }

        if (distance <= setDistance)
        {
            distance = setDistance;
        }

        if (distance >= 20)
        {
            distance = 20;
        }
    }
コード例 #27
0
    // go back to the front Texts
    void backToFrontText()
    {
        if (OVRInput.GetUp(OVRInput.Button.PrimaryIndexTrigger))
        {
            //CurrentEffect.SetActive(false);
            cueForWallReading.SetActive(false);
            footprints.SetActive(false);

            preText.SetActive(true);
            preText.GetComponent <LoadTextWall>().rollBackCheck(1);
        }
    }
コード例 #28
0
 // GetUp - Touch
 public static bool GetUp(OVRInput.Touch input)
 {
     InitOVRInput();
     if (_touchKeycodeMap.ContainsKey(input))
     {
         if (Input.GetKeyUp(_touchKeycodeMap[input]))
         {
             return(true);
         }
     }
     return(OVRInput.GetUp(input));
 }
コード例 #29
0
    private void HandleJoystickInput()
    {
        Vector2 r = OVRInput.Get(OVRInput.Axis2D.SecondaryThumbstick);

        //debug.text = "x: " + r.x + "  y:" + r.y;
        if (canGetThumbstick)
        {
            if (Mathf.Abs(r.x) > axisThreshold)
            {
                canGetThumbstick = false;
                if (r.x < 0f)
                {
                    // thumstick: left
                    mode = RightThumbStickModes.LoadAndSave;
                }
                else
                {
                    //thumstick:right
                    mode = RightThumbStickModes.Freefly;
                }
                UpdateUI(true);
            }
            else if (Mathf.Abs(r.y) > axisThreshold)
            {
                canGetThumbstick = false;
                if (r.y > 0f)
                {
                    // thumstick: top
                    mode = RightThumbStickModes.UprightFly;
                }
                else
                {
                    //thumstick: bottom
                    mode = RightThumbStickModes.Measurement;
                }
                UpdateUI(true);
            }
        }
        else
        {
            //wait for reset here
            if (r.x == 0f && r.y == 0f)
            {
                canGetThumbstick = true;
            }
        }

        if (OVRInput.GetUp(OVRInput.Button.SecondaryThumbstick))
        {
            mode = RightThumbStickModes.None;
            UpdateUI(false);
        }
    }
コード例 #30
0
    private void CheckInputForLoadAndSave()
    {
        if (OVRInput.GetUp(loadButton))
        {
            loadAndSave.Load();
        }

        if (OVRInput.GetUp(saveButton))
        {
            loadAndSave.Save();
        }
    }