コード例 #1
0
 private void DoTriggerReleased(object sender, ControllerInteractionEventArgs e)
 {
     tooltips.ToggleTips(false, VRTK_ControllerTooltips.TooltipButtons.TriggerTooltip);
     actions.ToggleHighlightTrigger(false);
     if (!events.AnyButtonPressed())
     {
         actions.SetControllerOpacity(1f);
     }
 }
コード例 #2
0
 private void DoTriggerReleased(object sender, ControllerInteractionEventArgs e)
 {
     tooltips.ToggleTips(false, VRTK_ControllerTooltips.TooltipButtons.TriggerTooltip);
     highligher.UnhighlightElement(SDK_BaseController.ControllerElements.Trigger);
     if (pulseTriggerHighlightColor)
     {
         CancelInvoke("PulseTrigger");
     }
     if (!events.AnyButtonPressed())
     {
         VRTK_ObjectAppearance.SetOpacity(VRTK_DeviceFinder.GetModelAliasController(events.gameObject), defaultOpacity);
     }
 }
コード例 #3
0
    private void CheckRestart()
    {
        // assign left and right controllers controller events
        if (leftCE == null)
        {
            if (GameObject.Find("LeftControllerAlias") != null)
            {
                leftCE = GameObject.Find("LeftControllerAlias").GetComponent <VRTK_ControllerEvents>();
            }
        }

        if (rightCE == null)
        {
            if (GameObject.Find("RightControllerAlias") != null)
            {
                rightCE = GameObject.Find("RightControllerAlias").GetComponent <VRTK_ControllerEvents>();
            }
        }

        if (leftCE != null && rightCE != null)
        {
            if (leftCE.AnyButtonPressed() || rightCE.AnyButtonPressed())
            {
                RestartGame();
            }
        }
    }
コード例 #4
0
    // Update is called once per frame
    void Update()
    {
        if (canvas == null)
        {
            canvas = GameObject.FindGameObjectWithTag("Canvas");
        }
        if (start)
        {
            PointerLeft.enabled = false;
            FlightLeft.enabled  = false;
            MAILeft.enabled     = false;

            PointerRight.enabled = false;
            FlightRight.enabled  = false;
            MAIRight.enabled     = false;

            if (contrlEventsLeft.AnyButtonPressed() || contrlEventsRight.AnyButtonPressed())
            {
                PointerLeft.enabled = true;
                FlightLeft.enabled  = true;
                MAILeft.enabled     = true;

                PointerRight.enabled = true;
                FlightRight.enabled  = true;
                MAIRight.enabled     = true;

                canvas.SetActive(false);

                start = false;

                this.enabled = false;
            }
        }
    }
コード例 #5
0
    private void Update()
    {
        bool anyButton = controllerEvents.AnyButtonPressed();

        if (!this.anyButton && anyButton)
        {
            anyButtonPressed.Raise(controllerEvents.gameObject);
        }
        this.anyButton = anyButton;
    }